Preserve originating views through detail navigation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { contextHref } from '$lib/navigation-context.js';
|
||||
let { data }: { data: import('./$types').PageData } = $props();
|
||||
const snapshot = $derived($fleet.receivedAt ? $fleet : data.fleetSnapshot);
|
||||
const visibleFleet = $derived($fleet.receivedAt ? $fleetServers : data.fleetSnapshot.servers);
|
||||
@@ -181,7 +182,7 @@
|
||||
{/if}
|
||||
|
||||
{#if spotlight}
|
||||
<a class="spotlight" href="/servers/{encodeURIComponent(spotlight.name)}">
|
||||
<a class="spotlight" href={contextHref(`/servers/${encodeURIComponent(spotlight.name)}`, $page.url)}>
|
||||
<div><span class="eyebrow">Longest running match</span><strong>{serverTitle(spotlight.name)}</strong></div>
|
||||
<span class="round">Round {currentRound(spotlight, $telemetryByServer.get(spotlight.name), $uiNow)}</span>
|
||||
<span>{spotlight.last_players} {spotlight.last_players === 1 ? 'survivor' : 'survivors'} · {elapsedSince(spotlight.game_started_at, $uiNow)} <span aria-hidden="true">→</span></span>
|
||||
@@ -239,7 +240,7 @@
|
||||
<div class="table-scroll"><table><caption class="sr-only">{group.title} servers</caption><thead><tr><th>Lobby</th><th>Status</th><th>Players</th><th>Round / match</th><th>Operation</th><th>Follow</th></tr></thead><tbody>
|
||||
{#each group.servers as server (server.name)}
|
||||
{@const round = currentRound(server, $telemetryByServer.get(server.name), $uiNow)}
|
||||
<tr><td><a class="lobby-link" href="/servers/{encodeURIComponent(server.name)}"><ServerIdentity name={server.name} mapLabel={fleetIdentity(server).map} /></a></td>
|
||||
<tr><td><a class="lobby-link" href={contextHref(`/servers/${encodeURIComponent(server.name)}`, $page.url)}><ServerIdentity name={server.name} mapLabel={fleetIdentity(server).map} /></a></td>
|
||||
<td><span class="health"><StatusPip health={server.health} />{server.health}</span></td><td>{freshServer(server, $uiNow) ? server.last_players ?? '—' : '—'}</td>
|
||||
<td>{round !== null ? `Round ${round}` : '—'}{#if matchDuration(server) >= 0}<small>{elapsedSince(server.game_started_at, $uiNow)}</small>{/if}</td>
|
||||
<td>{@render serverOperations(server, true)}</td><td><div class="table-actions">{@render serverActions(server)}</div></td></tr>
|
||||
@@ -255,7 +256,7 @@
|
||||
{#snippet serverOperations(server: FleetServer, showEmpty = false)}
|
||||
{@const operations = activeOperations.filter(op => op.server === server.name)}
|
||||
{#if operations.length}<div class="server-operations">{#each operations as operation (operation.key)}
|
||||
<a href={operation.href} class:issue={operation.state === 'attention'} title={operation.detail}><span>{operation.label} →</span><small>{operation.detail}</small></a>
|
||||
<a href={contextHref(operation.href, $page.url)} class:issue={operation.state === 'attention'} title={operation.detail}><span>{operation.label} →</span><small>{operation.detail}</small></a>
|
||||
{/each}</div>{:else if showEmpty}<span class="hint">No pending work</span>{/if}
|
||||
{/snippet}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user