Add sidebar navigation and global command search
This commit is contained in:
+31
-12
@@ -45,6 +45,8 @@
|
||||
{ id: 'attention', label: 'Needs attention' }, { id: 'testing', label: 'Testing' }, { id: 'pinned', label: 'Pinned' }
|
||||
];
|
||||
|
||||
$effect(() => { if (canOperate && $page.url.searchParams.get('action') === 'create') deployOpen = true; });
|
||||
|
||||
function readViewUrl() {
|
||||
const params = new URL(window.location.href).searchParams;
|
||||
query = params.get('q') ?? '';
|
||||
@@ -160,11 +162,11 @@
|
||||
function resetFilters() { query = ''; filter = 'all'; game = ''; }
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Fleet · Electric Cherry</title></svelte:head>
|
||||
<svelte:head><title>Servers · Electric Cherry</title></svelte:head>
|
||||
|
||||
<section class="page">
|
||||
<div class="page-heading">
|
||||
<SectionHeader title="Fleet" />
|
||||
<SectionHeader title="Servers" />
|
||||
{#if canOperate}<Button variant="primary" onclick={() => launch()}>Create server</Button>{/if}
|
||||
</div>
|
||||
<div class="sr-only" role="status" aria-atomic="true">{announcement}</div>
|
||||
@@ -196,11 +198,16 @@
|
||||
{#each problems as server (server.name)}
|
||||
{@const status = serverHealth(server, observationNow())}
|
||||
{@const operation = attentionOperations.find(item => item.server === server.name)}
|
||||
{@const operationIssue = operation && status.state === 'online'}
|
||||
{@const actionLabel = operationIssue ? 'Review operation' : status.actionLabel}
|
||||
<div class="attention-row">
|
||||
<div class="attention-identity"><a class="server-link" href={contextHref(`/servers/${encodeURIComponent(server.name)}`, $page.url)}><ServerIdentity name={server.name} mapLabel={fleetIdentity(server).map} /></a><button class="attention-pin" aria-pressed={pinned.includes(server.name)} aria-label={`${pinned.includes(server.name) ? 'Unpin' : 'Pin'} ${serverTitle(server.name)}`} onclick={() => togglePin(server.name)}>{pinned.includes(server.name) ? '★' : '☆'}</button></div>
|
||||
<StatusBadge state={operation && status.state === 'online' ? 'attention' : status.state} />
|
||||
<p>{operation && status.state === 'online' ? operation.label : status.reason}{#if status.since}<span title={status.since}> · Evidence {elapsedSince(status.since, $uiNow)} ago</span>{/if}</p>
|
||||
<Button size="sm" href={contextHref(operation && status.state === 'online' ? operation.href : status.actionHref, $page.url)}>{operation && status.state === 'online' ? 'Review operation' : status.actionLabel}</Button>
|
||||
<div class="attention-identity"><a class="server-link" href={contextHref(`/servers/${encodeURIComponent(server.name)}`, $page.url)}><ServerIdentity name={server.name} mapLabel={fleetIdentity(server).map} /></a></div>
|
||||
<StatusBadge state={operationIssue ? 'attention' : status.state} />
|
||||
<p class="attention-evidence"><span class="detailed-reason">{operationIssue ? operation.label : status.reason}</span><span class="concise-reason">{operationIssue ? operation.label : status.shortReason}</span>{#if status.since}<span class="evidence-time" title={status.since}><span class="evidence-separator"> · </span>Evidence {elapsedSince(status.since, $uiNow)} ago</span>{/if}</p>
|
||||
<div class="attention-actions">
|
||||
<button class="attention-pin" aria-pressed={pinned.includes(server.name)} aria-label={`${pinned.includes(server.name) ? 'Unpin' : 'Pin'} ${serverTitle(server.name)}`} onclick={() => togglePin(server.name)}>{pinned.includes(server.name) ? '★' : '☆'}</button>
|
||||
<a class="attention-action" href={contextHref(operationIssue ? operation.href : status.actionHref, $page.url)} aria-label={`${actionLabel}: ${serverTitle(server.name)}`}><span class="action-label">{actionLabel}</span><span class="action-arrow" aria-hidden="true">→</span></a>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</section>
|
||||
@@ -316,9 +323,15 @@
|
||||
.attention h2 { padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--state-warning); }
|
||||
.attention-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(180px, 1.5fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-subtle); }
|
||||
.attention-identity { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
|
||||
.attention-pin { color: var(--text-secondary); background: none; border: 0; padding: var(--space-2); font-size: var(--text-md); }
|
||||
.attention-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-1); }
|
||||
.attention-pin { color: var(--text-secondary); background: none; border: 0; padding: var(--space-2); font-size: var(--text-md); width: 44px; min-height: 44px; flex-shrink: 0; border-radius: var(--radius-sm); }
|
||||
.attention-pin:hover, .attention-pin[aria-pressed='true'] { color: var(--accent-primary-hover); background: var(--surface-raised); }
|
||||
.attention-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text-primary); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-decoration: none; }
|
||||
.attention-action:hover { background: var(--surface-overlay); border-color: var(--border-strong); }
|
||||
.attention-pin:focus-visible, .attention-action:focus-visible { outline: 2px solid var(--accent-primary-hover); outline-offset: 2px; }
|
||||
.concise-reason, .action-arrow { display: none; }
|
||||
.attention-row p { margin: 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); }
|
||||
.attention-row p span { white-space: nowrap; }
|
||||
.attention-row .evidence-time { white-space: nowrap; }
|
||||
.server-link { color: var(--text-primary); text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
|
||||
.server-link:hover { text-decoration: underline; }
|
||||
.fleet-section { display: grid; gap: var(--space-3); min-width: 0; }
|
||||
@@ -339,7 +352,7 @@
|
||||
.pin { font-size: var(--text-md); }
|
||||
.fleet-footer { color: var(--text-tertiary); font-size: var(--text-xs); }
|
||||
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
||||
@media (max-width: 1000px) { .attention-row { grid-template-columns: 1fr auto; } .attention-row p { grid-column: 1; } }
|
||||
@media (max-width: 1000px) { .attention-row { grid-template-columns: minmax(0, 1fr) auto; } .attention-row p { grid-column: 1; } }
|
||||
@media (max-width: 600px) {
|
||||
.page { gap: var(--space-3); }
|
||||
.overview { gap: var(--space-1) var(--space-3); font-size: var(--text-xs); }
|
||||
@@ -348,9 +361,15 @@
|
||||
.filter-row { flex-wrap: wrap; }
|
||||
.chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding: 3px; }
|
||||
.filter-chip { flex-shrink: 0; min-height: 44px; }
|
||||
.attention-row { gap: var(--space-2); padding: var(--space-3); }
|
||||
.attention-row p { grid-column: 1; }
|
||||
.attention-row :global(.btn) { grid-column: 2; grid-row: 2; justify-self: end; padding-inline: var(--space-2); font-size: var(--text-xs); }
|
||||
.attention-row { gap: var(--space-1) var(--space-2); padding: var(--space-2) var(--space-3); }
|
||||
.attention-identity .server-link { display: flex; align-items: center; min-height: 44px; }
|
||||
.attention-identity :global(small), .detailed-reason, .action-label, .evidence-separator { display: none; }
|
||||
.concise-reason { display: inline; }
|
||||
.attention-row .attention-evidence { grid-column: 1; overflow-wrap: anywhere; }
|
||||
.attention-row .evidence-time { display: block; white-space: normal; }
|
||||
.attention-actions { grid-column: 2; grid-row: 2; align-self: center; }
|
||||
.attention-action { width: 44px; padding: 0; flex-shrink: 0; }
|
||||
.action-arrow { display: inline; font-size: var(--text-lg); }
|
||||
.attention h2 { padding: var(--space-3); }
|
||||
.cards { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user