import { formatStatus } from "../src/formatter.ts"; import { getLocaleStrings } from "../src/locale.ts"; import type { ScheduleSnapshot } from "../src/types.ts"; const now = new Date("2026-09-01T02:00:00.000Z"); const current: ScheduleSnapshot = { id: "watcher", name: "Schedule watcher", scope: "current", state: "scheduled", triggerKind: "interval", every: "30m", nextRunAt: now.getTime() + 12_000, }; const running: ScheduleSnapshot = { ...current, state: "running", activeRunId: "run-1", startedAt: now.getTime() - 12_000, }; const overdue: ScheduleSnapshot = { ...current, state: "overdue", nextRunAt: now.getTime() - 18_000, }; const shared: ScheduleSnapshot = { id: "shared", name: "共享统计", scope: "shared", state: "scheduled", triggerKind: "interval", every: "1h", nextRunAt: now.getTime() + 24_000, }; for (const locale of ["zh-CN", "en-US"] as const) { const strings = getLocaleStrings(locale); console.log(`\n[${locale}]`); console.log(formatStatus([current], strings, now, 0)); console.log(formatStatus([running], strings, now, 0)); console.log(formatStatus([overdue], strings, now, 0)); console.log(formatStatus([current, shared], strings, now, 0)); }