{{-- Command palette + keyboard shortcuts. Mounted ONCE in the persistent layout so it survives wire:navigate and its global keydown listener is registered only once. Strg/⌘-K opens it; "g" + a key navigates; "/" focuses the page search; "?" shows help. --}} @php $chords = [ ['Strg / ⌘ K', __('shell.cmdk_open')], ['/', __('shell.cmdk_focus_search')], ['?', __('shell.cmdk_show_help')], ['g d', __('shell.nav_dashboard')], ['g s', __('shell.nav_servers')], ['g i', __('shell.nav_services')], ['g f', __('shell.nav_files')], ['g l', __('shell.nav_audit')], ['g e', __('shell.nav_settings')], ['g y', __('shell.nav_system')], ['g v', __('shell.nav_versions')], ['g h', __('shell.nav_help')], ]; $nav = [ ['label' => __('shell.nav_dashboard'), 'href' => '/', 'hint' => 'g d'], ['label' => __('shell.nav_servers'), 'href' => '/servers', 'hint' => 'g s'], ['label' => __('shell.nav_services'), 'href' => '/services', 'hint' => 'g i'], ['label' => __('shell.nav_files'), 'href' => '/files', 'hint' => 'g f'], ['label' => __('shell.nav_audit'), 'href' => '/audit', 'hint' => 'g l'], ['label' => __('shell.nav_settings'), 'href' => '/settings', 'hint' => 'g e'], ['label' => __('shell.nav_system'), 'href' => '/system', 'hint' => 'g y'], ['label' => __('shell.nav_versions'), 'href' => '/versions', 'hint' => 'g v'], ['label' => __('shell.nav_help'), 'href' => config('clusev.docs_url'), 'hint' => 'g h'], ]; // Terminal is admin-only (manage-fleet) — add its "g t" chord + palette entry ONLY for admins, // so lower roles neither see it nor dead-end on the now-gated /terminal route. if (auth()->user()?->can('manage-fleet')) { $chords[] = ['g t', __('shell.nav_terminal')]; $nav[] = ['label' => __('shell.nav_terminal'), 'href' => '/terminal', 'hint' => 'g t']; } $actions = [ ['label' => __('servers.add_server'), 'action' => 'create-server', 'hint' => ''], ]; // Fleet servers become palette entries so "Strg/⌘ K → name/IP" jumps straight to a // server's details. `search` carries name + IP so either matches; the hint shows the IP. $servers = \App\Models\Server::orderBy('name')->get(['uuid', 'name', 'ip']) ->map(fn ($s) => [ 'label' => $s->name, 'href' => '/servers/'.$s->uuid, 'hint' => $s->ip, 'search' => $s->name.' '.$s->ip, ])->all(); $kbd = 'rounded border border-line bg-inset px-1.5 py-0.5 font-mono text-[10px] text-ink-2'; @endphp
{{-- Command palette --}} {{-- Shortcut help --}}