diff --git a/public/scripts/components/MonitoringViewComponent.js b/public/scripts/components/MonitoringViewComponent.js
index a025ca2..1f793cf 100644
--- a/public/scripts/components/MonitoringViewComponent.js
+++ b/public/scripts/components/MonitoringViewComponent.js
@@ -122,6 +122,16 @@ class MonitoringViewComponent extends Component {
this.drawer.closeDrawer();
}
+ // Get color class based on utilization percentage (same logic as gauges)
+ getUtilizationColorClass(percentage) {
+ const numPercentage = parseFloat(percentage);
+
+ if (numPercentage === 0 || isNaN(numPercentage)) return 'utilization-empty';
+ if (numPercentage < 50) return 'utilization-green';
+ if (numPercentage < 80) return 'utilization-yellow';
+ return 'utilization-red';
+ }
+
// Clean up resources
cleanup() {
if (this.drawer) {
@@ -223,7 +233,7 @@ class MonitoringViewComponent extends Component {
${Math.round(clusterSummary.totalCpu - clusterSummary.availableCpu)}MHz / ${Math.round(clusterSummary.totalCpu)}MHz
@@ -237,7 +247,7 @@ class MonitoringViewComponent extends Component {
${this.viewModel.formatResourceValue(clusterSummary.totalMemory - clusterSummary.availableMemory, 'memory')} / ${this.viewModel.formatResourceValue(clusterSummary.totalMemory, 'memory')}
${memoryUtilization}% used
@@ -251,7 +261,7 @@ class MonitoringViewComponent extends Component {
${this.viewModel.formatResourceValue(clusterSummary.totalStorage - clusterSummary.availableStorage, 'storage')} / ${this.viewModel.formatResourceValue(clusterSummary.totalStorage, 'storage')}
${storageUtilization}% used
@@ -394,7 +404,7 @@ class MonitoringViewComponent extends Component {
${Math.round(cpuUsed)}MHz / ${Math.round(cpuTotal)}MHz
@@ -405,7 +415,7 @@ class MonitoringViewComponent extends Component {
${this.viewModel.formatResourceValue(memoryUsed, 'memory')} / ${this.viewModel.formatResourceValue(memoryTotal, 'memory')}
${memoryUtilization}% used
@@ -416,7 +426,7 @@ class MonitoringViewComponent extends Component {
${this.viewModel.formatResourceValue(storageUsed, 'storage')} / ${this.viewModel.formatResourceValue(storageTotal, 'storage')}
${storageUtilization}% used
diff --git a/public/styles/main.css b/public/styles/main.css
index b75a9cd..92ad58c 100644
--- a/public/styles/main.css
+++ b/public/styles/main.css
@@ -4128,6 +4128,23 @@ html {
transition: width 0.3s ease;
}
+/* Utilization bar colors based on percentage (same as gauges) */
+.utilization-empty {
+ background: rgba(255, 255, 255, 0.1) !important;
+}
+
+.utilization-green {
+ background: linear-gradient(90deg, var(--accent-success), var(--accent-success)) !important;
+}
+
+.utilization-yellow {
+ background: linear-gradient(90deg, var(--accent-warning), var(--accent-warning)) !important;
+}
+
+.utilization-red {
+ background: linear-gradient(90deg, var(--accent-error), var(--accent-error)) !important;
+}
+
.utilization-text {
color: var(--text-secondary);
font-size: 0.75rem;