Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Remove monitoring page prototypes
rcourtmancd982c43b9e7
diff --git a/docs/prototypes/monitoring-platform-v2/index.html b/docs/prototypes/monitoring-platform-v2/index.htmldeleted file mode 100644index 497755517c..0000000000--- a/docs/prototypes/monitoring-platform-v2/index.html+++ /dev/null@@ -1,1332 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Pulse Monitoring Prototype v2</title>- <style>- :root {- --bg: #0d1627;- --surface: #172236;- --surface-soft: #24334b;- --surface-row: #18243a;- --section: #101a2b;- --line: #33445d;- --line-strong: #52677f;- --text: #e8eef8;- --muted: #9aa8bd;- --blue: #5aa2ff;- --green: #36c275;- --amber: #f2b84b;- --red: #ef6f61;- }-- * {- box-sizing: border-box;- }-- [hidden] {- display: none !important;- }-- body {- margin: 0;- background: var(--bg);- color: var(--text);- font: 12px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;- }-- button,- input {- font: inherit;- }-- button {- border: 1px solid var(--line);- background: var(--surface);- color: var(--text);- border-radius: 4px;- padding: 5px 9px;- cursor: pointer;- white-space: nowrap;- }-- button:hover,- button.active {- border-color: var(--blue);- background: #123159;- color: var(--blue);- }-- button[aria-disabled="true"] {- cursor: default;- }-- .page {- max-width: 1720px;- margin: 0 auto;- padding: 12px;- }-- .header {- display: flex;- justify-content: space-between;- gap: 14px;- margin-bottom: 8px;- }-- h1,- p {- margin: 0;- }-- h1 {- font-size: 21px;- letter-spacing: 0;- }-- .subtitle {- margin-top: 3px;- color: var(--muted);- }-- .summary {- display: grid;- grid-template-columns: repeat(6, minmax(130px, 1fr));- gap: 8px;- margin-bottom: 8px;- }-- .card {- background: var(--surface);- border: 1px solid var(--line);- border-radius: 6px;- box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);- }-- .summary-card {- padding: 7px 10px;- }-- .label {- color: var(--muted);- font-size: 11px;- }-- .big-number {- display: flex;- align-items: baseline;- gap: 6px;- margin-top: 3px;- font-size: 20px;- font-weight: 750;- }-- .note {- color: var(--muted);- font-size: 11px;- }-- .toolbar {- display: grid;- gap: 6px;- padding: 8px;- margin-bottom: 8px;- }-- .search-row {- display: flex;- gap: 7px;- }-- .toolbar input {- width: 100%;- border: 1px solid var(--line);- border-radius: 4px;- padding: 6px 9px;- background: #111c2f;- color: var(--text);- }-- .filter-row {- display: flex;- align-items: center;- gap: 7px;- flex-wrap: wrap;- }-- .filter-label {- width: 76px;- color: var(--muted);- font-size: 10px;- font-weight: 700;- text-transform: uppercase;- }-- .filter-buttons {- display: flex;- align-items: center;- gap: 6px;- flex-wrap: wrap;- }-- .reset-button {- flex: 0 0 auto;- }-- .table-card {- overflow: hidden;- }-- .table-wrap {- overflow: auto;- }-- table {- width: 100%;- min-width: 1480px;- border-collapse: collapse;- table-layout: fixed;- }-- th,- td {- border-bottom: 1px solid var(--line);- height: 25px;- padding: 3px 8px;- vertical-align: middle;- text-align: left;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }-- th {- position: sticky;- top: 0;- z-index: 2;- background: var(--surface-soft);- color: var(--muted);- font-size: 11px;- text-transform: uppercase;- letter-spacing: 0;- }-- tbody tr {- background: var(--surface-row);- }-- tbody tr:hover {- background: #203454;- }-- tr.section-row td {- height: 30px;- padding: 5px 8px;- background: var(--section);- border-top: 2px solid var(--line-strong);- border-bottom: 1px solid #32435a;- }-- tr.section-row.platform td {- height: 31px;- background: var(--surface-soft);- }-- tr.section-row.top td {- height: 28px;- background: #111d31;- border-top: 1px solid var(--line-strong);- }-- tr.section-row.lane td {- height: 22px;- padding-left: 28px;- background: #152136;- border-top: 1px solid #2a3a52;- }-- tr.section-row.group td {- height: 25px;- background: #142033;- border-top: 1px solid var(--line);- }-- .section {- display: flex;- align-items: center;- gap: 10px;- min-width: 0;- }-- .section-mark {- width: 4px;- height: 15px;- border-radius: 4px;- background: var(--blue);- }-- tr.section-row.group .section-mark {- height: 12px;- opacity: 0.72;- }-- tr.section-row.top .section-mark {- height: 14px;- background: #8fb8e8;- opacity: 0.8;- }-- tr.section-row.lane .section-mark {- width: 3px;- height: 10px;- background: #6f819b;- opacity: 0.82;- }-- .section-title {- color: #e3ebf7;- font-size: 11px;- font-weight: 800;- line-height: 1;- text-transform: uppercase;- white-space: nowrap;- }-- tr.section-row.top .section-title {- font-size: 12px;- text-transform: none;- }-- tr.section-row.lane .section-title {- color: #c5d1df;- font-size: 10px;- }-- .section-meta {- color: var(--muted);- font-size: 10px;- font-weight: 650;- white-space: nowrap;- }-- tr.data-row td {- height: 25px;- font-size: 11px;- }-- tr.data-row.area-top td {- height: 27px;- background: #1a283f;- font-size: 11.5px;- }-- tr.data-row.area-workload td,- tr.data-row.area-storage td,- tr.data-row.area-recovery td {- height: 23px;- }-- tr.data-row.area-workload td:first-child,- tr.data-row.area-storage td:first-child,- tr.data-row.area-recovery td:first-child {- padding-left: 22px;- }-- tr.data-row.related-row td {- height: 21px;- background: #162238;- color: #bdc8d6;- }-- tr.data-row.related-row td:first-child {- padding-left: 44px;- }-- tr.data-row.related-row .name {- font-weight: 650;- }-- tr.data-row.related-row .state-dot {- width: 6px;- height: 6px;- opacity: 0.85;- }-- .relation {- flex: 0 0 auto;- width: 42px;- color: var(--muted);- font-size: 9px;- font-weight: 750;- text-transform: uppercase;- }-- .resource {- display: flex;- align-items: center;- gap: 7px;- min-width: 0;- }-- .state-dot {- flex: 0 0 auto;- width: 8px;- height: 8px;- border-radius: 999px;- background: var(--green);- box-shadow: 0 0 0 1px rgba(54, 194, 117, 0.75);- }-- .state-dot.state-issue {- background: var(--amber);- box-shadow: 0 0 0 1px rgba(242, 184, 75, 0.75);- }-- .state-dot.state-off {- background: var(--red);- box-shadow: 0 0 0 1px rgba(239, 111, 97, 0.75);- }-- .name {- min-width: 0;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- font-weight: 720;- }-- .subtle {- color: var(--muted);- }-- .pill {- display: inline-flex;- align-items: center;- gap: 5px;- border: 1px solid var(--line);- border-radius: 4px;- padding: 1px 5px;- font-size: 9px;- line-height: 1.15;- white-space: nowrap;- }-- .metric {- display: grid;- grid-template-columns: 31px minmax(0, 1fr);- align-items: center;- gap: 5px;- min-width: 0;- }-- .track {- height: 5px;- border-radius: 2px;- background: #2d3b51;- overflow: hidden;- }-- .fill {- height: 100%;- border-radius: inherit;- background: var(--green);- }-- .fill.warning {- background: var(--amber);- }-- .fill.critical {- background: var(--red);- }-- .signals {- display: flex;- align-items: center;- gap: 6px;- min-width: 0;- }-- .signal-count {- display: inline-flex;- align-items: center;- justify-content: center;- min-width: 16px;- height: 15px;- border-radius: 3px;- background: #2a3446;- color: #d8e1ee;- font-size: 10px;- font-weight: 700;- }-- tr.row-issue .signal-count {- background: #3a2c12;- color: var(--amber);- }-- tr.row-off .signal-count {- background: #44201d;- color: var(--red);- }-- .signal-text {- display: block;- max-width: 230px;- overflow: hidden;- text-overflow: ellipsis;- color: #c6d0df;- white-space: nowrap;- }-- .empty-state {- padding: 28px;- color: var(--muted);- text-align: center;- }- </style>- </head>- <body>- <main class="page">- <header class="header">- <div>- <h1>Monitoring v2</h1>- <p class="subtitle">Dense unified table with platform, resource, and operational lane segmentation.</p>- </div>- </header>-- <section class="summary" aria-label="Monitoring summary">- <article class="card summary-card">- <div class="label">Platforms</div>- <div class="big-number"><span id="platformCount">0</span><span class="note">supported</span></div>- </article>- <article class="card summary-card">- <div class="label">Hosts & Clusters</div>- <div class="big-number"><span id="topLevelCount">0</span><span class="note">resources</span></div>- </article>- <article class="card summary-card">- <div class="label">VMs / Containers / Pods</div>- <div class="big-number"><span id="workloadCount">0</span><span class="note">guests, pods, containers</span></div>- </article>- <article class="card summary-card">- <div class="label">Storage</div>- <div class="big-number"><span id="storageCount">0</span><span class="note">items</span></div>- </article>- <article class="card summary-card">- <div class="label">Backups</div>- <div class="big-number"><span id="recoveryCount">0</span><span class="note">policies</span></div>- </article>- <article class="card summary-card">- <div class="label">Needs Attention</div>- <div class="big-number"><span id="attentionCount">0</span><span class="note">resources</span></div>- </article>- </section>-- <section class="card toolbar" aria-label="Monitoring controls">- <div class="search-row">- <input id="search" type="search" placeholder="Search hosts, clusters, VMs, containers, pods, storage, backups..." />- <button id="resetFilters" class="reset-button" type="button">Reset</button>- </div>- <div class="filter-row">- <span class="filter-label">Platform</span>- <div id="platformButtons" class="filter-buttons"></div>- </div>- <div class="filter-row">- <span class="filter-label">Show</span>- <div id="viewButtons" class="filter-buttons"></div>- </div>- </section>-- <article class="card table-card">- <div class="table-wrap">- <table>- <colgroup id="cols"></colgroup>- <thead id="head"></thead>- <tbody id="body"></tbody>- </table>- <div id="empty" class="empty-state" hidden>No resources match this view.</div>- </div>- </article>- </main>-- <script>- const viewOptions = [- { id: "overview", label: "All resources", layers: ["top", "workload", "storage", "recovery"] },- { id: "hosts", label: "Hosts & clusters", layers: ["top"] },- { id: "workloads", label: "VMs / containers / pods", layers: ["top", "workload"] },- { id: "storage", label: "Storage", layers: ["top", "workload", "storage"] },- { id: "recovery", label: "Backups", layers: ["top", "workload", "recovery"] },- { id: "problems", label: "Problems", layers: ["top", "workload", "storage", "recovery"] },- ];-- // Displayed fields stay inside unified resource model concerns: identity,- // kind, placement, liveness state, metrics, protection state, and health signals.- const columns = {- overview: [- { key: "name", label: "Resource", width: 260, type: "resource" },- { key: "kind", label: "Kind", width: 120 },- { key: "info", label: "Info", width: 300 },- { key: "cpu", label: "CPU", width: 100, type: "metric" },- { key: "memory", label: "Memory", width: 100, type: "metric" },- { key: "disk", label: "Disk", width: 100, type: "metric" },- { key: "recovery", label: "Backup", width: 110 },- { key: "signals", label: "Signals", width: 330, type: "signals" },- ],- workloads: [- { key: "name", label: "VM / Container / Pod", width: 270, type: "resource" },- { key: "kind", label: "Kind", width: 125 },- { key: "placement", label: "Placement", width: 180 },- { key: "cpu", label: "CPU", width: 100, type: "metric" },- { key: "memory", label: "Memory", width: 100, type: "metric" },- { key: "disk", label: "Disk", width: 100, type: "metric" },- { key: "recovery", label: "Backup", width: 120 },- { key: "signals", label: "Signals", width: 340, type: "signals" },- ],- storage: [- { key: "name", label: "Storage", width: 270, type: "resource" },- { key: "kind", label: "Kind", width: 130 },- { key: "info", label: "Backing / Role", width: 310 },- { key: "disk", label: "Used", width: 100, type: "metric" },- { key: "size", label: "Size", width: 120 },- { key: "temp", label: "Temp", width: 90 },- { key: "recovery", label: "Backup", width: 120 },- { key: "signals", label: "Signals", width: 340, type: "signals" },- ],- backups: [- { key: "name", label: "Protected Item", width: 280, type: "resource" },- { key: "kind", label: "Kind", width: 130 },- { key: "placement", label: "Placement", width: 190 },- { key: "target", label: "Target", width: 220 },- { key: "lastRun", label: "Last Run", width: 130 },- { key: "verification", label: "Verification", width: 145 },- { key: "recovery", label: "Backup", width: 120 },- { key: "signals", label: "Signals", width: 360, type: "signals" },- ],- };-- const data = {- proxmox: {- label: "Proxmox",- topLabel: "hosts",- top: [- { name: "pve-a", kind: "Host", info: "instance lab-pve / cluster member", status: "critical", cpu: 86, memory: 77, disk: 94, recovery: "Stale", signals: ["Root disk above 90%", "3 child resources affected"] },- { name: "pve-b", kind: "Host", info: "instance lab-pve / cluster member", status: "ok", cpu: 38, memory: 62, disk: 70, recovery: "Protected", signals: [] },- ],- workloads: [- { name: "vm-210 pulse-db", kind: "VM", placement: "pve-a", info: "vmid 210 / qemu", status: "critical", cpu: 71, memory: 93, disk: 81, recovery: "Missed", signals: ["Memory pressure", "Backup missed 2 runs"] },- { name: "vm-214 grafana", kind: "VM", placement: "pve-a", info: "vmid 214 / qemu", status: "offline", state: "off", cpu: null, memory: null, disk: null, recovery: "Protected", signals: ["Guest powered off"] },- { name: "ct-117 redis-cache", kind: "LXC", placement: "pve-a", info: "vmid 117 / lxc", status: "warning", cpu: 47, memory: 78, disk: 61, recovery: "Protected", signals: ["Restarted 4 times in 6h"] },- { name: "vm-104 home-assistant", kind: "VM", placement: "pve-b", info: "vmid 104 / qemu", status: "ok", cpu: 12, memory: 36, disk: 44, recovery: "Protected", signals: [] },- { name: "ct-130 nginx-edge", kind: "LXC", placement: "pve-b", info: "vmid 130 / lxc", status: "warning", cpu: 64, memory: 55, disk: 47, recovery: "Protected", signals: ["TLS certificate expires in 9 days"] },- ],- storage: [- { name: "local-zfs", kind: "Pool", placement: "pve-a", info: "VM datastore", status: "critical", disk: 94, size: "3.5 TB", temp: "-", recovery: "N/A", signals: ["Free space below 8%", "Snapshots growing faster than pruning"] },- { name: "vm-210/scsi0", kind: "VM Disk", placement: "pve-a / vm-210", info: "VirtIO disk on local-zfs", status: "warning", disk: 82, size: "220 GB", temp: "-", recovery: "Protected", signals: ["Guest disk above 80%"] },- { name: "vm-210/sata-pass", kind: "Passthrough Disk", placement: "pve-a / vm-210", info: "Passed-through SATA disk", status: "warning", disk: 80, size: "4 TB", temp: "52 C", recovery: "N/A", signals: ["Temperature 52 C"] },- { name: "ct-117/rootfs", kind: "CT Volume", placement: "pve-a / ct-117", info: "LXC rootfs on local-zfs", status: "ok", disk: 48, size: "64 GB", temp: "-", recovery: "Protected", signals: [] },- { name: "nvme0n1", kind: "Disk", placement: "pve-a", info: "Samsung 970 EVO / local-zfs member", status: "warning", disk: 88, size: "2 TB", temp: "69 C", recovery: "N/A", signals: ["Temperature 69 C", "SMART warning count increased"] },- { name: "ceph-fast", kind: "Pool", placement: "pve-b", info: "Replicated SSD pool / VM datastore", status: "ok", disk: 63, size: "8 TB", temp: "-", recovery: "N/A", signals: [] },- { name: "vm-104/scsi0", kind: "VM Disk", placement: "pve-b / vm-104", info: "Ceph RBD disk", status: "ok", disk: 58, size: "160 GB", temp: "-", recovery: "Protected", signals: [] },- { name: "sdb", kind: "Disk", placement: "pve-b", info: "Intel DC SSD / ceph-fast OSD", status: "ok", disk: 61, size: "2 TB", temp: "41 C", recovery: "N/A", signals: [] },- ],- backups: [- { name: "vm-210 pulse-db", kind: "VM Backup", placement: "pve-a / vm-210", target: "PBS nightly-pve-a", lastRun: "38h ago", verification: "not current", status: "critical", recovery: "Missed", signals: ["Last successful backup 38h ago"] },- { name: "vm-214 grafana", kind: "VM Backup", placement: "pve-a / vm-214", target: "PBS nightly-pve-a", lastRun: "02:12", verification: "verified", status: "ok", recovery: "Protected", signals: [] },- { name: "ct-117 redis-cache", kind: "CT Backup", placement: "pve-a / ct-117", target: "PBS nightly-pve-a", lastRun: "02:09", verification: "verified", status: "ok", recovery: "Protected", signals: [] },- { name: "vm-104 home-assistant", kind: "VM Backup", placement: "pve-b / vm-104", target: "PBS nightly-pve-b", lastRun: "02:10", verification: "verified", status: "ok", recovery: "Protected", signals: [] },- { name: "ct-130 nginx-edge", kind: "CT Backup", placement: "pve-b / ct-130", target: "PBS nightly-pve-b", lastRun: "02:08", verification: "verified", status: "ok", recovery: "Protected", signals: [] },- ],- },- docker: {- label: "Docker",- topLabel: "hosts",- top: [- { name: "docker-host-01", kind: "Host", info: "docker engine / agent source", status: "ok", cpu: 24, memory: 45, disk: 57, recovery: "Protected", signals: [] },- { name: "edge-apps-01", kind: "Host", info: "docker engine / remote source", status: "warning", cpu: 44, memory: 69, disk: 72, recovery: "Partial", signals: ["One container restart loop"] },- ],- workloads: [- { name: "container/immich", kind: "Container", placement: "docker-host-01", info: "image ghcr.io/immich-app/immich-server", status: "ok", cpu: 33, memory: 66, disk: 58, recovery: "Protected", signals: [] },- { name: "container/paperless", kind: "Container", placement: "docker-host-01", info: "image ghcr.io/paperless-ngx/paperless-ngx", status: "ok", cpu: 17, memory: 52, disk: 49, recovery: "Protected", signals: [] },- { name: "container/watchtower", kind: "Container", placement: "edge-apps-01", info: "image containrrr/watchtower", status: "warning", cpu: 12, memory: 22, disk: 18, recovery: "N/A", signals: ["Restarted 6 times in 3h"] },- ],- storage: [- { name: "volume/immich-library", kind: "Volume", placement: "docker-host-01 / immich", info: "Local Docker volume", status: "warning", disk: 83, size: "4 TB", temp: "-", recovery: "Protected", signals: ["Projected to fill in 18 days"] },- { name: "volume/postgres-data", kind: "Volume", placement: "docker-host-01 / paperless", info: "Database volume", status: "ok", disk: 52, size: "500 GB", temp: "-", recovery: "Protected", signals: [] },- { name: "bind/edge-config", kind: "Bind Mount", placement: "edge-apps-01", info: "Config mount", status: "warning", disk: 71, size: "40 GB", temp: "-", recovery: "Partial", signals: ["Backup excludes one path"] },- ],- backups: [- { name: "immich volumes", kind: "Volume Backup", placement: "docker-host-01 / immich", target: "restic-docker", lastRun: "03:40", verification: "sampled", status: "ok", recovery: "Protected", signals: [] },- { name: "paperless volumes", kind: "Volume Backup", placement: "docker-host-01 / paperless", target: "restic-docker", lastRun: "03:42", verification: "sampled", status: "ok", recovery: "Protected", signals: [] },- { name: "edge bind mounts", kind: "File Backup", placement: "edge-apps-01", target: "restic-edge", lastRun: "16h ago", verification: "not sampled", status: "warning", recovery: "Partial", signals: ["One excluded path"] },- ],- },- kubernetes: {- label: "Kubernetes",- topLabel: "clusters",- top: [- { name: "edge-k8s", kind: "Cluster", info: "context edge-k8s / v1.30", status: "warning", cpu: 58, memory: 74, disk: 66, recovery: "Partial", signals: ["One namespace has degraded pods"] },- { name: "prod-euw1", kind: "Cluster", info: "context prod-euw1 / v1.30", status: "ok", cpu: 42, memory: 63, disk: 51, recovery: "Protected", signals: [] },- ],- workloads: [- { name: "deployment/api", kind: "Deployment", placement: "edge-k8s / production", info: "desired 6 / ready 4", status: "warning", cpu: 74, memory: 82, disk: null, recovery: "Manifest", signals: ["2 pods not ready"] },- { name: "pod/api-7d9c8", kind: "Pod", placement: "edge-k8s / production", info: "phase Running / CrashLoopBackOff", status: "critical", cpu: 91, memory: 89, disk: null, recovery: "Ephemeral", signals: ["CrashLoopBackOff", "CPU throttling"] },- { name: "deployment/checkout", kind: "Deployment", placement: "prod-euw1 / apps", info: "desired 8 / ready 8", status: "ok", cpu: 37, memory: 44, disk: null, recovery: "Manifest", signals: [] },- ],- storage: [- { name: "pvc/api-data", kind: "PVC", placement: "edge-k8s / production", info: "fast-rwo", status: "ok", disk: 52, size: "150 GB", temp: "-", recovery: "Snapshot", signals: [] },- { name: "pvc/checkout-cache", kind: "PVC", placement: "prod-euw1 / apps", info: "standard-rwo", status: "ok", disk: 46, size: "80 GB", temp: "-", recovery: "Snapshot", signals: [] },- { name: "storageclass/local-path", kind: "StorageClass", placement: "edge-k8s", info: "node local", status: "warning", disk: 68, size: "-", temp: "-", recovery: "Partial", signals: ["One PVC snapshot skipped"] },- ],- backups: [- { name: "production namespace", kind: "Velero Backup", placement: "edge-k8s / production", target: "velero-production", lastRun: "04:15", verification: "policy only", status: "warning", recovery: "Partial", signals: ["One PVC snapshot skipped"] },- { name: "apps namespace", kind: "Velero Backup", placement: "prod-euw1 / apps", target: "velero-prod-euw1", lastRun: "03:55", verification: "policy only", status: "ok", recovery: "Protected", signals: [] },- ],- },- truenas: {- label: "TrueNAS",- topLabel: "systems",- top: [- { name: "core-nas-01", kind: "System", info: "hostname core-nas-01 / 24.10", status: "warning", cpu: 31, memory: 68, disk: 79, recovery: "Protected", signals: ["One disk has SMART pre-fail attribute"] },- { name: "backup-vault", kind: "System", info: "hostname backup-vault / 24.10", status: "ok", cpu: 18, memory: 41, disk: 62, recovery: "Current", signals: [] },- ],- workloads: [],- storage: [- { name: "tank", kind: "Pool", placement: "core-nas-01", info: "Main ZFS pool", status: "warning", disk: 79, size: "20 TB", temp: "-", recovery: "Snapshots", signals: ["One mirror member is degrading"] },- { name: "tank/media", kind: "Dataset", placement: "core-nas-01 / tank", info: "Media dataset", status: "ok", disk: 74, size: "12 TB", temp: "-", recovery: "Snapshots", signals: [] },- { name: "tank/apps", kind: "Dataset", placement: "core-nas-01 / tank", info: "Application dataset", status: "ok", disk: 48, size: "3 TB", temp: "-", recovery: "Snapshots", signals: [] },- { name: "sda", kind: "Disk", placement: "core-nas-01 / tank", info: "8 TB Seagate", status: "critical", disk: 81, size: "8 TB", temp: "57 C", recovery: "N/A", signals: ["SMART pre-fail attribute changed"] },- { name: "backup-pool", kind: "Pool", placement: "backup-vault", info: "PBS and replication target", status: "ok", disk: 62, size: "18 TB", temp: "-", recovery: "Snapshots", signals: [] },- ],- backups: [- { name: "tank replication", kind: "Replication", placement: "core-nas-01 / tank", target: "backup-vault", lastRun: "14m ago", verification: "checksum", status: "ok", recovery: "Current", signals: [] },- { name: "apps snapshots", kind: "Snapshot Task", placement: "core-nas-01 / tank/apps", target: "core-nas-01", lastRun: "28m ago", verification: "policy", status: "ok", recovery: "Current", signals: [] },- ],- },- vsphere: {- label: "vSphere",- topLabel: "clusters",- top: [- { name: "vsphere-lab", kind: "Cluster", info: "vCenter vcsa-lab / cluster", status: "warning", cpu: 46, memory: 67, disk: 58, recovery: "Partial", signals: ["Active datastore latency alarm"] },- { name: "esxi-edge", kind: "Host", info: "ESXi host / connected", status: "ok", cpu: 34, memory: 52, disk: 49, recovery: "Protected", signals: [] },- ],- workloads: [- { name: "vmware/ad-01", kind: "VM", placement: "vsphere-lab", info: "guest windowsServer64Guest", status: "ok", cpu: 29, memory: 57, disk: 46, recovery: "Protected", signals: [] },- { name: "vmware/files-02", kind: "VM", placement: "vsphere-lab", info: "guest linux64Guest", status: "warning", cpu: 67, memory: 73, disk: 72, recovery: "Partial", signals: ["Snapshot policy not confirmed"] },- { name: "vmware/vcenter", kind: "VM", placement: "esxi-edge", info: "guest vmwarePhoton64Guest", status: "ok", cpu: 25, memory: 49, disk: 41, recovery: "Protected", signals: [] },- ],- storage: [- { name: "datastore-fast-01", kind: "Datastore", placement: "vsphere-lab", info: "VMFS datastore", status: "warning", disk: 76, size: "6 TB", temp: "-", recovery: "N/A", signals: ["Datastore latency rose 9 minutes ago"] },- { name: "datastore-edge", kind: "Datastore", placement: "esxi-edge", info: "Local datastore", status: "ok", disk: 49, size: "2 TB", temp: "-", recovery: "N/A", signals: [] },- ],- backups: [- { name: "vmware/ad-01", kind: "VM Backup", placement: "vsphere-lab / ad-01", target: "veeam-vsphere-nightly", lastRun: "01:50", verification: "verified", status: "ok", recovery: "Protected", signals: [] },- { name: "vmware/files-02", kind: "VM Backup", placement: "vsphere-lab / files-02", target: "veeam-vsphere-nightly", lastRun: "01:55", verification: "not exercised", status: "warning", recovery: "Partial", signals: ["Restore verification not yet exercised"] },- { name: "vmware/vcenter", kind: "VM Backup", placement: "esxi-edge / vcenter", target: "veeam-edge", lastRun: "02:20", verification: "verified", status: "ok", recovery: "Protected", signals: [] },- ],- },- };-- const state = {- view: "overview",- selectedPlatforms: new Set(),- query: "",- };-- function platformIds() {- return Object.keys(data);- }-- function viewOption(view) {- return viewOptions.find((option) => option.id === view) || viewOptions[0];- }-- function applyView(view) {- state.view = view;- }-- function ensureViewState() {- if (!viewOptions.some((option) => option.id === state.view)) applyView("overview");- }-- function activeLayers() {- return new Set(viewOption(state.view).layers);- }-- function layerEnabled(layer) {- return activeLayers().has(layer);- }-- function resetFilters() {- state.selectedPlatforms.clear();- state.query = "";- applyView("overview");- document.getElementById("search").value = "";- }-- function selectedPlatformIds() {- return state.selectedPlatforms.size ? Array.from(state.selectedPlatforms) : platformIds();- }-- function focusedPlatformScope() {- if (state.selectedPlatforms.size !== 1) return "";- return Array.from(state.selectedPlatforms)[0];- }-- function allRows(platformId) {- const platform = data[platformId];- return [- ...platform.top.map((row) => normalizeRow(platformId, "top", row)),- ...platform.workloads.map((row) => normalizeRow(platformId, "workload", row)),- ...platform.storage.map((row) => normalizeRow(platformId, "storage", row)),- ...platform.backups.map((row) => normalizeRow(platformId, "recovery", row)),- ];- }-- function normalizeRow(platformId, area, row) {- const recoveryInfo = area === "recovery"- ? [row.target, row.lastRun, row.verification].filter(Boolean).join(" / ")- : "";- const runtimeState = resolveRuntimeState(row);- return {- ...row,- info: row.info || recoveryInfo,- runtimeState: runtimeState.id,- runtimeStateLabel: runtimeState.label,- platform: platformId,- platformLabel: data[platformId].label,- area,- signal: (row.signals || [])[0] || "None",- };- }-- function resolveRuntimeState(row) {- if (row.state === "off" || row.status === "offline") return { id: "off", label: "Off" };- if (row.state === "on" || row.status === "ok") {- if ((row.signals || []).length > 0) return { id: "issue", label: "Issue" };- return { id: "on", label: "On" };- }- return { id: "issue", label: "Issue" };- }-- function hasProblem(row) {- return row.runtimeState === "off" || row.runtimeState === "issue" || row.status === "critical" || row.status === "warning" || (row.signals || []).length > 0;- }-- function matchesSearch(row) {- if (!state.query) return true;- return [row.name, row.kind, row.info, row.placement, row.platformLabel, row.status, row.runtimeStateLabel, row.recovery, row.target, row.lastRun, row.verification, ...(row.signals || [])]- .join(" ")- .toLowerCase()- .includes(state.query);- }-- function section(title, meta = "", level = "group") {- return { section: true, title, meta, level };- }-- function rowsForScope() {- const focusedPlatform = focusedPlatformScope();- if (focusedPlatform) return platformRows(focusedPlatform);- return globalRows();- }-- function globalRows() {- if (state.view === "overview") return segmentedOverviewRows(selectedPlatformIds(), true);- if (state.view === "problems") return globalProblemRows();- const rows = [];- for (const platformId of selectedPlatformIds()) {- const result = platformRows(platformId);- if (!result.rows.length) continue;- rows.push(section(data[platformId].label, "", "platform"), ...result.rows);- }- return { columns: columnsForFocus(), rows };- }-- function topLevelRows(platformId) {- const rows = data[platformId].top- .map((row) => normalizeRow(platformId, "top", row))- .filter(matchesSearch);- return { columns: columns.overview, rows };- }-- function columnsForFocus() {- if (state.view === "storage") return columns.storage;- if (state.view === "recovery") return columns.backups;- return columns.overview;- }-- function segmentedOverviewRows(platforms, includePlatformSections) {- const relationshipMode = true;- const rows = [];- for (const platformId of platforms) {- const platform = data[platformId];- const platformStart = rows.length;- if (includePlatformSections) rows.push(section(platform.label, `${platform.top.length} ${platform.topLabel}`, "platform"));-- for (const top of platform.top) {- appendTopOverviewRows(rows, platformId, top, relationshipMode);- }-- if (includePlatformSections && rows.length === platformStart + 1) rows.splice(platformStart, 1);- }- return { columns: columns.overview, rows };- }-- function appendTopOverviewRows(rows, platformId, top, relationshipMode) {- if (relationshipMode) {- appendRelationshipOverviewRows(rows, platformId, top);- return;- }-- const topRow = normalizeRow(platformId, "top", top);- const lanes = overviewLanes(platformId, top).map((lane) => ({- ...lane,- rows: lane.rows.filter(matchesSearch),- }));- const hasVisibleChildren = lanes.some((lane) => lane.rows.length > 0);- if (state.query && !matchesSearch(topRow) && !hasVisibleChildren) return;-- rows.push(section(top.name, top.info, "top"));- rows.push(topRow);-- for (const lane of lanes) {- if (!lane.rows.length) continue;- rows.push(section(lane.title, lane.meta, `lane lane-${lane.id}`), ...lane.rows);- }- }-- function appendRelationshipOverviewRows(rows, platformId, top) {- const topRow = normalizeRow(platformId, "top", top);- const model = relationshipModel(platformId, top);- const visibleWorkloads = layerEnabled("workload")- ? model.workloads- .map((entry) => visibleWorkloadEntry(entry, layerEnabled("storage"), layerEnabled("recovery")))- .filter(Boolean)- : [];- const visibleHostStorage = layerEnabled("storage") ? visibleRowsForSearch(model.hostStorage) : [];- const visibleHostRecovery = layerEnabled("recovery") ? visibleRowsForSearch(model.hostRecovery) : [];- const hasVisibleChildren = visibleWorkloads.length || visibleHostStorage.length || visibleHostRecovery.length;- if ((state.query || !layerEnabled("top")) && !matchesSearch(topRow) && !hasVisibleChildren) return;-- rows.push(section(top.name, top.info, "top"));- if (layerEnabled("top")) rows.push(topRow);-- if (visibleWorkloads.length) {- rows.push(section("VMs / Containers / Pods", laneMeta(model.workloads.map((entry) => entry.workload), "resource"), "lane lane-workload"));- for (const entry of visibleWorkloads) {- rows.push(entry.workload, ...entry.storage, ...entry.recovery);- }- }-- if (visibleHostStorage.length) {- rows.push(section("System Storage", laneMeta(model.hostStorage, "item"), "lane lane-storage"), ...visibleHostStorage);- }-- if (visibleHostRecovery.length) {- rows.push(section("Backups", laneMeta(model.hostRecovery, "policy"), "lane lane-recovery"), ...visibleHostRecovery);- }- }-- function relationshipModel(platformId, top) {- const platform = data[platformId];- const byTop = (row) => belongsToTop(row, top.name);- const workloads = platform.workloads.filter(byTop).map((row) => normalizeRow(platformId, "workload", row));- const storage = platform.storage.filter(byTop).map((row) => normalizeRow(platformId, "storage", row));- const recovery = platform.backups.map((row) => normalizeRow(platformId, "recovery", row)).filter(byTop);- const assignedStorage = new Set();- const assignedRecovery = new Set();- const workloadEntries = workloads.map((workload) => {- const relatedStorage = storage- .filter((row) => !assignedStorage.has(row) && relatesToWorkload(row, workload))- .map((row) => markRelated(row, "storage"));- relatedStorage.forEach((row) => assignedStorage.add(row.sourceRow));-- const relatedRecovery = recovery- .filter((row) => !assignedRecovery.has(row) && relatesToWorkload(row, workload))- .map((row) => markRelated(row, "backup"));- relatedRecovery.forEach((row) => assignedRecovery.add(row.sourceRow));-- return { workload, storage: relatedStorage, recovery: relatedRecovery };- });-- return {- workloads: workloadEntries,- hostStorage: storage.filter((row) => !assignedStorage.has(row)),- hostRecovery: recovery.filter((row) => !assignedRecovery.has(row)),- };- }-- function visibleWorkloadEntry(entry, includeStorage = true, includeRecovery = true) {- const matchingStorage = includeStorage ? visibleRowsForSearch(entry.storage) : [];- const matchingRecovery = includeRecovery ? visibleRowsForSearch(entry.recovery) : [];- const workloadMatches = matchesSearch(entry.workload);- if (state.query && !workloadMatches && !matchingStorage.length && !matchingRecovery.length) return null;- return {- workload: entry.workload,- storage: state.query && !workloadMatches ? matchingStorage : includeStorage ? entry.storage : [],- recovery: state.query && !workloadMatches ? matchingRecovery : includeRecovery ? entry.recovery : [],- };- }-- function visibleRowsForSearch(rows) {- return state.query ? rows.filter(matchesSearch) : rows;- }-- function markRelated(row, relation) {- return {- ...row,- related: true,- relation,- sourceRow: row,- };- }-- function relatesToWorkload(row, workload) {- const text = [row.name, row.placement, row.info, row.target, row.recovery].join(" ").toLowerCase();- return relationshipKeys(workload).some((key) => text.includes(key));- }-- function relationshipKeys(row) {- const values = [row.name].filter(Boolean).map((value) => String(value).toLowerCase());- const keys = new Set();- const add = (value) => {- const cleaned = String(value || "").trim().toLowerCase();- if (cleaned.length >= 3) keys.add(cleaned);- };- for (const value of values) {- add(value);- value.split(/[\s/:-]+/).forEach(add);- add(value.split(" ")[0]);- add(value.split("/").pop());- }- const vmid = values.join(" ").match(/vmid\s+(\d+)/);- if (vmid) {- add(`vm-${vmid[1]}`);- add(`ct-${vmid[1]}`);- add(vmid[1]);- }- return Array.from(keys).filter((key) => !["pod", "vm", "ct", "lxc", "qemu", "vmid", "container", "deployment", "image", "guest"].includes(key));- }-- function overviewLanes(platformId, top) {- const platform = data[platformId];- const byTop = (row) => belongsToTop(row, top.name);- const workloads = platform.workloads.filter(byTop).map((row) => normalizeRow(platformId, "workload", row));- const storage = platform.storage.filter(byTop).map((row) => normalizeRow(platformId, "storage", row));- const recovery = platform.backups.map((row) => normalizeRow(platformId, "recovery", row)).filter(byTop);- return [- { id: "workload", title: "VMs / Containers / Pods", meta: laneMeta(workloads, "resource"), rows: workloads },- { id: "storage", title: "Storage", meta: laneMeta(storage, "item"), rows: storage },- { id: "recovery", title: "Backups", meta: laneMeta(recovery, "policy"), rows: recovery },- ];- }-- function laneMeta(rows, noun) {- if (rows.length === 1) return `1 ${noun}`;- return `${rows.length} ${noun.endsWith("y") ? `${noun.slice(0, -1)}ies` : `${noun}s`}`;- }-- function platformRows(platformId) {- if (state.view === "overview") return segmentedOverviewRows([platformId], false);- if (state.view === "hosts") return topLevelRows(platformId);- if (state.view === "workloads") return workloadIntentRows(platformId);- if (state.view === "storage") return storageIntentRows(platformId);- if (state.view === "recovery") return recoveryIntentRows(platformId);- if (state.view === "problems") return problemIntentRows(platformId);- return segmentedOverviewRows([platformId], false);- }-- function workloadIntentRows(platformId) {- const rows = [];- for (const top of data[platformId].top) {- const topRow = normalizeRow(platformId, "top", top);- const model = relationshipModel(platformId, top);- const entries = model.workloads- .filter((entry) => workloadMatchesIntent(entry.workload))- .map((entry) => visibleWorkloadEntry(entry, layerEnabled("storage"), layerEnabled("recovery")))- .filter(Boolean);- if (state.query && !matchesSearch(topRow) && !entries.length) continue;-- rows.push(section(top.name, top.info, "top"), topRow);- if (!layerEnabled("top")) rows.pop();- if (!entries.length) continue;- rows.push(section("VMs / Containers / Pods", laneMeta(entries.map((entry) => entry.workload), "resource"), "lane lane-workload"));- for (const entry of entries) rows.push(entry.workload, ...entry.storage, ...entry.recovery);- }- return { columns: columns.overview, rows };- }-- function storageIntentRows(platformId) {- const rows = [];- for (const top of data[platformId].top) {- const topRow = normalizeRow(platformId, "top", top);- const model = relationshipModel(platformId, top);- const guestStorage = model.workloads- .map((entry) => ({- workload: entry.workload,- storage: visibleRowsForSearch(entry.storage.filter(storageMatchesIntent)),- }))- .filter((entry) => entry.storage.length > 0 || (state.query && matchesSearch(entry.workload)));- const hostStorage = visibleRowsForSearch(model.hostStorage.filter(storageMatchesIntent));- if (state.query && !matchesSearch(topRow) && !guestStorage.length && !hostStorage.length) continue;-- rows.push(section(top.name, top.info, "top"), topRow);- if (!layerEnabled("top")) rows.pop();- if (guestStorage.length) {- rows.push(section("Attached Storage", laneMeta(guestStorage.flatMap((entry) => entry.storage), "item"), "lane lane-storage"));- for (const entry of guestStorage) rows.push(...(layerEnabled("workload") ? [entry.workload] : []), ...entry.storage);- }- if (hostStorage.length) rows.push(section("System Storage", laneMeta(hostStorage, "item"), "lane lane-storage"), ...hostStorage);- }- return { columns: columns.storage, rows };- }-- function recoveryIntentRows(platformId) {- const rows = [];- for (const top of data[platformId].top) {- const topRow = normalizeRow(platformId, "top", top);- const model = relationshipModel(platformId, top);- const protectedWorkloads = model.workloads- .map((entry) => ({- workload: entry.workload,- recovery: visibleRowsForSearch(entry.recovery.filter(recoveryMatchesIntent)),- }))- .filter((entry) => entry.recovery.length > 0 || (state.query && matchesSearch(entry.workload)));- const hostRecovery = visibleRowsForSearch(model.hostRecovery.filter(recoveryMatchesIntent));- if (state.query && !matchesSearch(topRow) && !protectedWorkloads.length && !hostRecovery.length) continue;-- rows.push(section(top.name, top.info, "top"), topRow);- if (!layerEnabled("top")) rows.pop();- if (protectedWorkloads.length) {- rows.push(section("Protected VMs / Containers / Pods", laneMeta(protectedWorkloads.flatMap((entry) => entry.recovery), "policy"), "lane lane-recovery"));- for (const entry of protectedWorkloads) rows.push(...(layerEnabled("workload") ? [entry.workload] : []), ...entry.recovery);- }- if (hostRecovery.length) rows.push(section("System Backups", laneMeta(hostRecovery, "policy"), "lane lane-recovery"), ...hostRecovery);- }- return { columns: columns.backups, rows };- }-- function problemIntentRows(platformId) {- const rows = [];- for (const top of data[platformId].top) {- const topRow = normalizeRow(platformId, "top", top);- const model = relationshipModel(platformId, top);- const affectedWorkloads = model.workloads- .map((entry) => {- const relatedProblems = [- ...(layerEnabled("storage") ? entry.storage : []),- ...(layerEnabled("recovery") ? entry.recovery : []),- ].filter(hasProblem);- const includeWorkload = (layerEnabled("workload") && hasProblem(entry.workload)) || relatedProblems.length > 0;- if (!includeWorkload) return null;- return { workload: entry.workload, related: relatedProblems };- })- .filter(Boolean)- .map((entry) => ({- workload: entry.workload,- related: visibleRowsForSearch(entry.related),- }))- .filter((entry) => !state.query || matchesSearch(entry.workload) || entry.related.length > 0);- const hostStorage = layerEnabled("storage") ? visibleRowsForSearch(model.hostStorage.filter(hasProblem)) : [];- const hostRecovery = layerEnabled("recovery") ? visibleRowsForSearch(model.hostRecovery.filter(hasProblem)) : [];- const hasTopProblem = layerEnabled("top") && hasProblem(topRow);- if (state.query && !matchesSearch(topRow) && !affectedWorkloads.length && !hostStorage.length && !hostRecovery.length) continue;- if (!hasTopProblem && !affectedWorkloads.length && !hostStorage.length && !hostRecovery.length) continue;-- rows.push(section(top.name, top.info, "top"), topRow);- if (!layerEnabled("top")) rows.pop();- if (affectedWorkloads.length) {- rows.push(section("Affected VMs / Containers / Pods", laneMeta(affectedWorkloads.map((entry) => entry.workload), "resource"), "lane lane-workload"));- for (const entry of affectedWorkloads) rows.push(...(layerEnabled("workload") ? [entry.workload] : []), ...entry.related);- }- if (hostStorage.length) rows.push(section("System Storage", laneMeta(hostStorage, "item"), "lane lane-storage"), ...hostStorage);- if (hostRecovery.length) rows.push(section("Backups", laneMeta(hostRecovery, "policy"), "lane lane-recovery"), ...hostRecovery);- }- return { columns: columns.overview, rows };- }-- function globalProblemRows() {- const rows = [];- for (const platformId of selectedPlatformIds()) {- const result = problemIntentRows(platformId);- if (!result.rows.length) continue;- rows.push(section(data[platformId].label, `${result.rows.filter((row) => !row.section).length} affected rows`, "platform"), ...result.rows);- }- return { columns: columns.overview, rows };- }-- function workloadMatchesIntent(row) {- return true;- }-- function storageMatchesIntent(row) {- return true;- }-- function recoveryMatchesIntent(row) {- return true;- }-- function belongsToTop(row, topName) {- const rootPlacement = (row.placement || "").split(" / ")[0];- if (rootPlacement === topName) return true;- const text = [row.name, row.target, row.placement, row.info].join(" ").toLowerCase();- return text.includes(topName.toLowerCase());- }-- function recoveryRows() {- const rows = [];- for (const platformId of selectedPlatformIds()) {- const platform = data[platformId];- const backups = platform.backups.map((row) => normalizeRow(platformId, "recovery", row)).filter(matchesSearch);- if (!backups.length) continue;- rows.push(section(platform.label, `${backups.length} policies`, "platform"), ...backups);- }- return { columns: columns.backups, rows };- }-- function metricCell(value) {- if (value === null || value === undefined) return '<span class="subtle">-</span>';- const tone = value >= 90 ? "critical" : value >= 75 ? "warning" : "";- return `- <div class="metric">- <strong>${value}%</strong>- <div class="track"><div class="fill ${tone}" style="width:${Math.max(0, Math.min(100, value))}%"></div></div>- </div>- `;- }-- function signalsCell(row) {- const signals = row.signals || [];- if (!signals.length) return '<span class="subtle">None</span>';- const suffix = signals.length > 1 ? ` +${signals.length - 1}` : "";- return `- <div class="signals">- <span class="signal-count">${signals.length}</span>- <span class="signal-text">${escapeHtml(signals[0])}${suffix}</span>- </div>- `;- }-- function cell(row, col) {- if (col.type === "resource") {- return `- <div class="resource">- <span class="state-dot state-${escapeHtml(row.runtimeState)}" title="${escapeHtml(row.runtimeStateLabel)}"></span>- ${row.relation ? `<span class="relation">${escapeHtml(row.relation)}</span>` : ""}- <span class="name">${escapeHtml(row[col.key] || "")}</span>- </div>- `;- }- if (col.type === "metric") return metricCell(row[col.key]);- if (col.type === "signals") return signalsCell(row);- return escapeHtml(row[col.key] ?? "-");- }-- function escapeHtml(value) {- return String(value)- .replace(/&/g, "&")- .replace(/</g, "<")- .replace(/>/g, ">")- .replace(/"/g, """);- }-- function renderControls() {- ensureViewState();-- document.getElementById("platformButtons").innerHTML = [- `<button class="platform ${state.selectedPlatforms.size === 0 ? "active" : ""}" type="button" data-platform="any">All Platforms</button>`,- ...platformIds().map((id) => `<button class="platform ${state.selectedPlatforms.has(id) ? "active" : ""}" type="button" data-platform="${id}">${data[id].label}</button>`),- ].join("");-- document.getElementById("viewButtons").innerHTML = viewOptions- .map((view) => `<button class="view ${state.view === view.id ? "active" : ""}" type="button" data-view="${view.id}">${view.label}</button>`)- .join("");- }-- function renderTable() {- const result = rowsForScope();- const visibleRows = result.rows;- document.getElementById("cols").innerHTML = result.columns.map((col) => `<col style="width:${col.width}px" />`).join("");- document.getElementById("head").innerHTML = `<tr>${result.columns.map((col) => `<th>${col.label}</th>`).join("")}</tr>`;- document.getElementById("body").innerHTML = visibleRows- .map((row) => {- if (row.section) {- return `- <tr class="section-row ${escapeHtml(row.level || "group")}">- <td colspan="${result.columns.length}">- <div class="section">- <span class="section-mark"></span>- <span class="section-title">${escapeHtml(row.title)}</span>- <span class="section-meta">${escapeHtml(row.meta)}</span>- </div>- </td>- </tr>- `;- }- const classes = [- "data-row",- `row-${escapeHtml(row.runtimeState)}`,- `area-${escapeHtml(row.area || "unknown")}`,- row.related ? "related-row" : "",- ].filter(Boolean).join(" ");- return `<tr class="${classes}">${result.columns.map((col) => `<td>${cell(row, col)}</td>`).join("")}</tr>`;- })- .join("");- document.getElementById("empty").hidden = visibleRows.length > 0;- }-- function renderSummary() {- const rows = platformIds().flatMap(allRows);- document.getElementById("platformCount").textContent = platformIds().length;- document.getElementById("topLevelCount").textContent = platformIds().reduce((count, id) => count + data[id].top.length, 0);- document.getElementById("workloadCount").textContent = platformIds().reduce((count, id) => count + data[id].workloads.length, 0);- document.getElementById("storageCount").textContent = platformIds().reduce((count, id) => count + data[id].storage.length, 0);- document.getElementById("recoveryCount").textContent = platformIds().reduce((count, id) => count + data[id].backups.length, 0);- document.getElementById("attentionCount").textContent = rows.filter(hasProblem).length;- }-- function render() {- renderSummary();- renderControls();- renderTable();- bindControls();- }-- function bindControls() {- document.querySelectorAll(".platform").forEach((button) => {- button.addEventListener("click", () => {- const platform = button.dataset.platform;- if (platform === "any") {- state.selectedPlatforms.clear();- } else if (state.selectedPlatforms.has(platform)) {- state.selectedPlatforms.delete(platform);- } else {- state.selectedPlatforms.add(platform);- }- render();- });- });- document.querySelectorAll(".view").forEach((button) => {- button.addEventListener("click", () => {- applyView(button.dataset.view);- render();- });- });- }-- document.getElementById("resetFilters").addEventListener("click", () => {- resetFilters();- render();- });-- document.getElementById("search").addEventListener("input", (event) => {- state.query = event.currentTarget.value.trim().toLowerCase();- renderTable();- });-- render();- </script>- </body>-</html>diff --git a/docs/prototypes/monitoring-platform-v2/rewrite-proposal.md b/docs/prototypes/monitoring-platform-v2/rewrite-proposal.mddeleted file mode 100644index 357ee92313..0000000000--- a/docs/prototypes/monitoring-platform-v2/rewrite-proposal.md+++ /dev/null@@ -1,84 +0,0 @@-# Monitoring Page Rewrite Proposal--## Status--This is a prototype direction, not a production implementation contract. The real Monitoring page rewrite should wait until the unified resource model can represent the relationships and fields this surface needs without UI-local workarounds.--## Release Gate: No Invented Columns--The Monitoring page must not invent columns, row fields, grouping metadata, or synthetic operational facts in the frontend.--Every visible column must be backed by one of:--- a field already exposed by the canonical unified resource model-- a typed relationship edge exposed by the canonical unified resource model-- a documented metrics-history API contract-- a documented extension to the unified resource model that lands before the UI binds to it--If a proposed column cannot be mapped to one of those sources, it does not ship in the production Monitoring page. It can appear in prototype notes only if it is explicitly marked as a required model extension.--## Required Relationship Contract--`ParentID` remains the primary nesting spine for the default tree view, but it is not enough for Monitoring. The production page needs a queryable typed-edge graph so resources can participate in multiple real relationships without forcing the UI to pick one misleading parent.--The relationship contract should expose closed-enum roles. The initial Monitoring-required enum must include:--- `runs_on`-- `contains`-- `uses_storage`-- `backed_up_by`-- `member_of`-- `replicates_to`-- `depends_on`--Adding a role should be treated as a contract change, not a frontend convention. Both directions need to be queryable, so a backup job can answer "what does this protect?" and a VM can answer "what protects me?" from the same canonical graph.--## Required Model Work Before Rewrite--1. Typed resource relationship edges with the role enum above and reverse lookup support.-2. First-class cluster resources for platform-level state across Proxmox, Kubernetes, vSphere, Ceph, and equivalent cluster-capable sources.-3. Metrics-history API schema for row trends, detail drawers, storage growth, and anomaly context.-4. First-class liveness fields separate from incidental `LastSeen`.-5. Backup/protection fields for target, last run, verification state, and protected-resource linkage.--## Prototype Field Mapping--The current v2 prototype should be read through this mapping:--- `Resource`: canonical identity display name-- `Kind`: canonical resource type-- `Info`: compact source-backed facet summary, not product narration-- resource state indicator: shown directly before the resource name, derived from first-class liveness plus health state. `On` is green, `Off` is red, and `Issue` is yellow.-- `CPU`, `Memory`, `Disk`: latest resource metrics, with history supplied by the metrics API later-- `Backup`: canonical backup/protection posture-- `Signals`: incidents, alerts, or canonical health signals-- `Placement`: `ParentID` plus typed edges such as `runs_on`, `member_of`, or `contains`-- `Target`: typed recovery/replication target via `backed_up_by` or `replicates_to`-- `Last Run`, `Verification`: recovery/protection model fields--## Platform Rule--The rewrite must not bias one platform. Proxmox, Docker, Kubernetes, TrueNAS, vSphere, and future first-class platforms should all project into the same Monitoring primitives: identity, type, status, metrics, typed relationships, liveness, storage, backup/protection state, and health signals.--## Layout Rule--The Monitoring page should keep one platform selection model. Do not split platform choice into duplicate concepts that both mean "which estate am I looking at?"--The UI vocabulary should be literal resource vocabulary, not abstract architecture vocabulary and not inherited page names. Use words that tell the operator what rows they will see:--- `All resources` for the full relationship-preserving table.-- `Hosts & clusters` for top-level systems, appliances, and equivalent source roots.-- `VMs / containers / pods` for runtime units.-- `Storage` for disks, pools, datastores, volumes, PVCs, datasets, and mounted storage.-- `Backups` for backups, replication, snapshots, restore verification, and protected-resource state.-- `Problems` for incident-led triage.--The default surface should remain a dense, segmented table. Visual grouping should come from canonical resource structure and typed relationships: platform, primary host or cluster, then operational lanes such as VMs/containers/pods, storage, and backups. If those relationships are not available from the unified resource model, the production UI should wait for the model contract rather than inventing a frontend-only hierarchy.--When a platform is selected, the primary layout should become relationship-first rather than type-first. A user looking at a host should see the VMs, containers, or pods running on that host, and any attached storage, network devices, backup jobs, snapshot jobs, replication jobs, or backup status should appear under the resource they belong to. Type filters can narrow the view, but they must not be the main organizing principle because they separate related resources and force the user to reconstruct the topology mentally.--Each filter state should be treated as a monitoring intent with its own view model. All resources should emphasize estate topology. VMs/containers/pods should emphasize runtime units and their attachments. Storage should emphasize ownership and attachment points. Backups should emphasize protected resources, backup jobs, replication, snapshots, and verification state. Problems should preserve enough context to explain what is affected. A single generic grouping algorithm is not sufficient.--Users should also be able to change the density of the page without learning a second control model. The Monitoring surface should use one `Show` row with concrete resource filters such as `All resources`, `Hosts & clusters`, `VMs / containers / pods`, `Storage`, `Backups`, and `Problems`.--The filter controls should be preset-first, not combination-first. Platform selection answers "which estate am I looking at?" and Show answers "which resource rows should I see?" Each option owns its hierarchy and row mix, so operators do not need to combine abstract density modes with layer toggles. A reset control should always return to the neutral All resources / All Platforms state.diff --git a/docs/prototypes/monitoring-platform/index.html b/docs/prototypes/monitoring-platform/index.htmldeleted file mode 100644index c844923342..0000000000--- a/docs/prototypes/monitoring-platform/index.html+++ /dev/null@@ -1,1160 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Pulse Monitoring Prototype</title>- <style>- :root {- --bg: #0d1627;- --surface: #172236;- --surface-soft: #24334b;- --surface-row: #18243a;- --line: #33445d;- --text: #e8eef8;- --muted: #9aa8bd;- --blue: #5aa2ff;- --green: #36c275;- --amber: #f2b84b;- --red: #ef6f61;- --purple: #a78bfa;- --cyan: #22d3ee;- --slate: #94a3b8;- }-- * {- box-sizing: border-box;- }-- body {- margin: 0;- background: var(--bg);- color: var(--text);- font: 12px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;- }-- button,- input {- font: inherit;- }-- button {- border: 1px solid var(--line);- background: var(--surface);- color: var(--text);- border-radius: 4px;- padding: 5px 9px;- cursor: pointer;- }-- button:hover,- button.active {- border-color: var(--blue);- background: #123159;- color: var(--blue);- }-- .page {- max-width: 1700px;- margin: 0 auto;- padding: 12px;- }-- .header {- display: flex;- justify-content: space-between;- gap: 14px;- margin-bottom: 8px;- }-- h1,- p {- margin: 0;- }-- h1 {- font-size: 21px;- letter-spacing: 0;- }-- .subtitle {- margin-top: 3px;- color: var(--muted);- }-- .summary {- display: grid;- grid-template-columns: repeat(6, minmax(130px, 1fr));- gap: 8px;- margin-bottom: 8px;- }-- .card {- background: var(--surface);- border: 1px solid var(--line);- border-radius: 6px;- box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);- }-- .summary-card {- padding: 7px 10px;- }-- .label {- color: var(--muted);- font-size: 11px;- }-- .big-number {- display: flex;- align-items: baseline;- gap: 6px;- margin-top: 3px;- font-size: 20px;- font-weight: 750;- }-- .note {- color: var(--muted);- font-size: 11px;- }-- .toolbar {- display: grid;- gap: 6px;- padding: 8px;- margin-bottom: 8px;- }-- .toolbar input {- border: 1px solid var(--line);- border-radius: 4px;- padding: 6px 9px;- width: 100%;- background: #111c2f;- color: var(--text);- }-- .filter-row {- display: flex;- align-items: center;- gap: 7px;- flex-wrap: wrap;- }-- .filter-label {- width: 72px;- color: var(--muted);- font-size: 10px;- font-weight: 700;- text-transform: uppercase;- }-- .filter-buttons {- display: flex;- align-items: center;- gap: 6px;- flex-wrap: wrap;- }-- .table-card {- overflow: hidden;- }-- .table-wrap {- overflow: auto;- }-- table {- width: 100%;- min-width: 1540px;- border-collapse: collapse;- table-layout: fixed;- }-- th,- td {- border-bottom: 1px solid var(--line);- height: 25px;- padding: 3px 8px;- vertical-align: middle;- text-align: left;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }-- th {- position: sticky;- top: 0;- z-index: 2;- background: var(--surface-soft);- color: var(--muted);- font-size: 11px;- text-transform: uppercase;- letter-spacing: 0;- }-- tbody tr {- background: var(--surface-row);- }-- tbody tr:hover {- background: #203454;- }-- tr[data-domain="host"] {- --domain-color: #6f9dd7;- --domain-soft: #17263d;- --domain-mid: #43546c;- --domain-text: var(--text);- }-- tr[data-domain="workload"] {- --domain-color: #8a96a8;- --domain-soft: #202a3a;- --domain-mid: #43546c;- --domain-text: var(--text);- }-- tr[data-domain="storage"] {- --domain-color: #8a96a8;- --domain-soft: #202a3a;- --domain-mid: #43546c;- --domain-text: var(--text);- }-- tr[data-domain="recovery"] {- --domain-color: #8a96a8;- --domain-soft: #202a3a;- --domain-mid: #43546c;- --domain-text: var(--text);- }-- tr.host-row {- background: #17263d;- }-- tr.host-row td {- height: 40px;- padding-top: 6px;- padding-bottom: 6px;- border-top: 2px solid #42536a;- }-- tr.group-row {- background: #202a3a;- }-- tr.group-row td {- height: 30px;- border-top: 1px solid #43546c;- border-bottom-color: #43546c;- }-- tr.leaf-row[data-domain="workload"],- tr.leaf-row[data-domain="storage"],- tr.leaf-row[data-domain="recovery"] {- background: var(--surface-row);- }-- tr.leaf-row td {- height: 23px;- padding-top: 2px;- padding-bottom: 2px;- font-size: 11px;- }-- tr.context-row {- opacity: 0.48;- }-- tr.context-row.host-row td {- height: 30px;- }-- tr.context-row.group-row td,- tr.context-row.leaf-row td {- height: 22px;- }-- tr.focus-row {- background: #20304a;- }-- tr.focus-row td {- height: 34px;- border-top-color: #4b617c;- }-- .resource-cell {- display: grid;- grid-template-columns: 5px minmax(0, 1fr);- align-items: center;- gap: 7px;- min-width: 0;- }-- .rail {- width: 3px;- height: 16px;- border-radius: 4px;- background: var(--domain-color);- }-- .host-row .rail {- width: 4px;- height: 27px;- }-- .group-row .rail {- width: 4px;- height: 20px;- }-- .depth-1 .rail {- width: 4px;- height: 20px;- }-- .depth-2 .rail {- width: 3px;- height: 13px;- opacity: 0.82;- }-- .resource-main {- min-width: 0;- }-- .resource-line {- display: flex;- align-items: center;- gap: 7px;- min-width: 0;- }-- .name {- font-weight: 700;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }-- .host-row .name {- font-size: 14px;- }-- .group-row .name {- font-size: 12px;- color: var(--domain-text);- text-transform: uppercase;- }-- .leaf-row .name {- font-size: 11px;- font-weight: 650;- }-- .focus-row .name {- font-size: 13px;- font-weight: 750;- }-- .focus-row .rail {- width: 4px;- height: 22px;- }-- .focus-row.host-row .name {- font-size: 15px;- }-- .meta {- color: var(--muted);- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }-- .indent-0 {- padding-left: 0;- }-- .indent-1 {- padding-left: 18px;- }-- .indent-2 {- padding-left: 38px;- }-- .pill {- display: inline-flex;- align-items: center;- gap: 5px;- border: 1px solid var(--line);- border-radius: 4px;- padding: 1px 5px;- font-size: 9px;- line-height: 1.15;- white-space: nowrap;- }-- .host-row .pill,- .focus-row .pill {- font-size: 10px;- }-- .platform-label {- display: inline-block;- margin-left: 4px;- color: var(--muted);- font-size: 10px;- font-weight: 650;- text-transform: uppercase;- }-- .host {- color: #b9c8dd;- background: #1a273b;- border-color: #3b4b63;- }-- .workload {- color: #b9c8dd;- background: #1a273b;- border-color: #3b4b63;- }-- .storage {- color: #b9c8dd;- background: #1a273b;- border-color: #3b4b63;- }-- .recovery {- color: #b9c8dd;- background: #1a273b;- border-color: #3b4b63;- }-- .ok {- color: var(--green);- background: #0e3523;- border-color: #23764d;- }-- .warning {- color: var(--amber);- background: #3a2c12;- border-color: #8a6419;- }-- .critical {- color: var(--red);- background: #44201d;- border-color: #9c3c34;- }-- .metric {- display: grid;- grid-template-columns: 31px minmax(0, 1fr);- align-items: center;- gap: 5px;- min-width: 0;- }-- .metric-label {- margin-bottom: 0;- font-size: 11px;- font-weight: 650;- }-- .track {- height: 5px;- border-radius: 2px;- background: #2d3b51;- overflow: hidden;- }-- .host-row .track,- .focus-row .track {- height: 7px;- }-- .fill {- height: 100%;- border-radius: inherit;- background: var(--green);- }-- .fill.warning {- background: var(--amber);- }-- .fill.critical {- background: var(--red);- }-- .rollup-grid {- display: flex;- align-items: center;- gap: 5px;- }-- .rollup {- border: 1px solid var(--line);- border-radius: 4px;- padding: 1px 4px;- background: #111c2f;- white-space: nowrap;- }-- .rollup strong {- font-size: 11px;- }-- .rollup span {- color: var(--muted);- font-size: 9px;- }-- .signals {- display: flex;- flex-wrap: nowrap;- align-items: center;- gap: 5px;- max-width: 100%;- overflow: hidden;- }-- .signal {- display: block;- max-width: 168px;- overflow: hidden;- text-overflow: ellipsis;- color: #c6d0df;- font-size: 11px;- white-space: nowrap;- }-- .signal-count {- display: inline-flex;- align-items: center;- justify-content: center;- min-width: 16px;- height: 15px;- border-radius: 3px;- background: #2a3446;- color: #d8e1ee;- font-size: 10px;- font-weight: 700;- }-- .change {- color: var(--muted);- max-width: 100%;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }-- tr.context-row .rail {- background: #5c6878;- }-- tr.context-row .pill,- tr.context-row .signal-count {- color: #8794a6;- background: #1d2735;- border-color: #334257;- }-- tr.context-row .platform-label,- tr.context-row .meta,- tr.context-row .metric-label,- tr.context-row .signal,- tr.context-row .change {- color: #788699;- }-- tr.context-row .track {- background: #273244;- }-- tr.context-row .fill,- tr.context-row .fill.warning,- tr.context-row .fill.critical {- background: #657184;- }-- .empty-state {- padding: 26px;- text-align: center;- color: var(--muted);- }-- @media (max-width: 1100px) {- .summary {- grid-template-columns: repeat(3, minmax(0, 1fr));- }- }-- @media (max-width: 700px) {- .page {- padding: 14px;- }-- .header {- flex-direction: column;- }-- .summary {- grid-template-columns: repeat(2, minmax(0, 1fr));- }-- .toolbar input {- width: 100%;- }-- .filter-row {- align-items: flex-start;- }-- .filter-label {- width: 100%;- }- }- </style>- </head>- <body>- <main class="page">- <header class="header">- <div>- <h1>Monitoring</h1>- <p class="subtitle">Everything is visible by default: hosts, child workloads, storage, recovery posture, and active signals in one scan-first hierarchy.</p>- </div>- <button id="simulateIncident" type="button">Simulate disk incident</button>- </header>-- <section class="summary" aria-label="Monitoring summary">- <article class="card summary-card">- <div class="label">Hosts</div>- <div class="big-number"><span id="hostCount">0</span><span class="note">top level</span></div>- </article>- <article class="card summary-card">- <div class="label">Resources</div>- <div class="big-number"><span id="resourceCount">0</span><span class="note">visible rows</span></div>- </article>- <article class="card summary-card">- <div class="label">Needs Attention</div>- <div class="big-number"><span id="signalCount">0</span><span class="note">resources</span></div>- </article>- <article class="card summary-card">- <div class="label">Workloads</div>- <div class="big-number"><span id="workloadCount">0</span><span class="note">VMs, CTs, pods</span></div>- </article>- <article class="card summary-card">- <div class="label">Capacity Risk</div>- <div class="big-number"><span id="capacityRiskCount">0</span><span class="note">storage items</span></div>- </article>- <article class="card summary-card">- <div class="label">Recovery Gaps</div>- <div class="big-number"><span id="recoveryGapCount">0</span><span class="note">items</span></div>- </article>- </section>-- <section class="card toolbar" aria-label="Monitoring filters">- <input id="search" type="search" placeholder="Search host, platform, VM, container, pod, pool, disk, backup job..." />- <div class="filter-row">- <span class="filter-label">Layer</span>- <div class="filter-buttons">- <button class="view active" type="button" data-view="all" aria-pressed="true">All</button>- <button class="view" type="button" data-view="host" aria-pressed="false">Hosts</button>- <button class="view" type="button" data-view="workload" aria-pressed="false">Workloads</button>- <button class="view" type="button" data-view="storage" aria-pressed="false">Storage</button>- <button class="view" type="button" data-view="recovery" aria-pressed="false">Recovery</button>- <button class="view" type="button" data-view="problems" aria-pressed="false">Problems</button>- </div>- </div>- <div class="filter-row">- <span class="filter-label">Platform</span>- <div class="filter-buttons">- <button class="platform active" type="button" data-platform="any">Any</button>- <button class="platform" type="button" data-platform="proxmox">Proxmox</button>- <button class="platform" type="button" data-platform="docker">Docker</button>- <button class="platform" type="button" data-platform="kubernetes">Kubernetes</button>- <button class="platform" type="button" data-platform="truenas">TrueNAS</button>- <button class="platform" type="button" data-platform="vsphere">vSphere</button>- </div>- </div>- <div class="filter-row">- <span class="filter-label">Type</span>- <div class="filter-buttons">- <button class="type active" type="button" data-type="any">Any</button>- <button class="type" type="button" data-type="vm">VMs</button>- <button class="type" type="button" data-type="container">Containers</button>- <button class="type" type="button" data-type="pod">Pods</button>- <button class="type" type="button" data-type="disk">Disks</button>- <button class="type" type="button" data-type="pool">Pools</button>- <button class="type" type="button" data-type="backup">Backups</button>- </div>- </div>- </section>-- <article class="card table-card">- <div class="table-wrap">- <table>- <colgroup>- <col style="width: 210px" />- <col style="width: 130px" />- <col style="width: 210px" />- <col style="width: 78px" />- <col style="width: 104px" />- <col style="width: 104px" />- <col style="width: 104px" />- <col style="width: 150px" />- <col style="width: 84px" />- <col style="width: 230px" />- <col style="width: 236px" />- </colgroup>- <thead>- <tr>- <th>Resource</th>- <th>Platform / Kind</th>- <th>Info</th>- <th>Status</th>- <th>CPU</th>- <th>Memory</th>- <th>Disk</th>- <th>Children</th>- <th>Recovery</th>- <th>Signals</th>- <th>Recent Change</th>- </tr>- </thead>- <tbody id="rows"></tbody>- </table>- <div id="empty" class="empty-state" hidden>No resources match this view.</div>- </div>- </article>- </main>-- <script>- const tree = [- host("pve-a", "pve-a", "Proxmox host / cluster lab-pve", "proxmox", "critical", 86, 77, 94, "Stale", ["Root disk above 90%", "3 child resources affected"], ["local-zfs crossed critical threshold 11 minutes ago", "Kernel update waiting for reboot"], [- group("pve-a-workloads", "Workloads", "VMs and containers on pve-a", "workload", [- item("vm-pulse-db", "vm-210 pulse-db", "Postgres primary", "workload", "VM", "critical", 71, 93, 81, "Stale", ["Memory pressure", "Backup missed 2 runs"], ["Memory rose 18% over 24h"]),- item("vm-grafana", "vm-214 grafana", "Observability", "workload", "VM", "ok", 22, 41, 38, "Protected", [], ["Backup verified 02:12"]),- item("ct-redis", "ct-117 redis-cache", "LXC cache tier", "workload", "Container", "warning", 47, 78, 61, "Protected", ["Restarted 4 times in 6h"], ["Restart loop stopped 18 minutes ago"]),- ]),- group("pve-a-storage", "Storage", "Pools, volumes, and physical disks owned by pve-a", "storage", [- item("pool-local-zfs", "local-zfs", "ZFS pool", "storage", "Pool", "critical", null, null, 94, "N/A", ["Free space below 8%", "Snapshots growing faster than pruning"], ["Capacity rose 6% today"]),- item("disk-nvme0", "nvme0n1", "Samsung 970 EVO", "storage", "Disk", "warning", null, null, 88, "N/A", ["Temperature 69 C", "SMART warning count increased"], ["SMART media error count changed"]),- ]),- group("pve-a-recovery", "Recovery", "Backup and restore coverage for pve-a", "recovery", [- item("pbs-job-pve-a", "nightly-pve-a", "PBS job", "recovery", "Backup Job", "critical", null, null, null, "Missed", ["Last successful backup 38h ago"], ["Job failed after datastore timeout"]),- ]),- ]),- host("pve-b", "pve-b", "Proxmox host / cluster lab-pve", "proxmox", "ok", 38, 62, 70, "Protected", [], ["Ceph placement groups clean"], [- group("pve-b-workloads", "Workloads", "VMs and containers on pve-b", "workload", [- item("vm-homeassistant", "vm-104 home-assistant", "Automation", "workload", "VM", "ok", 12, 36, 44, "Protected", [], ["Backup verified 02:10"]),- item("ct-nginx", "ct-130 nginx-edge", "Reverse proxy", "workload", "Container", "warning", 64, 55, 47, "Protected", ["TLS certificate expires in 9 days"], ["New public route added"]),- ]),- group("pve-b-storage", "Storage", "Ceph and local storage", "storage", [- item("pool-ceph-fast", "ceph-fast", "Replicated SSD pool", "storage", "Pool", "ok", null, null, 63, "N/A", [], ["Placement groups clean"]),- ]),- group("pve-b-recovery", "Recovery", "PBS coverage", "recovery", [- item("pbs-job-pve-b", "nightly-pve-b", "PBS job", "recovery", "Backup Job", "ok", null, null, null, "Protected", [], ["Restore point verified overnight"]),- ]),- ]),- host("core-nas-01", "core-nas-01", "TrueNAS host / primary storage", "truenas", "warning", 31, 68, 79, "Protected", ["One disk has SMART pre-fail attribute"], ["Replication lag reduced to 14 minutes"], [- group("nas-storage", "Storage", "Pools, datasets, and physical disks", "storage", [- item("pool-tank", "tank", "Main ZFS pool", "storage", "Pool", "warning", null, null, 79, "Snapshots", ["One mirror member is degrading"], ["Scrub completed with 1 repaired block"]),- item("dataset-media", "tank/media", "Media dataset", "storage", "Dataset", "ok", null, null, 74, "Snapshots", [], ["Snapshot policy retained 31 points"]),- item("disk-sda", "sda", "8 TB Seagate", "storage", "Disk", "critical", null, null, 81, "N/A", ["SMART pre-fail attribute changed", "Replacement recommended"], ["Reallocated sector count increased"]),- ]),- group("nas-recovery", "Recovery", "Snapshot and replication posture", "recovery", [- item("replication-offsite", "offsite-replication", "TrueNAS replication", "recovery", "Replication", "ok", null, null, null, "Current", [], ["Last transfer completed 14 minutes ago"]),- ]),- ]),- host("edge-k8s", "edge-k8s", "Kubernetes cluster", "kubernetes", "warning", 58, 74, 66, "Partial", ["One namespace has degraded pods"], ["Deployment rollout paused by policy"], [- group("k8s-workloads", "Workloads", "Pods, deployments, and services", "workload", [- item("deploy-api", "deployment/api", "production namespace", "workload", "Deployment", "warning", 74, 82, null, "Manifest", ["2 pods not ready"], ["Rollout paused after readiness failures"]),- item("pod-api-7d9", "pod/api-7d9c8", "production/api", "workload", "Pod", "critical", 91, 89, null, "Ephemeral", ["CrashLoopBackOff", "CPU throttling"], ["Restarted 12 times"]),- ]),- group("k8s-storage", "Storage", "PVC and storage class health", "storage", [- item("pvc-api-data", "pvc/api-data", "production namespace", "storage", "Volume", "ok", null, null, 52, "Snapshot", [], ["Expanded from 100 GB to 150 GB"]),- ]),- group("k8s-recovery", "Recovery", "Cluster backup and policy status", "recovery", [- item("velero-prod", "velero-production", "Namespace backup policy", "recovery", "Backup Job", "warning", null, null, null, "Partial", ["One PVC snapshot skipped"], ["Policy changed to include secrets"]),- ]),- ]),- host("vsphere-lab", "vsphere-lab", "VMware vSphere cluster / first-lab-ready", "vsphere", "warning", 46, 67, 58, "Partial", ["vCenter proof pending deeper recovery coverage"], ["New vSphere inventory discovered 22 minutes ago"], [- group("vsphere-workloads", "Workloads", "vSphere virtual machines", "workload", [- item("vmware-vm-ad", "vmware/ad-01", "Directory services", "workload", "VM", "ok", 29, 57, 46, "Protected", [], ["Guest tools heartbeat current"]),- item("vmware-vm-files", "vmware/files-02", "File service", "workload", "VM", "warning", 67, 73, 72, "Partial", ["Snapshot policy not confirmed"], ["Datastore latency rose 9 minutes ago"]),- ]),- group("vsphere-storage", "Storage", "Datastores and VMFS capacity", "storage", [- item("datastore-fast-01", "datastore-fast-01", "VMFS datastore", "storage", "Datastore", "warning", null, null, 76, "N/A", ["Capacity trend above normal"], ["Datastore latency rose 9 minutes ago"]),- ]),- group("vsphere-recovery", "Recovery", "vSphere backup and restore posture", "recovery", [- item("veeam-vsphere", "veeam-vsphere-nightly", "vSphere backup job", "recovery", "Backup Job", "warning", null, null, null, "Partial", ["Restore verification not yet exercised"], ["Last backup completed with warnings"]),- ]),- ]),- host("docker-host-01", "docker-host-01", "Agent host / Docker", "docker", "ok", 24, 45, 57, "Protected", [], ["Agent upgraded to 6.0.0-rc"], [- group("docker-workloads", "Workloads", "Docker containers", "workload", [- item("container-immich", "container/immich", "Photo service", "workload", "Container", "ok", 33, 66, 58, "Protected", [], ["Image updated 3 days ago"]),- item("container-paperless", "container/paperless", "Document service", "workload", "Container", "ok", 17, 52, 49, "Protected", [], ["No drift detected"]),- ]),- group("docker-storage", "Storage", "Volumes and disk usage", "storage", [- item("volume-immich-library", "volume/immich-library", "Local Docker volume", "storage", "Volume", "warning", null, null, 83, "Protected", ["Projected to fill in 18 days"], ["Growth trend increased this week"]),- ]),- group("docker-recovery", "Recovery", "Container backup jobs", "recovery", [- item("restic-docker", "restic-docker-volumes", "Volume backup job", "recovery", "Backup Job", "ok", null, null, null, "Protected", [], ["Last backup completed 03:40"]),- ]),- ]),- ];-- assignInheritedPlatforms(tree);-- const selectedViews = new Set();- let platformView = "any";- let typeView = "any";- let query = "";-- function host(id, name, subtitle, platform, status, cpu, memory, disk, recovery, signals, changes, children) {- return { id, name, subtitle, platform, domain: "host", kind: "Host", status, cpu, memory, disk, recovery, signals, changes, children };- }-- function group(id, name, subtitle, domain, children) {- return {- id,- name,- subtitle,- domain,- kind: "Group",- status: worstStatus(children),- cpu: null,- memory: null,- disk: null,- recovery: "",- signals: children.flatMap((child) => child.signals || []),- changes: children.flatMap((child) => child.changes || []).slice(0, 2),- children,- isGroup: true,- };- }-- function item(id, name, subtitle, domain, kind, status, cpu, memory, disk, recovery, signals, changes) {- return { id, name, subtitle, domain, kind, status, cpu, memory, disk, recovery, signals, changes, children: [] };- }-- function assignInheritedPlatforms(nodes, inheritedPlatform = null) {- for (const node of nodes) {- node.platform = node.platform || inheritedPlatform || "unknown";- assignInheritedPlatforms(node.children || [], node.platform);- }- }-- function rank(status) {- return status === "critical" ? 3 : status === "warning" ? 2 : status === "ok" ? 1 : 0;- }-- function worstStatus(items) {- return items.reduce((worst, item) => (rank(item.status) > rank(worst) ? item.status : worst), "ok");- }-- function walk(nodes, callback, parents = []) {- for (const node of nodes) {- callback(node, parents);- if (node.children && node.children.length) walk(node.children, callback, parents.concat(node));- }- }-- function descendants(node) {- const result = [];- walk(node.children || [], (child) => result.push(child));- return result;- }-- function hasSignal(node) {- return (node.signals || []).length > 0;- }-- function hasMatchingDescendant(node, predicate) {- return (node.children || []).some((child) => predicate(child) || hasMatchingDescendant(child, predicate));- }-- function searchText(node) {- return [node.name, node.subtitle, node.platform, node.kind, node.domain, node.status, node.recovery, ...(node.signals || []), ...(node.changes || [])]- .join(" ")- .toLowerCase();- }-- function ownMatchesSearch(node) {- return !query || searchText(node).includes(query);- }-- function matchesSearchContext(node) {- return ownMatchesSearch(node) || hasMatchingDescendant(node, ownMatchesSearch);- }-- function hasLayerFocus() {- return selectedViews.size > 0;- }-- function ownMatchesView(node) {- if (!hasLayerFocus()) return true;- return selectedViews.has(node.domain) || (selectedViews.has("problems") && hasSignal(node));- }-- function matchesViewContext(node) {- return ownMatchesView(node) || hasMatchingDescendant(node, ownMatchesView);- }-- function normalizedKind(node) {- return String(node.kind || "").toLowerCase().replace(/\\s+/g, "-");- }-- function ownMatchesPlatform(node) {- if (platformView === "any") return true;- if (["proxmox", "docker", "kubernetes", "truenas", "vsphere"].includes(platformView)) {- return node.platform === platformView;- }- return false;- }-- function matchesPlatformContext(node) {- return ownMatchesPlatform(node) || hasMatchingDescendant(node, ownMatchesPlatform);- }-- function ownMatchesType(node) {- if (typeView === "any") return true;- if (typeView === "vm") return node.kind === "VM";- if (typeView === "container") return node.kind === "Container";- if (typeView === "pod") return node.kind === "Pod";- if (typeView === "disk") return node.kind === "Disk";- if (typeView === "pool") return node.kind === "Pool";- if (typeView === "backup") return ["Backup Job", "Replication"].includes(node.kind);- return normalizedKind(node) === typeView;- }-- function matchesTypeContext(node) {- return ownMatchesType(node) || hasMatchingDescendant(node, ownMatchesType);- }-- function visibleRows(nodes, depth = 0, output = []) {- for (const node of nodes) {- if (!matchesSearchContext(node) || !matchesViewContext(node) || !matchesPlatformContext(node) || !matchesTypeContext(node)) continue;- const contextOnly = !ownMatchesView(node) || !ownMatchesPlatform(node) || !ownMatchesType(node) || !ownMatchesSearch(node);- output.push({ node, depth, contextOnly });- visibleRows(node.children || [], depth + 1, output);- }- return output;- }-- function escapeHtml(value) {- return String(value)- .replace(/&/g, "&")- .replace(/</g, "<")- .replace(/>/g, ">")- .replace(/"/g, """);- }-- function metric(value, label) {- if (value === null || value === undefined) return '<span class="note">-</span>';- const tone = value >= 90 ? "critical" : value >= 75 ? "warning" : "";- return `- <div class="metric" aria-label="${label} ${value}%">- <div class="metric-label"><span>${value}%</span></div>- <div class="track"><div class="fill ${tone}" style="width:${Math.max(0, Math.min(100, value))}%"></div></div>- </div>- `;- }-- function signalCell(node) {- if (!hasSignal(node)) return '<span class="note">None</span>';- const suffix = node.signals.length > 1 ? ` +${node.signals.length - 1}` : "";- return `- <div class="signals">- <span class="signal-count">${node.signals.length}</span>- <span class="signal">${escapeHtml(node.signals[0])}${suffix}</span>- </div>- `;- }-- function platformLabel(platform) {- const labels = {- proxmox: "Proxmox",- docker: "Docker",- kubernetes: "Kubernetes",- truenas: "TrueNAS",- vsphere: "vSphere",- };- return labels[platform] || platform || "Unknown";- }-- function childRollup(node) {- const all = descendants(node).filter((child) => !child.isGroup);- if (!all.length) return '<span class="note">-</span>';- const workloads = all.filter((child) => child.domain === "workload").length;- const storage = all.filter((child) => child.domain === "storage").length;- const recovery = all.filter((child) => child.domain === "recovery").length;- return `- <div class="rollup-grid">- <div class="rollup"><strong>${workloads}</strong><span> work</span></div>- <div class="rollup"><strong>${storage}</strong><span> store</span></div>- <div class="rollup"><strong>${recovery}</strong><span> rec</span></div>- </div>- `;- }-- function groupCount(node) {- const leaves = descendants(node).filter((child) => !child.isGroup);- return leaves.length ? `<span class="note">${leaves.length} rows</span>` : '<span class="note">-</span>';- }-- function childrenCell(node) {- if (node.domain === "host") return childRollup(node);- if (node.isGroup) return groupCount(node);- return '<span class="note">-</span>';- }-- function rowClass(node) {- if (node.domain === "host") return "host-row";- if (node.isGroup) return "group-row";- return "leaf-row";- }-- function domainPillClass(node) {- return node.domain === "host" ? "host" : node.domain;- }-- function kindCell(node) {- return `- <span class="pill ${domainPillClass(node)}">${escapeHtml(node.kind)}</span>- <span class="platform-label">${escapeHtml(platformLabel(node.platform))}</span>- `;- }-- function renderRows() {- const rows = visibleRows(tree);- const hasActiveFocus = hasLayerFocus() || platformView !== "any" || typeView !== "any" || query !== "";- document.getElementById("rows").innerHTML = rows- .map(({ node, depth, contextOnly }) => {- const rowClasses = [rowClass(node), contextOnly ? "context-row" : "", hasActiveFocus && !contextOnly ? "focus-row" : ""].filter(Boolean).join(" ");- const indentClass = `indent-${Math.min(depth, 2)}`;- const depthClass = `depth-${Math.min(depth, 2)}`;- return `- <tr class="${rowClasses}" data-id="${node.id}" data-domain="${node.domain}" data-platform="${node.platform}">- <td>- <div class="resource-cell ${indentClass} ${depthClass}">- <span class="rail"></span>- <div class="resource-main">- <div class="resource-line">- <span class="name">${escapeHtml(node.name)}</span>- </div>- </div>- </div>- </td>- <td>${kindCell(node)}</td>- <td><div class="meta">${escapeHtml(node.subtitle || "")}</div></td>- <td><span class="pill ${node.status}">${escapeHtml(node.status)}</span></td>- <td>${metric(node.cpu, "CPU")}</td>- <td>${metric(node.memory, "Memory")}</td>- <td>${metric(node.disk, "Disk")}</td>- <td>${childrenCell(node)}</td>- <td>${escapeHtml(node.recovery || "-")}</td>- <td>${signalCell(node)}</td>- <td><div class="change">${escapeHtml((node.changes || [])[0] || "No recent change")}</div></td>- </tr>- `;- })- .join("");- document.getElementById("empty").hidden = rows.length > 0;- }-- function renderSummary() {- const nodes = [];- walk(tree, (node) => {- if (!node.isGroup) nodes.push(node);- });- document.getElementById("hostCount").textContent = tree.length;- document.getElementById("resourceCount").textContent = nodes.length;- document.getElementById("signalCount").textContent = nodes.filter(hasSignal).length;- document.getElementById("workloadCount").textContent = nodes.filter((node) => node.domain === "workload").length;- document.getElementById("capacityRiskCount").textContent = nodes.filter((node) => node.domain === "storage" && (node.disk || 0) >= 75).length;- document.getElementById("recoveryGapCount").textContent = nodes.filter((node) => ["Stale", "Missed", "Partial"].includes(node.recovery)).length;- }-- function render() {- renderSummary();- renderRows();- }-- document.getElementById("search").addEventListener("input", (event) => {- query = event.currentTarget.value.trim().toLowerCase();- render();- });-- document.querySelectorAll(".view").forEach((button) => {- button.addEventListener("click", () => {- const nextView = button.getAttribute("data-view");- if (nextView === "all") {- selectedViews.clear();- } else if (selectedViews.has(nextView)) {- selectedViews.delete(nextView);- } else {- selectedViews.add(nextView);- }- syncLayerButtons();- render();- });- });-- function syncLayerButtons() {- document.querySelectorAll(".view").forEach((button) => {- const buttonView = button.getAttribute("data-view");- const isActive = buttonView === "all" ? !hasLayerFocus() : selectedViews.has(buttonView);- button.classList.toggle("active", isActive);- button.setAttribute("aria-pressed", isActive ? "true" : "false");- });- }-- document.querySelectorAll(".platform").forEach((button) => {- button.addEventListener("click", () => {- platformView = button.getAttribute("data-platform");- document.querySelectorAll(".platform").forEach((other) => other.classList.remove("active"));- button.classList.add("active");- render();- });- });-- document.querySelectorAll(".type").forEach((button) => {- button.addEventListener("click", () => {- typeView = button.getAttribute("data-type");- document.querySelectorAll(".type").forEach((other) => other.classList.remove("active"));- button.classList.add("active");- render();- });- });-- document.getElementById("simulateIncident").addEventListener("click", () => {- let target = null;- walk(tree, (node) => {- if (node.id === "volume-immich-library") target = node;- });- if (!target) return;- target.status = "critical";- target.disk = 92;- target.signals = ["Projected to fill in 4 days", "Backup target will exceed retention budget"];- target.changes.unshift("Disk growth accelerated in the last hour");- render();- });-- render();- </script>- </body>-</html>