Fix release version labels across deployment views

This commit is contained in:
2026-10-17 09:45:53 -04:00
parent b5037a70fe
commit ba9bed6a0d
20 changed files with 485 additions and 39 deletions
+23 -6
View File
@@ -1,15 +1,21 @@
import { statusPresentation, type StatusTone } from './status.js';
import { plural } from './plural.js';
import { artifactVersionLabel } from '../artifact-version.js';
export type CampaignServerGroup = 'attention' | 'processing' | 'queued' | 'complete' | 'inactive';
export interface CampaignSummary {
interface CampaignScriptSummary {
script_name: string | null;
script_version: number | null;
script_release_version: string | null;
script_kind: string | null;
}
export interface CampaignSummary extends CampaignScriptSummary {
action: string;
beta_id: number | null;
rolled_back_by: string | null;
script_name: string | null;
script_version: number | null;
scripts: { script_name: string | null; script_version: number | null }[];
scripts: CampaignScriptSummary[];
servers: { restart_state: string; server_deleted_at?: string | null }[];
}
@@ -23,8 +29,19 @@ export function campaignTitle(campaign: CampaignSummary): string {
return `${action} · Beta #${campaign.beta_id}`;
if (campaign.scripts.length > 1) return `${action} · ${campaign.scripts.length} scripts`;
const script = campaign.scripts[0] ?? campaign;
if (script.script_name)
return `${action} · ${script.script_name}${script.script_version !== null ? ` v${script.script_version}` : ''}`;
if (script.script_name) {
const version =
script.script_version === null
? ''
: ` ${artifactVersionLabel(
{
version: script.script_version,
release_version: script.script_release_version
},
script.script_kind ?? 'script'
)}`;
return `${action} · ${script.script_name}${version}`;
}
return campaign.beta_id ? `${action} · Beta #${campaign.beta_id}` : action;
}
@@ -15,6 +15,7 @@
} from '$ui/collection-summary.js';
import { serverTitle } from '$ui/server-labels.js';
import { timeFormat } from '$ui/stores/time-zone.js';
import { launchFileVersionLabel } from '$lib/artifact-version.js';
import type { NativeHostSelectionStatus } from '$ui/native-game-files.js';
import type { NativeDeploymentSelection } from '$lib/hosts.js';
import type { ZombieGame } from '$lib/map-aliases.js';
@@ -609,9 +610,7 @@
<ul class="file-list">
{#each entry.recipe.files as file}<li>
<strong>{file.name}</strong><span
>{file.version === null
? 'Generated'
: `v${file.version}`} · {file.kind}</span
>{launchFileVersionLabel(file)} · {file.kind}</span
><code>{file.path}</code>
</li>{/each}
</ul>
@@ -9,6 +9,7 @@
import { createServerLaunchController, type ServerLaunchState } from '$ui/server-launch.js';
import { serverTitle } from '$ui/server-labels.js';
import { timeFormat } from '$ui/stores/time-zone.js';
import { launchFileVersionLabel } from '$lib/artifact-version.js';
import type { NativeHostSelectionStatus } from '$ui/native-game-files.js';
import type { NativeDeploymentSelection } from '$lib/hosts.js';
import type { ZombieMapEntry, ZombieGame } from '$lib/map-aliases.js';
@@ -378,7 +379,7 @@
{#each preview.recipe.files as file}<li>
<div>
<strong>{file.name}</strong><span
>{file.version === null ? 'Generated' : `v${file.version}`} ·
>{launchFileVersionLabel(file)} ·
{file.kind}</span
>
</div>
+2 -1
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import RelativeTime from '$ui/components/RelativeTime.svelte';
import { launchFileVersionLabel } from '$lib/artifact-version.js';
import type { LaunchRecipeSummary } from '$lib/deployment-plan.js';
let { recipe, historical = false }: { recipe: LaunchRecipeSummary; historical?: boolean } =
$props();
@@ -36,7 +37,7 @@
{#each recipe.files as file}<li>
<div>
<strong>{file.name}</strong><span
>{file.version !== null ? `v${file.version}` : 'Generated'} · {file.kind}
>{launchFileVersionLabel(file)} · {file.kind}
· {file.size.toLocaleString()} bytes</span
>
</div>