Format provisioning check values with units (Refs #90)

This commit is contained in:
2026-10-09 09:58:06 -04:00
parent cdc400c6bb
commit 6128a137cc
2 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -1,6 +1,14 @@
import { provisioningPhases, type ProvisioningDeployment, type ProvisioningDetail, type ProvisioningEvent, type ProvisioningEventPage, type ProvisioningPhase } from '$lib/provisioning-detail.js';
import { provisioningPhases, type ProvisioningCheck, type ProvisioningDeployment, type ProvisioningDetail, type ProvisioningEvent, type ProvisioningEventPage, type ProvisioningPhase } from '$lib/provisioning-detail.js';
import { actionCompleted, actionLabels, provisioningActions, type ProvisioningAction } from '$lib/provisioning.js';
import { systemUsername } from '$lib/auth.js';
import { countLabel } from './plural.js';
export function provisioningCheckValue(key: ProvisioningCheck['key'], value: ProvisioningCheck['actual']): string {
if (typeof value !== 'number') return value ?? 'Unknown';
if (key === 'game') return countLabel(value, 'player');
if (key === 'plutonium-release' || key === 'plutonium-version') return `r${value}`;
return String(value);
}
export function provisioningRequester(operation: Pick<ProvisioningDeployment, 'requested_by' | 'triggered_by'>): string {
return operation.requested_by ?? (operation.triggered_by === 'ui' ? 'Not recorded' : systemUsername);