132 lines
4.7 KiB
TypeScript
132 lines
4.7 KiB
TypeScript
import type { UiDashboardPreview } from "./types";
|
|
|
|
export const dashboardPreviewFixtures: Record<string, UiDashboardPreview> = {
|
|
primary: {
|
|
eyebrow: "Command Surface",
|
|
title: "Operations Console",
|
|
subtitle: "Capacity, latency, and queue health",
|
|
telemetry: [
|
|
metric("core-throughput", "Core Throughput", "mdi:server-network", 82, "ok"),
|
|
metric("edge-cache", "Edge Cache", "mdi:database-clock", 67, "neutral"),
|
|
metric("queue-depth", "Queue Depth", "mdi:tray-full", 74, "warning"),
|
|
metric("error-budget", "Error Budget", "mdi:chart-timeline-variant", 18, "danger"),
|
|
metric("build-latency", "Build Latency", "mdi:timer-sand", 23, "stale"),
|
|
metric("worker-load", "Worker Load", "mdi:cpu-64-bit", 55, "ok"),
|
|
],
|
|
modules: [
|
|
{
|
|
id: "ambient-conditions",
|
|
title: "Local Node",
|
|
value: "21.4 C",
|
|
detail: "clear window",
|
|
icon: "mdi:weather-partly-cloudy",
|
|
severity: "ok",
|
|
},
|
|
],
|
|
serviceGroups: [
|
|
{
|
|
id: "queue-workers",
|
|
title: "Queue Workers",
|
|
services: [
|
|
service("ingest", "Ingest", "Event intake pipeline", "mdi:arrow-collapse-down", "ok", "1.252 ms"),
|
|
service("scheduler", "Scheduler", "Timed job coordinator", "mdi:calendar-clock", "warning", "1.487 ms"),
|
|
service("archive", "Archive", "Cold storage transfer", "mdi:archive-arrow-down", "ok", "1.301 ms"),
|
|
],
|
|
},
|
|
{
|
|
id: "regional-nodes",
|
|
title: "Regional Nodes",
|
|
services: [
|
|
service("north", "North", "Primary traffic cell", "mdi:access-point", "ok", "899 ms"),
|
|
service("west", "West", "Replica traffic cell", "mdi:access-point-network", "neutral", "1.118 ms"),
|
|
service("south", "South", "Maintenance window", "mdi:wrench-clock", "stale", "paused"),
|
|
],
|
|
},
|
|
{
|
|
id: "control-plane",
|
|
title: "Control Plane",
|
|
services: [
|
|
service("identity", "Identity", "Access token exchange", "mdi:account-key", "ok", "721 ms"),
|
|
service("policy", "Policy", "Rules evaluation", "mdi:shield-check", "ok", "812 ms"),
|
|
service("audit", "Audit", "Event ledger writer", "mdi:text-box-search", "warning", "1.442 ms"),
|
|
],
|
|
},
|
|
],
|
|
statusItems: [
|
|
{ id: "system", label: "System", value: "Nominal", severity: "ok" },
|
|
{ id: "sync", label: "Last Sync", value: "2 minutes ago", severity: "stale" },
|
|
{ id: "uptime", label: "Uptime", value: "14d 08h", severity: "neutral" },
|
|
{ id: "refresh", label: "Refresh", value: "15s", severity: "neutral" },
|
|
],
|
|
statusStripId: "dashboard-status",
|
|
},
|
|
secondary: {
|
|
eyebrow: "Support Surface",
|
|
title: "Support Desk",
|
|
subtitle: "Response, routing, and regional health",
|
|
telemetry: [
|
|
metric("response-window", "Response Window", "mdi:headset", 41, "ok"),
|
|
metric("ticket-load", "Ticket Load", "mdi:ticket-confirmation", 68, "warning"),
|
|
metric("handoff-drift", "Handoff Drift", "mdi:swap-horizontal", 11, "neutral"),
|
|
metric("coverage-gap", "Coverage Gap", "mdi:map-marker-alert", 7, "danger"),
|
|
metric("routing-warmup", "Routing Warmup", "mdi:progress-clock", 0, "loading"),
|
|
],
|
|
modules: [
|
|
{
|
|
id: "shift-state",
|
|
title: "Shift State",
|
|
value: "covered",
|
|
detail: "static fixture",
|
|
icon: "mdi:clipboard-check-outline",
|
|
severity: "ok",
|
|
},
|
|
],
|
|
serviceGroups: [
|
|
{
|
|
id: "regional-nodes",
|
|
title: "Regional Nodes",
|
|
services: [
|
|
service("desk-a", "Desk A", "Frontline queue", "mdi:monitor-dashboard", "ok", "843 ms"),
|
|
service("desk-b", "Desk B", "Escalation queue", "mdi:monitor-star", "warning", "1.204 ms"),
|
|
service("desk-c", "Desk C", "Overflow queue", "mdi:monitor-off", "unavailable", "offline"),
|
|
],
|
|
},
|
|
],
|
|
statusItems: [
|
|
{ id: "desk", label: "Desk", value: "Covered", severity: "ok" },
|
|
{ id: "handoff", label: "Handoff", value: "Pending", severity: "warning" },
|
|
{ id: "routing", label: "Routing", value: "Manual", severity: "neutral" },
|
|
],
|
|
statusStripId: "support-status",
|
|
},
|
|
};
|
|
|
|
function metric(
|
|
id: string,
|
|
label: string,
|
|
icon: string,
|
|
progress: number,
|
|
severity: UiDashboardPreview["telemetry"][number]["severity"],
|
|
) {
|
|
return {
|
|
id,
|
|
label,
|
|
icon,
|
|
progress,
|
|
severity,
|
|
value: { kind: "percent" as const, value: progress },
|
|
detail: "static fixture",
|
|
sparkline: [12, 18, 15, 28, 24, progress],
|
|
};
|
|
}
|
|
|
|
function service(
|
|
id: string,
|
|
label: string,
|
|
description: string,
|
|
icon: string,
|
|
severity: UiDashboardPreview["serviceGroups"][number]["services"][number]["severity"],
|
|
detail: string,
|
|
) {
|
|
return { id, label, description, icon, severity, detail };
|
|
}
|