Add service status indicator to service cards

This commit is contained in:
MayaChat
2025-11-23 23:56:37 -05:00
parent e2ca853042
commit 642b332c15

View File

@@ -54,6 +54,7 @@
const port = s.getAttribute('port') || '';
const logo = s.getAttribute('logo') || '';
const hostAttr = s.getAttribute('host'); // optional public hostname or full URL
const status = s.getAttribute('status'); // optional: 'online', 'offline', 'maintenance'
// Build href: prefer explicit host attribute when present.
// Rules:
@@ -101,6 +102,14 @@
a.appendChild(img);
a.appendChild(span);
// Add status indicator if status attribute is set
if(status){
const statusDot = document.createElement('span');
statusDot.className = `status-dot status-${status}`;
statusDot.title = `Status: ${status}`;
a.appendChild(statusDot);
}
// Add info button if both hostname and port are available
if((hostAttr || host) && port){
const infoBtn = document.createElement('button');