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
Render multi-disk Proxmox hosts as vertical micro-bars
rcourtmanfcc7626a9a42
diff --git a/frontend-modern/src/components/Workloads/StackedDiskBar.tsx b/frontend-modern/src/components/Workloads/StackedDiskBar.tsxindex 0cf68bc1c6..1badcea269 100644--- a/frontend-modern/src/components/Workloads/StackedDiskBar.tsx+++ b/frontend-modern/src/components/Workloads/StackedDiskBar.tsx@@ -18,145 +18,69 @@ export function StackedDiskBar(props: StackedDiskBarProps) {return (<div ref={state.setContainerRef} class={presentation().containerClass}><Show- when={presentation().inlineDiskMode && presentation().hasDisks}+ when={presentation().verticalBarsMode}fallback={- <div- data-stacked-disk-trigger- class="relative w-full h-full overflow-hidden bg-surface-hover rounded"- onMouseEnter={state.handleMouseEnter}- onMouseLeave={state.handleMouseLeave}- >- {/* Stacked segments for multiple disks */}- <Show when={presentation().useStackedSegments}>- <svg- aria-hidden="true"- class="absolute inset-0 h-full w-full"- viewBox="0 0 100 100"- preserveAspectRatio="none"- >- <For each={presentation().segments}>- {(segment, idx) => (- <>- <rect- data-stacked-disk-fill="segment"- class="metric-fill-geometry"- x={String(- presentation()- .segments.slice(0, idx())- .reduce((sum, item) => sum + item.widthPercent, 0),- )}- y="0"- width={clampPercent(segment.widthPercent)}- height="100"- rx="3"- fill={segment.color}- />- <Show when={idx() < presentation().segments.length - 1}>- <line- class="metric-fill-divider"- x1={String(- presentation()- .segments.slice(0, idx() + 1)- .reduce((sum, item) => sum + item.widthPercent, 0),- )}- x2={String(- presentation()- .segments.slice(0, idx() + 1)- .reduce((sum, item) => sum + item.widthPercent, 0),- )}- y1="0"- y2="100"- stroke="rgba(255,255,255,0.3)"- stroke-width="1"- />- </Show>- </>- )}- </For>- </svg>- </Show>-- {/* Single bar for aggregate or single disk */}- <Show when={!presentation().useStackedSegments}>- <svg- aria-hidden="true"- class="absolute inset-0 h-full w-full"- viewBox="0 0 100 100"- preserveAspectRatio="none"+ <Show+ when={presentation().inlineDiskMode && presentation().hasDisks}+ fallback={+ <div+ data-stacked-disk-trigger+ class="relative w-full h-full overflow-hidden bg-surface-hover rounded"+ onMouseEnter={state.handleMouseEnter}+ onMouseLeave={state.handleMouseLeave}>- <rect- data-stacked-disk-fill="single"- class="metric-fill-geometry"- x="0"- y="0"- width={clampPercent(presentation().barPercent)}- height="100"- rx="3"- fill={presentation().barColor}- />- </svg>- </Show>-- {/* Label overlay */}- <span class="absolute inset-0 flex items-center justify-center text-[10px] font-semibold text-base-content leading-none min-w-0 overflow-hidden">- <span class="max-w-full min-w-0 whitespace-nowrap overflow-hidden text-ellipsis px-0.5 text-center">- <span>- <AnimatedNumber- value={presentation().displayPercentValue}- format={formatPercent}- />- </span>- <Show when={presentation().showMaxLabel}>- <span- class="text-[8px] font-normal text-muted"- title={presentation().maxLabelFull}- >- {' '}- {presentation().maxLabelShort}- </span>- </Show>- <Show when={presentation().showSublabel}>- <span class="metric-sublabel font-normal text-muted">- {' '}- ({presentation().displaySublabel})- </span>- </Show>- <Show when={presentation().showDiskCount}>- <span- class="text-[8px] font-normal text-muted"- title={`${props.disks?.length ?? 0} disks`}- >- {' '}- [{props.disks?.length}]- </span>- </Show>- {/* Anomaly indicator */}- <Show when={presentation().anomalyDescription && presentation().anomalyRatio}>- <span- class={`ml-0.5 font-bold animate-pulse ${presentation().anomalyClass}`}- title={presentation().anomalyDescription}+ {/* Stacked segments for multiple disks */}+ <Show when={presentation().useStackedSegments}>+ <svg+ aria-hidden="true"+ class="absolute inset-0 h-full w-full"+ viewBox="0 0 100 100"+ preserveAspectRatio="none">- {presentation().anomalyRatio}- </span>+ <For each={presentation().segments}>+ {(segment, idx) => (+ <>+ <rect+ data-stacked-disk-fill="segment"+ class="metric-fill-geometry"+ x={String(+ presentation()+ .segments.slice(0, idx())+ .reduce((sum, item) => sum + item.widthPercent, 0),+ )}+ y="0"+ width={clampPercent(segment.widthPercent)}+ height="100"+ rx="3"+ fill={segment.color}+ />+ <Show when={idx() < presentation().segments.length - 1}>+ <line+ class="metric-fill-divider"+ x1={String(+ presentation()+ .segments.slice(0, idx() + 1)+ .reduce((sum, item) => sum + item.widthPercent, 0),+ )}+ x2={String(+ presentation()+ .segments.slice(0, idx() + 1)+ .reduce((sum, item) => sum + item.widthPercent, 0),+ )}+ y1="0"+ y2="100"+ stroke="rgba(255,255,255,0.3)"+ stroke-width="1"+ />+ </Show>+ </>+ )}+ </For>+ </svg></Show>- </span>- </span>- </div>- }- >- <div- data-stacked-disk-trigger- class="h-full w-full"- onMouseEnter={state.handleMouseEnter}- onMouseLeave={state.handleMouseLeave}- >- <div class="flex h-full items-stretch gap-0.5">- <For each={presentation().miniDisks}>- {(disk) => (- <div- class="relative min-w-0 flex-1 overflow-hidden rounded-sm bg-surface-alt"- title={disk.title}- >++ {/* Single bar for aggregate or single disk */}+ <Show when={!presentation().useStackedSegments}><svgaria-hidden="true"class="absolute inset-0 h-full w-full"@@ -164,19 +88,125 @@ export function StackedDiskBar(props: StackedDiskBarProps) {preserveAspectRatio="none"><rect- data-stacked-disk-fill="inline"+ data-stacked-disk-fill="single"class="metric-fill-geometry"x="0"y="0"- width={clampPercent(disk.percent)}+ width={clampPercent(presentation().barPercent)}height="100"- rx="2"- fill={disk.color}+ rx="3"+ fill={presentation().barColor}/></svg>- <span class="absolute inset-0 flex min-w-0 items-center justify-center overflow-hidden px-px text-center text-[8px] font-semibold leading-none text-base-content">- <span class="min-w-0 truncate">{disk.inlineText}</span>+ </Show>++ {/* Label overlay */}+ <span class="absolute inset-0 flex items-center justify-center text-[10px] font-semibold text-base-content leading-none min-w-0 overflow-hidden">+ <span class="max-w-full min-w-0 whitespace-nowrap overflow-hidden text-ellipsis px-0.5 text-center">+ <span>+ <AnimatedNumber+ value={presentation().displayPercentValue}+ format={formatPercent}+ />+ </span>+ <Show when={presentation().showMaxLabel}>+ <span+ class="text-[8px] font-normal text-muted"+ title={presentation().maxLabelFull}+ >+ {' '}+ {presentation().maxLabelShort}+ </span>+ </Show>+ <Show when={presentation().showSublabel}>+ <span class="metric-sublabel font-normal text-muted">+ {' '}+ ({presentation().displaySublabel})+ </span>+ </Show>+ <Show when={presentation().showDiskCount}>+ <span+ class="text-[8px] font-normal text-muted"+ title={`${props.disks?.length ?? 0} disks`}+ >+ {' '}+ [{props.disks?.length}]+ </span>+ </Show>+ {/* Anomaly indicator */}+ <Show when={presentation().anomalyDescription && presentation().anomalyRatio}>+ <span+ class={`ml-0.5 font-bold animate-pulse ${presentation().anomalyClass}`}+ title={presentation().anomalyDescription}+ >+ {presentation().anomalyRatio}+ </span>+ </Show></span>+ </span>+ </div>+ }+ >+ <div+ data-stacked-disk-trigger+ class="h-full w-full"+ onMouseEnter={state.handleMouseEnter}+ onMouseLeave={state.handleMouseLeave}+ >+ <div class="flex h-full items-stretch gap-0.5">+ <For each={presentation().miniDisks}>+ {(disk) => (+ <div+ class="relative min-w-0 flex-1 overflow-hidden rounded-sm bg-surface-alt"+ title={disk.title}+ >+ <svg+ aria-hidden="true"+ class="absolute inset-0 h-full w-full"+ viewBox="0 0 100 100"+ preserveAspectRatio="none"+ >+ <rect+ data-stacked-disk-fill="inline"+ class="metric-fill-geometry"+ x="0"+ y="0"+ width={clampPercent(disk.percent)}+ height="100"+ rx="2"+ fill={disk.color}+ />+ </svg>+ <span class="absolute inset-0 flex min-w-0 items-center justify-center overflow-hidden px-px text-center text-[8px] font-semibold leading-none text-base-content">+ <span class="min-w-0 truncate">{disk.inlineText}</span>+ </span>+ </div>+ )}+ </For>+ </div>+ </div>+ </Show>+ }+ >+ {/* Vertical micro-bars: one per disk, fill height = utilization, color = threshold */}+ <div+ data-stacked-disk-trigger+ class="h-full w-full"+ onMouseEnter={state.handleMouseEnter}+ onMouseLeave={state.handleMouseLeave}+ >+ <div class="flex h-full items-end justify-center gap-[3px]">+ <For each={presentation().verticalBars}>+ {(bar) => (+ <div+ class="relative h-full w-[5px] shrink-0 overflow-hidden rounded-sm bg-surface-hover"+ title={bar.title}+ >+ <div+ data-stacked-disk-fill="vertical"+ class="absolute bottom-0 left-0 right-0 rounded-sm"+ style={{ height: `${bar.fillPercent}%`, background: bar.color }}+ /></div>)}</For>diff --git a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts b/frontend-modern/src/components/Workloads/stackedDiskBarModel.tsindex 2ac91070d2..fe225d32ac 100644--- a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts+++ b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts@@ -13,7 +13,7 @@ import type { MetricDisplayThresholds } from '@/utils/metricThresholds';export interface StackedDiskBarProps {disks?: Disk[];aggregateDisk?: Disk;- mode?: 'stacked' | 'aggregate' | 'mini';+ mode?: 'stacked' | 'aggregate' | 'mini' | 'vertical-bars';anomaly?: AnomalyReport | null;thresholds?: MetricDisplayThresholds | null;}@@ -44,6 +44,12 @@ export interface StackedDiskMiniDisk {title: string;}+export interface StackedDiskVerticalBar {+ color: string;+ fillPercent: number;+ title: string;+}+export interface StackedDiskMaxInfo {label: string;percent: number;@@ -74,6 +80,8 @@ export interface StackedDiskBarPresentation {tooltipContent: StackedDiskTooltipItem[];tooltipTitle: string;useStackedSegments: boolean;+ verticalBars: StackedDiskVerticalBar[];+ verticalBarsMode: boolean;}const SEGMENT_COLORS = [@@ -223,7 +231,12 @@ export function buildStackedDiskBarPresentation(const aggregateMode = props.mode === 'aggregate';const miniMode = props.mode === 'mini';const explicitStackedMode = props.mode === 'stacked';- const inlineDiskMode = (miniMode || hasMultipleDisks) && !aggregateMode && !explicitStackedMode;+ const verticalBarsMode = props.mode === 'vertical-bars' && hasDisks;+ const inlineDiskMode =+ (miniMode || hasMultipleDisks) &&+ !aggregateMode &&+ !explicitStackedMode &&+ !verticalBarsMode;const useStackedSegments = hasMultipleDisks && explicitStackedMode;const inlineDiskSlotWidth = disks.length > 0 ? containerWidth / disks.length : 0;const totalCapacity = hasDisks@@ -288,6 +301,17 @@ export function buildStackedDiskBarPresentation(title: `${label}: ${percentLabel} (${formatBytes(disk.used)}/${formatBytes(disk.total)})`,};});+ const verticalBars: StackedDiskVerticalBar[] = verticalBarsMode+ ? disks.map((disk, index) => {+ const percent = getDiskUsagePercent(disk);+ const label = getDiskLabel(disk, index);+ return {+ color: getMetricColorRgba(percent, 'disk', props.thresholds),+ fillPercent: Math.max(0, Math.min(percent, 100)),+ title: `${label}: ${formatPercent(percent)} (${formatBytes(disk.used)}/${formatBytes(disk.total)})`,+ };+ })+ : [];const tooltipContent = buildTooltipContent(disks, {aggregateDisk: props.aggregateDisk,aggregateMode,@@ -305,8 +329,9 @@ export function buildStackedDiskBarPresentation(anomalyRatio,barColor,barPercent,- containerClass:- inlineDiskMode && hasDisks+ containerClass: verticalBarsMode+ ? 'metric-text w-full h-4 min-w-0'+ : inlineDiskMode && hasDisks? 'metric-text w-full h-4 min-w-0': 'metric-text w-full h-4 flex items-center justify-center',displayLabel,@@ -326,5 +351,7 @@ export function buildStackedDiskBarPresentation(tooltipContent,tooltipTitle: hasMultipleDisks ? 'Disk Breakdown' : 'Disk Usage',useStackedSegments,+ verticalBars,+ verticalBarsMode,};}diff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsxindex 38085f53e6..609806dac9 100644--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx@@ -334,6 +334,11 @@ export const ProxmoxNodesTable: Component<{}><StackedDiskBar+ mode={+ (node.agent?.disks?.length ?? 0) > 1+ ? 'vertical-bars'+ : undefined+ }disks={normalizeDiskArray(node.agent?.disks)}aggregateDisk={aggregateDisk()}/>