update monitor
This commit is contained in:
43
monitor.html
43
monitor.html
@@ -509,18 +509,34 @@
|
||||
|
||||
// Update Services
|
||||
const serviceList = document.getElementById('service-list');
|
||||
serviceList.innerHTML = data.services.map(s => `
|
||||
<li class="service-item">
|
||||
<div class="service-name">
|
||||
<img src="${getServiceLogo(s.name)}" class="service-logo" onerror="this.src='https://via.placeholder.com/32?text=${s.name.charAt(0)}'">
|
||||
${s.name}
|
||||
</div>
|
||||
<div class="service-status" style="color: ${s.status === 'online' ? 'var(--status-green)' : 'var(--status-red)'}">
|
||||
<i class="fas ${s.status === 'online' ? 'fa-check-circle' : 'fa-times-circle'}"></i>
|
||||
${s.status === 'online' ? s.latency : 'Offline'}
|
||||
</div>
|
||||
</li>
|
||||
`).join('');
|
||||
serviceList.innerHTML = data.services.map(s => {
|
||||
let statusColor = 'var(--status-red)';
|
||||
let statusIcon = 'fa-times-circle';
|
||||
let statusText = s.status;
|
||||
|
||||
if (s.status === 'online') {
|
||||
statusColor = 'var(--status-green)';
|
||||
statusIcon = 'fa-check-circle';
|
||||
statusText = s.latency;
|
||||
} else if (s.status === 'partial') {
|
||||
statusColor = 'var(--status-yellow)';
|
||||
statusIcon = 'fa-exclamation-circle';
|
||||
statusText = 'Partial';
|
||||
}
|
||||
|
||||
return `
|
||||
<li class="service-item">
|
||||
<div class="service-name">
|
||||
<img src="${getServiceLogo(s.name)}" class="service-logo" onerror="this.src='https://via.placeholder.com/32?text=${s.name.charAt(0)}'">
|
||||
${s.name}
|
||||
</div>
|
||||
<div class="service-status" style="color: ${statusColor}">
|
||||
<i class="fas ${statusIcon}"></i>
|
||||
${statusText}
|
||||
</div>
|
||||
</li>
|
||||
`;
|
||||
}).join('');
|
||||
|
||||
document.getElementById('loading').style.opacity = '0';
|
||||
setTimeout(() => document.getElementById('loading').style.display = 'none', 500);
|
||||
@@ -537,7 +553,8 @@
|
||||
'Draw.io': 'https://app.diagrams.net/images/logo-flat.svg',
|
||||
'TestArena': '/static/testarena.png',
|
||||
'TBM': '/static/tbm.ico',
|
||||
'Board': 'https://excalidraw.com/favicon-32x32.png'
|
||||
'Board': 'https://excalidraw.com/favicon-32x32.png',
|
||||
'TestArena Backend': '/static/testarena.png'
|
||||
};
|
||||
return logos[name] || '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user