Redesign UI with new token system, primitives, and motion
Restraint-first design language: neutral gray surfaces + one blue accent (cyan/amber/red reserved for state), 8pt spacing, softer radii, one ambient + one raised shadow, standardized motion tokens. Alfa Slab One demoted to BrandMark only; Inter carries all page copy. New primitives (Button, Card, Badge, Stat, SectionHeader, Skeleton, EmptyState, Tabs, Breadcrumbs, StatusPip, Field, Input, Select, Textarea) plus motion utilities (tweenNumber, viewTransition) and a global toast system. All eight route surfaces rewritten on top: Fleet gains an overview hero, Server detail restructures into tabs, Deployments gets a collapsible drift summary + per-server pipeline visual, and the scripts/configs/plugins/betas flows adopt the new form primitives. Sticky translucent nav with backdrop blur, view-transition cross-fades between routes, staggered card entrance on Fleet, breathing status pip halo, tabular-numeric player counts. Gmail-style g-key nav shortcuts. Mobile stacks below 720px; prefers-reduced-motion neutralizes durations. Legacy tokens preserved as aliases so any un-migrated code still renders.
This commit is contained in:
@@ -1,39 +1,38 @@
|
||||
<script lang="ts">
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import Card from './primitives/Card.svelte';
|
||||
import Badge from './primitives/Badge.svelte';
|
||||
import Button from './primitives/Button.svelte';
|
||||
import SectionHeader from './primitives/SectionHeader.svelte';
|
||||
import Breadcrumbs from './primitives/Breadcrumbs.svelte';
|
||||
import EmptyState from './primitives/EmptyState.svelte';
|
||||
import Field from './primitives/Field.svelte';
|
||||
import Input from './primitives/Input.svelte';
|
||||
import Select from './primitives/Select.svelte';
|
||||
|
||||
type Family = 'script' | 'config' | 'plugin';
|
||||
|
||||
interface Props {
|
||||
id: number;
|
||||
family: Family;
|
||||
}
|
||||
interface Props { id: number; family: Family; }
|
||||
let { id, family }: Props = $props();
|
||||
|
||||
const basePath = $derived(`/${family}s`);
|
||||
const backLabel = $derived(`← all ${family}s`);
|
||||
const crumbLabel = $derived(family.charAt(0).toUpperCase() + family.slice(1) + 's');
|
||||
|
||||
interface Artifact {
|
||||
id: number;
|
||||
name: string;
|
||||
target_rel_path: string;
|
||||
scope_type: 'game' | 'map' | null;
|
||||
scope_value: string | null;
|
||||
id: number; name: string; target_rel_path: string;
|
||||
scope_type: 'game' | 'map' | null; scope_value: string | null;
|
||||
current_version_id: number | null;
|
||||
kind: 'script' | 'config' | 'plugin' | 'baseline';
|
||||
created_at: string;
|
||||
}
|
||||
interface Version {
|
||||
id: number;
|
||||
version: number;
|
||||
sha256: string;
|
||||
size: number;
|
||||
notes: string | null;
|
||||
state: 'untested' | 'tested' | 'test-failed';
|
||||
id: number; version: number; sha256: string; size: number;
|
||||
notes: string | null; state: 'untested' | 'tested' | 'test-failed';
|
||||
uploaded_at: string;
|
||||
}
|
||||
interface ServerRow { name: string; game: string | null; map: string | null }
|
||||
interface ScopeOptions { games: string[]; mapsByGame: Record<string, string[]> }
|
||||
interface ServerRow { name: string; game: string | null; map: string | null; }
|
||||
interface ScopeOptions { games: string[]; mapsByGame: Record<string, string[]>; }
|
||||
|
||||
let artifact = $state<Artifact | null>(null);
|
||||
let versions = $state<Version[]>([]);
|
||||
@@ -42,7 +41,6 @@
|
||||
let loading = $state(true);
|
||||
let flash = $state<string | null>(null);
|
||||
|
||||
// Modal-form state (only used while the corresponding dialog is open).
|
||||
let scopeType = $state<'none' | 'game' | 'map'>('none');
|
||||
let scopeGame = $state('');
|
||||
let scopeMap = $state('');
|
||||
@@ -55,11 +53,8 @@
|
||||
|
||||
let scopeDialog = $state<HTMLDialogElement | null>(null);
|
||||
let uploadDialog = $state<HTMLDialogElement | null>(null);
|
||||
// Kept around so we can reseed scopeGame after servers load (map→game backfill).
|
||||
let fleetServers: ServerRow[] = [];
|
||||
|
||||
// Polling handle for auto-refresh of server-owned state (artifact, versions,
|
||||
// matched servers, runningBetaId). Form state is never reseeded from polling.
|
||||
let poll: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
const editedScopeValue = $derived.by(() => {
|
||||
@@ -80,10 +75,12 @@
|
||||
|
||||
function scopeLabel(s: Artifact): string {
|
||||
if (!s.scope_type) return 'unscoped';
|
||||
return `${s.scope_type}=${s.scope_value ?? '?'}`;
|
||||
return `${s.scope_type} · ${s.scope_value ?? '?'}`;
|
||||
}
|
||||
function stateClass(state: Version['state']): string {
|
||||
return `tag state-${state}`;
|
||||
function stateVariant(s: Version['state']): 'online' | 'danger' | 'neutral' {
|
||||
return s === 'tested' ? 'online' :
|
||||
s === 'test-failed' ? 'danger' :
|
||||
'neutral';
|
||||
}
|
||||
|
||||
async function load({ seedForm = true }: { seedForm?: boolean } = {}): Promise<void> {
|
||||
@@ -94,10 +91,8 @@
|
||||
]);
|
||||
if (!detailRes.ok) { loading = false; return; }
|
||||
const body = (await detailRes.json()) as {
|
||||
script: Artifact;
|
||||
versions: Version[];
|
||||
matchedServers: string[];
|
||||
runningBetaId: number | null;
|
||||
script: Artifact; versions: Version[];
|
||||
matchedServers: string[]; runningBetaId: number | null;
|
||||
};
|
||||
artifact = body.script;
|
||||
versions = body.versions;
|
||||
@@ -126,8 +121,7 @@
|
||||
const owner = fleetServers.find((sv) => sv.map === scopeMap);
|
||||
scopeGame = owner?.game ?? '';
|
||||
} else {
|
||||
scopeGame = '';
|
||||
scopeMap = '';
|
||||
scopeGame = ''; scopeMap = '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,9 +129,7 @@
|
||||
load();
|
||||
poll = setInterval(() => load({ seedForm: false }), 5000);
|
||||
});
|
||||
onDestroy(() => {
|
||||
if (poll) clearInterval(poll);
|
||||
});
|
||||
onDestroy(() => { if (poll) clearInterval(poll); });
|
||||
|
||||
function openScopeModal(): void {
|
||||
if (runningBetaId !== null) return;
|
||||
@@ -174,8 +166,7 @@
|
||||
async function uploadVersion(e: Event): Promise<void> {
|
||||
e.preventDefault();
|
||||
if (!versionFile || uploadingVersion) return;
|
||||
uploadingVersion = true;
|
||||
flash = null;
|
||||
uploadingVersion = true; flash = null;
|
||||
const form = new FormData();
|
||||
form.append('content', versionFile);
|
||||
if (versionNotes.trim()) form.append('notes', versionNotes.trim());
|
||||
@@ -186,8 +177,7 @@
|
||||
flash = body.error ?? `HTTP ${res.status}`;
|
||||
return;
|
||||
}
|
||||
versionFile = null;
|
||||
versionNotes = '';
|
||||
versionFile = null; versionNotes = '';
|
||||
uploadDialog?.close();
|
||||
await load();
|
||||
} finally {
|
||||
@@ -199,11 +189,10 @@
|
||||
e.preventDefault();
|
||||
if (updatingScope) return;
|
||||
if (scopeType !== 'none' && !editedScopeValue) {
|
||||
flash = `pick a ${scopeType}`;
|
||||
flash = `Pick a ${scopeType}`;
|
||||
return;
|
||||
}
|
||||
updatingScope = true;
|
||||
flash = null;
|
||||
updatingScope = true; flash = null;
|
||||
try {
|
||||
const res = await fetch(`/api/scripts/${id}/scope`, {
|
||||
method: 'POST',
|
||||
@@ -229,322 +218,344 @@
|
||||
if (!confirm(`Delete this ${family}?`)) return;
|
||||
const res = await fetch(`/api/scripts/${id}`, { method: 'DELETE' });
|
||||
const body = (await res.json()) as { ok: boolean; error?: string };
|
||||
if (!body.ok) { flash = body.error ?? 'delete failed'; return; }
|
||||
if (!body.ok) { flash = body.error ?? 'Delete failed'; return; }
|
||||
goto(basePath);
|
||||
}
|
||||
|
||||
let gameOptions = $derived([
|
||||
{ value: '', label: '— Pick a game —', disabled: true },
|
||||
...scopeOptions.games.map((g) => ({ value: g, label: g }))
|
||||
]);
|
||||
let mapOptions = $derived([
|
||||
{ value: '', label: '— Pick a map —', disabled: true },
|
||||
...(scopeOptions.mapsByGame[scopeGame] ?? []).map((m) => ({ value: m, label: m }))
|
||||
]);
|
||||
let scopeTypeOptions = [
|
||||
{ value: 'none', label: 'Unscoped' },
|
||||
{ value: 'game', label: 'Game' },
|
||||
{ value: 'map', label: 'Map' }
|
||||
];
|
||||
</script>
|
||||
|
||||
{#if loading}
|
||||
<p class="empty">loading…</p>
|
||||
<div class="loading">Loading…</div>
|
||||
{:else if !artifact}
|
||||
<p class="empty">{family} not found</p>
|
||||
<EmptyState title="Not found" description="This {family} may have been deleted." />
|
||||
{:else}
|
||||
<a class="back" href={basePath}>{backLabel}</a>
|
||||
<h1>{artifact.name}</h1>
|
||||
<div class="sub mono">{artifact.target_rel_path}</div>
|
||||
{@const a = artifact}
|
||||
<div class="page">
|
||||
<SectionHeader title={a.name} subtitle={a.target_rel_path}>
|
||||
{#snippet crumbs()}
|
||||
<Breadcrumbs items={[{ label: crumbLabel, href: basePath }, { label: a.name }]} />
|
||||
{/snippet}
|
||||
</SectionHeader>
|
||||
|
||||
{#if runningBetaId}
|
||||
<section class="panel banner">
|
||||
<p>
|
||||
Beta <a href="/betas/{runningBetaId}"><strong>#{runningBetaId}</strong></a> is currently running for this {family}.
|
||||
{#if runningBetaId}
|
||||
<div class="warn-banner">
|
||||
Beta <a href="/betas/{runningBetaId}"><strong>#{runningBetaId}</strong></a> is running for this {family}.
|
||||
Rollback or promote it before making changes.
|
||||
</p>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<section class="panel">
|
||||
<h2>Details</h2>
|
||||
<div class="stats">
|
||||
<div class="stat">
|
||||
<div class="k">target file</div>
|
||||
<div class="v mono">{artifact.target_rel_path}</div>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<div class="k">scope</div>
|
||||
<div class="v mono">{scopeLabel(artifact)}</div>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<div class="k">applies to</div>
|
||||
<div class="v mono">
|
||||
{#if !artifact.scope_type}
|
||||
<span class="dim">unscoped — deploy from a beta</span>
|
||||
{:else if matchedServers.length === 0}
|
||||
<span class="warn">no matching servers</span>
|
||||
{:else}
|
||||
{matchedServers.join(', ')}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<div class="k">current version</div>
|
||||
<div class="v mono">
|
||||
{#if currentVersion}
|
||||
v{currentVersion.version} · {currentVersion.sha256.slice(0, 8)} <span class="tag cur">promoted</span>
|
||||
{:else}
|
||||
<span class="dim">— never promoted (open a beta from <a href="/betas">/betas</a>)</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{#if showLatestSeparately && latestVersion}
|
||||
<div class="stat">
|
||||
<div class="k">latest version</div>
|
||||
<div class="v mono">
|
||||
v{latestVersion.version} · {latestVersion.sha256.slice(0, 8)}
|
||||
<span class={stateClass(latestVersion.state)}>{latestVersion.state}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button
|
||||
class="secondary"
|
||||
onclick={openScopeModal}
|
||||
disabled={runningBetaId !== null}
|
||||
title={runningBetaId !== null ? 'a beta is currently running' : ''}
|
||||
>
|
||||
edit scope
|
||||
</button>
|
||||
<button
|
||||
class="secondary"
|
||||
onclick={openUploadModal}
|
||||
disabled={runningBetaId !== null}
|
||||
title={runningBetaId !== null ? 'a beta is currently running' : ''}
|
||||
>
|
||||
upload new version
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Version history</h2>
|
||||
{#if versions.length === 0}
|
||||
<p class="empty">none</p>
|
||||
{:else}
|
||||
<div class="versions">
|
||||
{#each versions as v (v.id)}
|
||||
<div class="version {artifact.current_version_id === v.id ? 'current' : ''}">
|
||||
<span class="v-num mono">v{v.version}</span>
|
||||
<span class="v-sha mono">{v.sha256.slice(0, 12)}</span>
|
||||
<span class="v-size mono">{v.size}B</span>
|
||||
<span class="v-notes">{v.notes ?? ''}</span>
|
||||
<span class="v-when mono">{v.uploaded_at}</span>
|
||||
{#if artifact.current_version_id === v.id}
|
||||
<span class="tag cur">promoted</span>
|
||||
{:else if v.state === 'tested'}
|
||||
<span class="tag state-tested">tested</span>
|
||||
{:else if v.state === 'test-failed'}
|
||||
<span class="tag state-test-failed">test-failed</span>
|
||||
{:else}
|
||||
<span class="tag state-untested">untested</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Danger</h2>
|
||||
<button class="danger" onclick={deleteArtifact}>delete {family}</button>
|
||||
</section>
|
||||
<Card padding="lg">
|
||||
<div class="panel-head">
|
||||
<h2>Details</h2>
|
||||
<div class="head-actions">
|
||||
<Button variant="secondary" size="sm" onclick={openScopeModal} disabled={runningBetaId !== null}>
|
||||
Edit scope
|
||||
</Button>
|
||||
<Button variant="secondary" size="sm" onclick={openUploadModal} disabled={runningBetaId !== null}>
|
||||
Upload new version
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if flash}<p class="flash">{flash}</p>{/if}
|
||||
|
||||
<dialog bind:this={scopeDialog} onclick={(e) => onDialogClick(scopeDialog, e)}>
|
||||
<form class="dlg" onsubmit={saveScope}>
|
||||
<h3>Edit scope</h3>
|
||||
<div class="scope-form">
|
||||
<select bind:value={scopeType} disabled={updatingScope}>
|
||||
<option value="none">unscoped</option>
|
||||
<option value="game">game</option>
|
||||
<option value="map">map</option>
|
||||
</select>
|
||||
{#if scopeType === 'game'}
|
||||
<select bind:value={scopeGame} disabled={updatingScope}>
|
||||
<option value="">— pick a game —</option>
|
||||
{#each scopeOptions.games as g (g)}
|
||||
<option value={g}>{g}</option>
|
||||
{/each}
|
||||
</select>
|
||||
{:else if scopeType === 'map'}
|
||||
<select bind:value={scopeGame} disabled={updatingScope}>
|
||||
<option value="">— pick a game —</option>
|
||||
{#each scopeOptions.games as g (g)}
|
||||
<option value={g}>{g}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<select bind:value={scopeMap} disabled={updatingScope || !scopeGame}>
|
||||
<option value="">— pick a map —</option>
|
||||
{#each (scopeOptions.mapsByGame[scopeGame] ?? []) as m (m)}
|
||||
<option value={m}>{m}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<div class="kv-grid">
|
||||
<div class="kv">
|
||||
<span class="k">Target file</span>
|
||||
<span class="v mono">{a.target_rel_path}</span>
|
||||
</div>
|
||||
<div class="kv">
|
||||
<span class="k">Scope</span>
|
||||
<span class="v">
|
||||
<Badge
|
||||
variant={a.scope_type === 'game' ? 'info' : a.scope_type === 'map' ? 'warning' : 'neutral'}
|
||||
size="sm"
|
||||
>
|
||||
{scopeLabel(a)}
|
||||
</Badge>
|
||||
</span>
|
||||
</div>
|
||||
<div class="kv">
|
||||
<span class="k">Applies to</span>
|
||||
<span class="v mono">
|
||||
{#if !a.scope_type}
|
||||
<span class="dim">Unscoped — deploy from a beta</span>
|
||||
{:else if matchedServers.length === 0}
|
||||
<span class="warn">No matching servers</span>
|
||||
{:else}
|
||||
{matchedServers.join(', ')}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<div class="kv">
|
||||
<span class="k">Current version</span>
|
||||
<span class="v mono">
|
||||
{#if currentVersion}
|
||||
v{currentVersion.version} · {currentVersion.sha256.slice(0, 8)}
|
||||
<Badge variant="online" size="sm">Promoted</Badge>
|
||||
{:else}
|
||||
<span class="dim">Never promoted — open a <a href="/betas">beta</a></span>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{#if showLatestSeparately && latestVersion}
|
||||
<div class="kv">
|
||||
<span class="k">Latest version</span>
|
||||
<span class="v mono">
|
||||
v{latestVersion.version} · {latestVersion.sha256.slice(0, 8)}
|
||||
<Badge variant={stateVariant(latestVersion.state)} size="sm">{latestVersion.state}</Badge>
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="dlg-actions">
|
||||
<button type="button" class="secondary" onclick={cancelScopeModal} disabled={updatingScope}>cancel</button>
|
||||
<button type="submit" class="primary" disabled={updatingScope}>
|
||||
{updatingScope ? 'saving…' : 'save scope'}
|
||||
</button>
|
||||
</div>
|
||||
{#if flash}<p class="flash">{flash}</p>{/if}
|
||||
</form>
|
||||
</dialog>
|
||||
</Card>
|
||||
|
||||
<dialog bind:this={uploadDialog} onclick={(e) => onDialogClick(uploadDialog, e)}>
|
||||
<form class="dlg" onsubmit={uploadVersion}>
|
||||
<h3>Upload new version</h3>
|
||||
<div class="version-form">
|
||||
<input type="file" onchange={pickVersionFile} disabled={uploadingVersion} />
|
||||
<input type="text" bind:value={versionNotes} placeholder="notes (optional)" disabled={uploadingVersion} />
|
||||
<Card padding="lg">
|
||||
<div class="panel-head">
|
||||
<h2>Version history</h2>
|
||||
<Badge variant="neutral" size="sm">{versions.length}</Badge>
|
||||
</div>
|
||||
<div class="dlg-actions">
|
||||
<button type="button" class="secondary" onclick={cancelUploadModal} disabled={uploadingVersion}>cancel</button>
|
||||
<button type="submit" class="primary" disabled={uploadingVersion || !versionFile}>
|
||||
{uploadingVersion ? 'uploading…' : 'upload version'}
|
||||
</button>
|
||||
</div>
|
||||
{#if flash}<p class="flash">{flash}</p>{/if}
|
||||
</form>
|
||||
</dialog>
|
||||
{#if versions.length === 0}
|
||||
<EmptyState title="No versions yet" description="Upload a first version to get started." />
|
||||
{:else}
|
||||
<div class="version-list">
|
||||
{#each versions as v (v.id)}
|
||||
<div class="version-row" class:current={a.current_version_id === v.id}>
|
||||
<span class="v-num">v{v.version}</span>
|
||||
<span class="v-sha">{v.sha256.slice(0, 12)}</span>
|
||||
<span class="v-size">{v.size} B</span>
|
||||
<span class="v-notes">{v.notes ?? ''}</span>
|
||||
<span class="v-when">{v.uploaded_at}</span>
|
||||
{#if a.current_version_id === v.id}
|
||||
<Badge variant="online" size="sm">Promoted</Badge>
|
||||
{:else}
|
||||
<Badge variant={stateVariant(v.state)} size="sm">{v.state.replace('-', ' ')}</Badge>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</Card>
|
||||
|
||||
<Card padding="lg">
|
||||
<div class="panel-head"><h2>Danger zone</h2></div>
|
||||
<Button variant="danger" onclick={deleteArtifact}>Delete {family}</Button>
|
||||
</Card>
|
||||
|
||||
{#if flash}<div class="alert">{flash}</div>{/if}
|
||||
|
||||
<!-- Scope dialog -->
|
||||
<dialog bind:this={scopeDialog} onclick={(e) => onDialogClick(scopeDialog, e)}>
|
||||
<form class="dlg" onsubmit={saveScope}>
|
||||
<header class="dlg-head">
|
||||
<h3>Edit scope</h3>
|
||||
<button type="button" class="close" onclick={cancelScopeModal} aria-label="Close">×</button>
|
||||
</header>
|
||||
<Field label="Scope">
|
||||
<div class="scope-row">
|
||||
<Select bind:value={scopeType} options={scopeTypeOptions} disabled={updatingScope} />
|
||||
{#if scopeType === 'game' || scopeType === 'map'}
|
||||
<Select bind:value={scopeGame} options={gameOptions} disabled={updatingScope} />
|
||||
{/if}
|
||||
{#if scopeType === 'map'}
|
||||
<Select bind:value={scopeMap} options={mapOptions} disabled={updatingScope || !scopeGame} />
|
||||
{/if}
|
||||
</div>
|
||||
</Field>
|
||||
<div class="dlg-actions">
|
||||
<Button variant="ghost" onclick={cancelScopeModal} disabled={updatingScope}>Cancel</Button>
|
||||
<Button type="submit" variant="primary" disabled={updatingScope} loading={updatingScope}>
|
||||
Save scope
|
||||
</Button>
|
||||
</div>
|
||||
{#if flash}<div class="alert alert-danger">{flash}</div>{/if}
|
||||
</form>
|
||||
</dialog>
|
||||
|
||||
<!-- Upload dialog -->
|
||||
<dialog bind:this={uploadDialog} onclick={(e) => onDialogClick(uploadDialog, e)}>
|
||||
<form class="dlg" onsubmit={uploadVersion}>
|
||||
<header class="dlg-head">
|
||||
<h3>Upload new version</h3>
|
||||
<button type="button" class="close" onclick={cancelUploadModal} aria-label="Close">×</button>
|
||||
</header>
|
||||
<Field label="File">
|
||||
<Input type="file" onchange={pickVersionFile} disabled={uploadingVersion} />
|
||||
</Field>
|
||||
<Field label="Notes" hint="Optional. What changed since the previous version.">
|
||||
<Input bind:value={versionNotes} placeholder="what changed" disabled={uploadingVersion} />
|
||||
</Field>
|
||||
<div class="dlg-actions">
|
||||
<Button variant="ghost" onclick={cancelUploadModal} disabled={uploadingVersion}>Cancel</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
disabled={uploadingVersion || !versionFile}
|
||||
loading={uploadingVersion}
|
||||
>
|
||||
Upload version
|
||||
</Button>
|
||||
</div>
|
||||
{#if flash}<div class="alert alert-danger">{flash}</div>{/if}
|
||||
</form>
|
||||
</dialog>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.back { color: var(--ink-500); font-family: var(--font-mono); font-size: var(--text-mono-sm); text-decoration: none; }
|
||||
.back:hover { color: var(--ink-100); }
|
||||
h1 { color: var(--cream); font-family: var(--font-display); font-size: var(--text-2xl); letter-spacing: 1.5px; margin: 12px 0 4px; }
|
||||
.sub { color: var(--ink-500); font-size: var(--text-mono); margin-bottom: 24px; }
|
||||
.empty { color: var(--ink-500); font-family: var(--font-mono); font-size: var(--text-mono); margin: 0; }
|
||||
.page { display: flex; flex-direction: column; gap: var(--space-6); }
|
||||
.loading { text-align: center; padding: var(--space-16); color: var(--text-tertiary); }
|
||||
|
||||
.panel { background: var(--bg-nav); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--pad-panel); margin-bottom: 20px; }
|
||||
.banner { background: rgba(255, 176, 32, 0.08); border-color: rgba(255, 176, 32, 0.3); }
|
||||
.banner p { margin: 0; color: var(--cream-dim); font-family: var(--font-body); font-size: var(--text-sm); }
|
||||
.banner a { color: var(--amber-500); }
|
||||
h2 { margin: 0 0 14px; font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--ink-300); }
|
||||
.warn-banner {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
background: rgba(255, 176, 32, 0.06);
|
||||
border: 1px solid rgba(255, 176, 32, 0.28);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--text-primary);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
.warn-banner a { color: var(--state-warning); text-decoration: underline; }
|
||||
|
||||
.stats {
|
||||
.panel-head {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: var(--space-3); margin-bottom: var(--space-4);
|
||||
}
|
||||
.panel-head h2 {
|
||||
margin: 0;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-md);
|
||||
font-weight: var(--weight-semibold);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.head-actions { display: flex; gap: var(--space-2); }
|
||||
|
||||
.kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 12px;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: var(--space-3);
|
||||
}
|
||||
.stat {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-sm);
|
||||
padding: 12px 14px;
|
||||
.kv {
|
||||
display: flex; flex-direction: column; gap: 4px;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
background: var(--surface-sunken);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
.stat .k {
|
||||
color: var(--ink-500);
|
||||
.k {
|
||||
font-size: var(--text-xs);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
letter-spacing: var(--tracking-label);
|
||||
color: var(--text-tertiary);
|
||||
font-weight: var(--weight-semibold);
|
||||
}
|
||||
.stat .v {
|
||||
color: var(--ink-100);
|
||||
margin-top: 6px;
|
||||
font-size: var(--text-base);
|
||||
word-break: break-word;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.dim { color: var(--ink-500); }
|
||||
.warn { color: var(--amber-500); }
|
||||
|
||||
.actions { display: flex; gap: 10px; margin-top: 18px; }
|
||||
button.secondary {
|
||||
background: var(--bg-card);
|
||||
color: var(--ink-100);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-sm);
|
||||
padding: 10px 16px;
|
||||
font-family: var(--font-body);
|
||||
.v {
|
||||
font-size: var(--text-sm);
|
||||
cursor: pointer;
|
||||
color: var(--text-primary);
|
||||
display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
|
||||
word-break: break-word;
|
||||
}
|
||||
button.secondary:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--accent-glow); }
|
||||
button.secondary:disabled { opacity: 0.4; cursor: default; }
|
||||
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
|
||||
.dim { color: var(--text-tertiary); }
|
||||
.warn { color: var(--state-warning); }
|
||||
.v a { color: var(--accent-primary-hover); }
|
||||
|
||||
.scope-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
||||
.scope-form select, .version-form input {
|
||||
background: var(--bg-page);
|
||||
color: var(--ink-100);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-sm);
|
||||
padding: 10px 12px;
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--text-mono);
|
||||
}
|
||||
|
||||
.version-form { display: flex; gap: 10px; align-items: center; }
|
||||
.version-form input[type=text] { flex: 1; }
|
||||
|
||||
.versions { display: flex; flex-direction: column; gap: 6px; }
|
||||
.version {
|
||||
.version-list { display: flex; flex-direction: column; gap: var(--space-1); }
|
||||
.version-row {
|
||||
display: grid;
|
||||
grid-template-columns: 80px 130px 90px 1fr 200px auto;
|
||||
gap: 14px;
|
||||
padding: 10px 14px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-sm);
|
||||
grid-template-columns: 60px 130px 80px 1fr 220px auto;
|
||||
gap: var(--space-3);
|
||||
align-items: center;
|
||||
font-size: var(--text-mono);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
background: color-mix(in oklab, var(--surface) 88%, transparent);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: var(--radius-md);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
.version.current { border-color: var(--spark-500); box-shadow: 0 0 0 1px var(--spark-500); }
|
||||
.v-num { color: var(--cream); font-weight: 600; }
|
||||
.v-sha, .v-size, .v-when { color: var(--ink-500); }
|
||||
.v-notes { color: var(--ink-300); font-family: var(--font-body); font-size: var(--text-sm); }
|
||||
.tag { padding: 2px 8px; border-radius: var(--r-sm); font-family: var(--font-mono); font-size: var(--text-xs); border: 1px solid transparent; }
|
||||
.tag.cur { background: rgba(124, 212, 255, 0.15); border-color: rgba(124, 212, 255, 0.4); color: var(--spark-500); }
|
||||
.tag.state-untested { background: var(--bg-nav); border-color: var(--border); color: var(--ink-300); }
|
||||
.tag.state-tested { background: rgba(124, 212, 255, 0.10); border-color: rgba(124, 212, 255, 0.3); color: var(--spark-500); }
|
||||
.tag.state-test-failed { background: rgba(255, 92, 92, 0.10); border-color: rgba(255, 92, 92, 0.4); color: var(--danger-500); }
|
||||
|
||||
.danger {
|
||||
background: var(--bg-nav);
|
||||
border: 1px solid rgba(255, 48, 80, 0.4);
|
||||
color: var(--danger-500);
|
||||
border-radius: var(--r-sm);
|
||||
padding: 10px 16px;
|
||||
font-family: var(--font-body);
|
||||
cursor: pointer;
|
||||
.version-row.current {
|
||||
border-color: rgba(124, 212, 255, 0.35);
|
||||
background: rgba(124, 212, 255, 0.04);
|
||||
}
|
||||
.v-num { color: var(--text-primary); font-weight: var(--weight-semibold); }
|
||||
.v-sha, .v-size, .v-when { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
|
||||
.v-notes { color: var(--text-secondary); font-family: var(--font-body); font-size: var(--text-sm); }
|
||||
|
||||
.flash { color: var(--danger-500); font-family: var(--font-mono); font-size: var(--text-mono); margin-top: 12px; }
|
||||
.mono { font-family: var(--font-mono); }
|
||||
.alert {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--state-danger);
|
||||
background: rgba(255, 86, 112, 0.06);
|
||||
border: 1px solid rgba(255, 86, 112, 0.28);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
.alert-danger { background: rgba(255, 86, 112, 0.08); }
|
||||
|
||||
/* Dialogs */
|
||||
dialog {
|
||||
background: var(--bg-nav);
|
||||
color: var(--ink-100);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-md);
|
||||
background: var(--surface);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 0;
|
||||
max-width: 560px;
|
||||
width: calc(100vw - 40px);
|
||||
box-shadow: var(--shadow-raised);
|
||||
}
|
||||
dialog[open] { animation: dlg-in var(--dur-base) var(--ease-standard); }
|
||||
@keyframes dlg-in {
|
||||
from { opacity: 0; transform: translateY(6px) scale(0.98); }
|
||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||
}
|
||||
dialog::backdrop {
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
backdrop-filter: blur(6px);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
}
|
||||
.dlg {
|
||||
display: flex; flex-direction: column; gap: var(--space-4);
|
||||
padding: var(--space-6);
|
||||
}
|
||||
.dlg-head {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
}
|
||||
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
|
||||
.dlg { display: flex; flex-direction: column; gap: 14px; padding: var(--pad-panel); }
|
||||
.dlg h3 {
|
||||
margin: 0;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-xs);
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1.5px;
|
||||
color: var(--ink-300);
|
||||
font-size: var(--text-md);
|
||||
font-weight: var(--weight-semibold);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
|
||||
button.primary {
|
||||
background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
|
||||
border: 1px solid var(--blue-400);
|
||||
color: var(--cream);
|
||||
border-radius: var(--r-sm);
|
||||
padding: 10px 16px;
|
||||
font-family: var(--font-body);
|
||||
font-weight: 600;
|
||||
.close {
|
||||
appearance: none;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-tertiary);
|
||||
font-size: var(--text-xl);
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
padding: 4px 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.close:hover { color: var(--text-primary); background: var(--surface-raised); }
|
||||
|
||||
.scope-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
|
||||
.scope-row :global(.wrap) { flex: 1 1 140px; min-width: 140px; }
|
||||
|
||||
.dlg-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.version-row { grid-template-columns: 1fr; }
|
||||
}
|
||||
button.primary:disabled { opacity: 0.4; cursor: default; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user