163 lines
6.7 KiB
TypeScript
163 lines
6.7 KiB
TypeScript
import {
|
|
DASHBOARD_SCHEMA_VERSION,
|
|
type DashboardDocument,
|
|
} from "../schema";
|
|
|
|
export const dimensionLabDashboardFixture: DashboardDocument = {
|
|
schemaVersion: DASHBOARD_SCHEMA_VERSION,
|
|
metadata: {
|
|
title: "System Overview",
|
|
subtitle: "Capacity, noise & top consumers",
|
|
description: "Dimension Lab operational dashboard seed data.",
|
|
timezone: "Europe/Amsterdam",
|
|
refreshIntervalSeconds: 15,
|
|
},
|
|
layout: {
|
|
density: "dense",
|
|
telemetry: [
|
|
"infra-ram",
|
|
"gpu-host-ram",
|
|
"network-ram",
|
|
"user-disk-peak",
|
|
"system-disk-peak",
|
|
"peak-cpu-busy",
|
|
"top-cpu-container",
|
|
"top-ram-container",
|
|
"gpu-3060-load",
|
|
"gpu-3060-vram",
|
|
"gpu-3060-temp",
|
|
"gpu-3060-fan",
|
|
"gpu-3090-load",
|
|
"gpu-3090-vram",
|
|
"gpu-3090-temp",
|
|
"gpu-3090-fan",
|
|
],
|
|
serviceGroups: ["essentials", "monitoring", "ai-automation", "systems", "runtime-health"],
|
|
statusStrips: ["footer-status"],
|
|
modules: ["weather"],
|
|
},
|
|
telemetry: [
|
|
metric("infra-ram", "Infra RAM", "percent", 19, "linux-infra", "ok"),
|
|
metric("gpu-host-ram", "GPU Host RAM", "percent", 17, "linux", "ok"),
|
|
metric("network-ram", "Network RAM", "percent", 5, "network-core", "ok"),
|
|
metric("user-disk-peak", "User Disk Peak", "percent", 29, "linux /home", "ok"),
|
|
metric("system-disk-peak", "System Disk Peak", "percent", 49, "linux /boot", "ok"),
|
|
metric("peak-cpu-busy", "Peak CPU Busy", "percent", 3, "linux-infra", "ok"),
|
|
metric("top-cpu-container", "Top CPU Container", "percent", 7.9, "container placeholder", "ok"),
|
|
metric("top-ram-container", "Top RAM Container", "bytes", 5.2 * 1024 ** 3, "container placeholder", "danger"),
|
|
metric("gpu-3060-load", "3060 GPU Load", "percent", 0, "RTX 3060", "ok"),
|
|
metric("gpu-3060-vram", "3060 VRAM", "percent", 0, "RTX 3060", "ok"),
|
|
metric("gpu-3060-temp", "3060 Temp", "temperature", 54, "RTX 3060", "ok"),
|
|
metric("gpu-3060-fan", "3060 Fan Spin", "percent", 0, "RTX 3060", "ok"),
|
|
metric("gpu-3090-load", "3090 GPU Load", "percent", 0, "RTX 3090", "ok"),
|
|
metric("gpu-3090-vram", "3090 VRAM", "percent", 74, "RTX 3090", "warning"),
|
|
metric("gpu-3090-temp", "3090 Temp", "temperature", 50, "RTX 3090", "ok"),
|
|
metric("gpu-3090-fan", "3090 Fan Spin", "percent", 0, "RTX 3090", "ok"),
|
|
],
|
|
serviceGroups: [
|
|
group("essentials", "Essentials", [
|
|
service("vaultwarden", "Vaultwarden", "Password manager", "simple-icons:vaultwarden", "https://vault.dimensionlab.net"),
|
|
service("forgejo", "Forgejo", "Git repositories", "simple-icons:forgejo", "https://git.dimensionlab.net"),
|
|
service("wiki", "Wiki", "Internal documentation", "simple-icons:wikidotjs", "https://wiki.dimensionlab.net"),
|
|
service("aws-start", "AWS Start", "AWS access portal", "simple-icons:amazonaws", "https://dimensionlab.awsapps.com/start"),
|
|
]),
|
|
group("monitoring", "Monitoring", [
|
|
service("grafana", "Grafana", "Capacity and noise dashboard", "simple-icons:grafana", "https://grafana.dimensionlab.net"),
|
|
service("uptime-kuma", "Uptime Kuma", "Service uptime checks", "simple-icons:uptimekuma", "https://uptime.dimensionlab.net"),
|
|
service("prometheus", "Prometheus", "Metrics database", "simple-icons:prometheus", "https://prometheus.dimensionlab.net"),
|
|
service("backrest", "Backrest", "Restic backup manager", "mdi:backup-restore", "https://backups.dimensionlab.net"),
|
|
]),
|
|
group("ai-automation", "AI & Automation", [
|
|
service("n8n", "n8n", "Workflow automation", "simple-icons:n8n", "https://workflows.dimensionlab.net"),
|
|
service("open-webui", "Open WebUI", "Chat and model interface", "simple-icons:openwebui", "https://webui.dimensionlab.net"),
|
|
service("comfyui", "ComfyUI", "Image generation workflows", "mdi:image-edit-outline", "https://comfy.dimensionlab.net"),
|
|
service("models", "Models", "Local model management", "mdi:brain", "https://models.dimensionlab.net"),
|
|
]),
|
|
group("systems", "Systems", [
|
|
service("adminer", "Adminer", "PostgreSQL database browser", "simple-icons:adminer", "https://db.dimensionlab.net"),
|
|
service("assistant", "Assistant", "Personal AI agent gateway", "mdi:robot-outline", "https://assistant.dimensionlab.net"),
|
|
service("suna", "Suna", "AI command center", "mdi:account-hard-hat-outline", "https://suna.dimensionlab.net"),
|
|
service("cockpit-infra", "Cockpit Infra", "linux-infra server console", "simple-icons:cockpit", "https://infra-cockpit.dimensionlab.net"),
|
|
]),
|
|
group("runtime-health", "Runtime Health", [
|
|
service("forgejo-ssh-relay", "Forgejo SSH Relay", "Public Git SSH relay", "simple-icons:forgejo", "https://uptime.dimensionlab.net/status/dimensionlab"),
|
|
service("postgresql", "PostgreSQL", "Shared application database", "simple-icons:postgresql"),
|
|
service("ollama-api", "Ollama API", "Local model API", "simple-icons:ollama"),
|
|
service("node-exporter", "Node Exporter", "Host metrics exporter", "simple-icons:prometheus"),
|
|
]),
|
|
],
|
|
statusStrips: [
|
|
{
|
|
id: "footer-status",
|
|
items: [
|
|
{ id: "system-status", label: "System Status", value: "All systems operational", severity: "ok" },
|
|
{ id: "last-sync", label: "Last Sync", value: "2 minutes ago", severity: "stale" },
|
|
{ id: "uptime", label: "Uptime", value: "28d 14h 32m", severity: "ok" },
|
|
{ id: "load-avg", label: "Load Avg", value: "0.47 0.53 0.59", severity: "neutral" },
|
|
],
|
|
},
|
|
],
|
|
modules: [
|
|
{
|
|
id: "weather",
|
|
kind: "weather",
|
|
title: "Amsterdam",
|
|
value: "28.3 C",
|
|
detail: "Clear",
|
|
icon: "mdi:weather-sunny",
|
|
severity: "ok",
|
|
datasource: { type: "placeholder", reason: "weather adapter pending" },
|
|
},
|
|
],
|
|
};
|
|
|
|
type NumericValueKind = "percent" | "bytes" | "temperature" | "latency" | "number";
|
|
type Severity = "neutral" | "ok" | "warning" | "danger" | "stale" | "unavailable";
|
|
|
|
function metric(
|
|
id: string,
|
|
label: string,
|
|
kind: NumericValueKind,
|
|
value: number,
|
|
detail: string,
|
|
severity: Severity,
|
|
) {
|
|
return {
|
|
id,
|
|
label,
|
|
value: { kind, value },
|
|
detail,
|
|
severity,
|
|
datasource: { type: "placeholder" as const, reason: "live datasource pending" },
|
|
sparkline: [10, 18, 15, 28, 24, 32],
|
|
};
|
|
}
|
|
|
|
function service(
|
|
id: string,
|
|
label: string,
|
|
description: string,
|
|
icon: string,
|
|
href?: string,
|
|
) {
|
|
const entry = {
|
|
id,
|
|
label,
|
|
description,
|
|
icon,
|
|
severity: "ok" as const,
|
|
detail: "ready",
|
|
datasource: { type: "placeholder" as const, reason: "service health adapter pending" },
|
|
};
|
|
|
|
return href ? { ...entry, link: { href, external: true } } : entry;
|
|
}
|
|
|
|
function group(id: string, title: string, services: ReturnType<typeof service>[]) {
|
|
return {
|
|
id,
|
|
title,
|
|
layout: "list" as const,
|
|
services,
|
|
};
|
|
}
|