From c0da4768bbbb82e545f11c7c61edcbccce40c054 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 7 Dec 2025 00:27:47 +0000 Subject: [PATCH] Metric bar and CPU bar improvements --- .../components/Dashboard/EnhancedCPUBar.tsx | 24 +++++++----------- .../src/components/Dashboard/GuestRow.tsx | 6 ++--- .../src/components/Dashboard/MetricBar.tsx | 25 +++++++------------ .../components/shared/NodeSummaryTable.tsx | 12 ++++----- .../src/components/shared/Sparkline.tsx | 2 +- 5 files changed, 28 insertions(+), 41 deletions(-) diff --git a/frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx b/frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx index 74171f1..be0f95a 100644 --- a/frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx +++ b/frontend-modern/src/components/Dashboard/EnhancedCPUBar.tsx @@ -47,6 +47,7 @@ export function EnhancedCPUBar(props: EnhancedCPUBarProps) {
} > - {/* Sparkline mode - scales to fill column width, matching bar mode */} -
-
-
- -
- - {formatPercent(props.usage)} - -
+ {/* Sparkline mode - full width, flex centered like stacked bars */} +
+
); diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx index e365397..1ac52a2 100644 --- a/frontend-modern/src/components/Dashboard/GuestRow.tsx +++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx @@ -979,7 +979,7 @@ export function GuestRow(props: GuestRowProps) { {/* CPU */} - +
- +
@@ -1058,7 +1058,7 @@ export function GuestRow(props: GuestRowProps) { {/* Disk */} - +
@@ -120,21 +120,14 @@ export function MetricBar(props: MetricBarProps) {
} > - {/* Sparkline mode - scales to fill column width, matching bar mode sizing */} -
-
-
- -
- - {props.label} - -
+ {/* Sparkline mode - full width, flex centered like stacked bars */} +
+
); diff --git a/frontend-modern/src/components/shared/NodeSummaryTable.tsx b/frontend-modern/src/components/shared/NodeSummaryTable.tsx index ec64028..6535edc 100644 --- a/frontend-modern/src/components/shared/NodeSummaryTable.tsx +++ b/frontend-modern/src/components/shared/NodeSummaryTable.tsx @@ -354,13 +354,13 @@ export const NodeSummaryTable: Component = (props) => { handleSort('uptime')}> Uptime {renderSortIndicator('uptime')} - handleSort('cpu')}> + handleSort('cpu')}> CPU {renderSortIndicator('cpu')} - handleSort('memory')}> + handleSort('memory')}> Memory {renderSortIndicator('memory')} - handleSort('disk')}> + handleSort('disk')}> Disk {renderSortIndicator('disk')} @@ -561,7 +561,7 @@ export const NodeSummaryTable: Component = (props) => { {/* CPU */} - +
@@ -589,7 +589,7 @@ export const NodeSummaryTable: Component = (props) => { {/* Memory */} - +
@@ -631,7 +631,7 @@ export const NodeSummaryTable: Component = (props) => { {/* Disk */} - + = (props) => { } return props.width || 120; }; - const height = () => props.height || 24; + const height = () => props.height || 16; // Default thresholds based on metric type const getDefaultThresholds = () => {