This commit is contained in:
Mateusz Gruszczyński
2025-10-17 14:30:40 +02:00
parent 38e5fc6e49
commit b22cfe368e
3 changed files with 73 additions and 37 deletions

View File

@@ -121,19 +121,24 @@ async function fetchNodeDetail(name) {
return await r.json();
}
// ------ Normalizacja stanu usług ------
// ------ Services status ------
function normSvcState(s) {
const raw = String(pick(
const vals = [
s.active, s['active-state'], s.ActiveState, s.activestate,
s.state, s.SubState, s.substate
)).toLowerCase();
const bad = String(pick(s.result, s.Result, s['exit-code'])).toLowerCase();
s.SubState, s.substate,
s.state, s.State,
s.loadstate, s.LoadState,
s.result, s.Result, s['exit-code']
]
.filter(v => v !== undefined && v !== null && v !== '')
.map(v => String(v).toLowerCase());
if (/failed|error|dead/.test(bad)) return 'failed';
if (/^active$|running/.test(raw)) return 'active';
if (/activating|starting/.test(raw)) return 'activating';
if (/deactivating|stopping/.test(raw)) return 'deactivating';
if (/failed|dead/.test(raw)) return 'failed';
const joined = ' ' + vals.join(' ') + ' ';
if (/\b(failed|error|dead|auto-restart\b.*fail)\b/.test(joined)) return 'failed';
if (/\b(active|running|up)\b/.test(joined)) return 'active';
if (/\b(activating|starting|start-pre|reload)\b/.test(joined)) return 'activating';
if (/\b(deactivating|stopping|stop-post)\b/.test(joined)) return 'deactivating';
if (vals.length) return 'inactive';
return 'inactive';
}

View File

@@ -1,21 +1,53 @@
/* Dark theme */
body { background-color: #0f1115; }
.card.health-card { background: #101520; }
.health-dot { width: 12px; height: 12px; border-radius: 50%; background: #dc3545; }
.health-dot.ok { background: #28a745; }
.health-dot.bad { background: #dc3545; }
body {
background-color: #0f1115;
}
.card.health-card {
background: #101520;
}
.health-dot {
width: 12px;
height: 12px;
border-radius: 50%;
background: #dc3545;
}
.health-dot.ok {
background: #28a745;
}
.health-dot.bad {
background: #dc3545;
}
/* Tables */
.table td, .table th { vertical-align: middle; }
.table td,
.table th {
vertical-align: middle;
}
/* Dividers */
.vr { width:1px; min-height:1rem; background: rgba(255,255,255,.15); }
.vr {
width: 1px;
min-height: 1rem;
background: rgba(255, 255, 255, .15);
}
/* --- horizontal scroll & nowrap for wide tables --- */
.table-responsive { overflow-x: auto; }
.table-nowrap { white-space: nowrap; }
@media (min-width: 992px){
.table-nowrap-lg-normal { white-space: normal; }
.table-responsive {
overflow-x: auto;
}
.table-nowrap {
white-space: nowrap;
}
@media (min-width: 992px) {
.table-nowrap-lg-normal {
white-space: normal;
}
}
/* sticky first column (for wide tables) */
@@ -24,5 +56,17 @@ body { background-color: #0f1115; }
left: 0;
z-index: 2;
background: var(--bs-body-bg);
box-shadow: 1px 0 0 rgba(255,255,255,.08);
box-shadow: 1px 0 0 rgba(255, 255, 255, .08);
}
footer.site-footer {
border-top: 1px solid rgba(255, 255, 255, .1);
}
footer.site-footer a {
text-decoration: none;
}
footer.site-footer a:hover {
text-decoration: underline;
}