Fix count and status wording (Refs #121)

This commit is contained in:
2026-10-17 09:48:42 -04:00
parent ba9bed6a0d
commit d93a766578
6 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ function readOperations(now: number, server?: string): FleetOperation[] {
? 'Completed with warnings' ? 'Completed with warnings'
: 'Complete' : 'Complete'
: state === 'attention' : state === 'attention'
? `${actionLabels[row.action as ProvisioningAction]} needs attention` ? `${actionLabels[row.action as ProvisioningAction]} operation needs attention`
: row.stage, : row.stage,
detail: row.error ?? row.stage, detail: row.error ?? row.stage,
href: `/provisioning/${encodeURIComponent(row.id)}` href: `/provisioning/${encodeURIComponent(row.id)}`
+1 -1
View File
@@ -73,7 +73,7 @@ function healthEvidence(
if (hostOffline) if (hostOffline)
return { return {
state: 'host-offline', state: 'host-offline',
reason: `${host.name ? `${host.name}'s host agent` : 'The host agent'} is unavailable. The game may still be running.`, reason: `The host agent${host.name ? ` on ${host.name}` : ''} is unavailable. The game may still be running.`,
actionLabel: hostId ? 'Check host' : 'Open diagnostics', actionLabel: hostId ? 'Check host' : 'Open diagnostics',
actionHref: hostId ? `/hosts/${encodeURIComponent(hostId)}` : diagnostics, actionHref: hostId ? `/hosts/${encodeURIComponent(hostId)}` : diagnostics,
since: observedAt(host.lastHeartbeat, now) since: observedAt(host.lastHeartbeat, now)
+2 -1
View File
@@ -8,6 +8,7 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { pollVisible } from '$ui/poll.js'; import { pollVisible } from '$ui/poll.js';
import { plural } from '$ui/plural.js';
import { import {
campaignOutcome, campaignOutcome,
campaignTitle, campaignTitle,
@@ -221,7 +222,7 @@
{#if showProgress}<progress {#if showProgress}<progress
max={campaign.servers.length || 1} max={campaign.servers.length || 1}
value={outcome.completed} value={outcome.completed}
aria-label={`${outcome.completed} of ${campaign.servers.length} servers complete`} aria-label={`${outcome.completed} of ${campaign.servers.length} ${plural(campaign.servers.length, 'server')} complete`}
></progress>{/if} ></progress>{/if}
</div></td </div></td
> >
+2 -1
View File
@@ -21,6 +21,7 @@
import Input from '$ui/components/primitives/Input.svelte'; import Input from '$ui/components/primitives/Input.svelte';
import Select from '$ui/components/primitives/Select.svelte'; import Select from '$ui/components/primitives/Select.svelte';
import { libraryLimit, saveLibraryContext } from '$ui/library-context.js'; import { libraryLimit, saveLibraryContext } from '$ui/library-context.js';
import { plural } from '$ui/plural.js';
const editable = $derived(canOperate($page.data?.user?.role)); const editable = $derived(canOperate($page.data?.user?.role));
type ArtifactKind = 'script' | 'config' | 'plugin' | 'baseline'; type ArtifactKind = 'script' | 'config' | 'plugin' | 'baseline';
@@ -353,7 +354,7 @@
</details>{/if} </details>{/if}
<section class="section"> <section class="section">
<div class="list-heading"> <div class="list-heading">
<span>{visible.length} of {plugins.length} plugins</span <span>{visible.length} of {plugins.length} {plural(plugins.length, 'plugin')}</span
>{#if visible.length && (search || game || status)}<Button >{#if visible.length && (search || game || status)}<Button
variant="ghost" variant="ghost"
size="sm" size="sm"
+2 -1
View File
@@ -26,6 +26,7 @@
} from '$lib/script-library.js'; } from '$lib/script-library.js';
import { zombieMaps } from '$lib/map-aliases.js'; import { zombieMaps } from '$lib/map-aliases.js';
import { libraryLimit, saveLibraryContext } from '$ui/library-context.js'; import { libraryLimit, saveLibraryContext } from '$ui/library-context.js';
import { plural } from '$ui/plural.js';
const editable = $derived(canOperate($page.data?.user?.role)); const editable = $derived(canOperate($page.data?.user?.role));
let limit = $state(25); let limit = $state(25);
@@ -257,7 +258,7 @@
> >
</div> </div>
<div class="list-heading"> <div class="list-heading">
<span>{visible.length} of {scripts.length} scripts</span> <span>{visible.length} of {scripts.length} {plural(scripts.length, 'script')}</span>
{#if failedCount && status !== 'failed'}<button {#if failedCount && status !== 'failed'}<button
class="text-button" class="text-button"
onclick={() => { onclick={() => {
+1 -1
View File
@@ -61,7 +61,7 @@ describe('server health presentation', () => {
).toEqual({ ).toEqual({
state: 'host-offline', state: 'host-offline',
label: 'Host offline', label: 'Host offline',
reason: "Dallas 1's host agent is unavailable. The game may still be running.", reason: 'The host agent on Dallas 1 is unavailable. The game may still be running.',
shortReason: 'Dallas 1 unavailable; game may still run.', shortReason: 'Dallas 1 unavailable; game may still run.',
actionLabel: 'Check host', actionLabel: 'Check host',
actionHref: '/hosts/host-1', actionHref: '/hosts/host-1',