Files
ladill-hosting/resources/views/partials/launcher.blade.php
T
isaaccladandCursor e39a47fa1f
Deploy Ladill Hosting / deploy (push) Successful in 25s
Land on account overview and import hosted sites.
Route launcher and home hub entry to the account overview instead of the
control panel, label the sidebar app launcher, and extend hosting:import
to sync hosted_sites with platform_id matching for existing accounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 17:13:46 +00:00

54 lines
3.5 KiB
PHP

@php
// Shared Ladill app launcher — IDENTICAL across every app/service.
// Driven by config/ladill_launcher.php (fully-extracted apps only) + icons
// from public/images/launcher-icons/. Omits the current app (matched by
// APP_URL host). To replicate elsewhere, copy this file + the config +
// the launcher-icons folder verbatim.
$sidebar = (bool) ($sidebar ?? false);
$selfHost = parse_url((string) config('app.url'), PHP_URL_HOST);
$launcherApps = array_values(array_filter(
config('ladill_launcher.apps', []),
fn (array $app) => parse_url($app['url'], PHP_URL_HOST) !== $selfHost
));
@endphp
@if (! empty($launcherApps))
<div class="relative" x-data="{ appsOpen: false }" @click.outside="appsOpen = false" @keydown.escape.window="appsOpen = false">
<button type="button" @click="appsOpen = !appsOpen"
@class([
'inline-flex items-center justify-center rounded-xl border border-slate-200 text-slate-600 transition hover:bg-slate-50',
'p-2' => ! $sidebar,
'w-full gap-3 px-3 py-2 text-[13px] hover:text-slate-900' => $sidebar,
])
:class="appsOpen ? 'bg-slate-50 text-slate-900' : ''" aria-label="All apps">
<svg @class(['shrink-0', 'h-5 w-5' => ! $sidebar, 'h-[18px] w-[18px]' => $sidebar]) viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4.5 0.5H1.5C0.947715 0.5 0.5 0.947715 0.5 1.5V4.5C0.5 5.05228 0.947715 5.5 1.5 5.5H4.5C5.05228 5.5 5.5 5.05228 5.5 4.5V1.5C5.5 0.947715 5.05228 0.5 4.5 0.5Z"/>
<path d="M12.5 0.5H9.5C8.94772 0.5 8.5 0.947715 8.5 1.5V4.5C8.5 5.05228 8.94772 5.5 9.5 5.5H12.5C13.0523 5.5 13.5 5.05228 13.5 4.5V1.5C13.5 0.947715 13.0523 0.5 12.5 0.5Z"/>
<path d="M4.5 8.5H1.5C0.947715 8.5 0.5 8.94772 0.5 9.5V12.5C0.5 13.0523 0.947715 13.5 1.5 13.5H4.5C5.05228 13.5 5.5 13.0523 5.5 12.5V9.5C5.5 8.94772 5.05228 8.5 4.5 8.5Z"/>
<path d="M12.5 8.5H9.5C8.94772 8.5 8.5 8.94772 8.5 9.5V12.5C8.5 13.0523 8.94772 13.5 9.5 13.5H12.5C13.0523 13.5 13.5 13.0523 13.5 12.5V9.5C13.5 8.94772 13.0523 8.5 12.5 8.5Z"/>
</svg>
@if ($sidebar)
<span class="font-medium">All Ladill apps</span>
@endif
</button>
<div x-show="appsOpen" x-cloak x-transition.origin.top.right
@class([
'absolute z-50 w-72 rounded-2xl border border-slate-200 bg-white p-3 shadow-xl',
'right-0 mt-2' => ! $sidebar,
'bottom-full left-0 mb-2' => $sidebar,
])>
<p class="px-1 pb-2 text-[10px] font-bold uppercase tracking-widest text-slate-400">All apps</p>
<div class="grid grid-cols-3 gap-1">
@foreach ($launcherApps as $app)
<a href="{{ $app['url'] }}"
class="flex flex-col items-center gap-1.5 rounded-xl px-2 py-3 text-center transition hover:bg-indigo-50">
<span class="flex h-9 w-9 items-center justify-center rounded-lg bg-slate-100">
<img src="{{ asset('images/launcher-icons/'.$app['icon']) }}?v={{ @filemtime(public_path('images/launcher-icons/'.$app['icon'])) ?: '1' }}" alt="" class="h-5 w-5 object-contain" width="20" height="20">
</span>
<span class="text-[11px] font-medium leading-tight text-slate-700">{{ $app['name'] }}</span>
</a>
@endforeach
</div>
</div>
</div>
@endif