Skip to content

Commit

Permalink
status color
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRunfola committed Feb 14, 2025
1 parent 3e268e3 commit 5f566ae
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions geoBoundaryBuilder/monitor/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,16 @@ <h2>System Status</h2>
}

function getStatusColor(status) {
switch(status.toLowerCase()) {
case 'running':
case 'active':
return '#27ae60';
case 'error':
case 'failed':
return '#e74c3c';
case 'warning':
return '#f39c12';
default:
return '#2c3e50';
if (!status) return '#95a5a6';
const statusLower = status.toLowerCase();
if (statusLower.includes('error') || statusLower.includes('failed') || statusLower.includes('not found')) {
return '#e74c3c';
} else if (statusLower.includes('warning')) {
return '#f1c40f';
} else if (statusLower.includes('success') || statusLower.includes('running') || statusLower.includes('ok')) {
return '#2ecc71';
} else {
return '#3498db';
}
}

Expand Down Expand Up @@ -235,8 +234,6 @@ <h2>System Status</h2>
const statusCard = document.createElement('div');
statusCard.className = 'status-card';

const statusColor = getStatusColor(status.status);

const statusColor = getStatusColor(status.status_message);
const heartbeatColor = getHeartbeatColor(status.heartbeat_time);

Expand Down

0 comments on commit 5f566ae

Please sign in to comment.