diff --git a/static/main.js b/static/main.js index 45ecd15..87b6d00 100644 --- a/static/main.js +++ b/static/main.js @@ -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'; } diff --git a/static/styles.css b/static/styles.css index 1f79d63..0e1de1e 100644 --- a/static/styles.css +++ b/static/styles.css @@ -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; +} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 1e8dcdd..b69fa3a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,19 +7,6 @@ PVE HA Panel - @@ -276,9 +263,9 @@
© 2025 PVE HA Panel
- Autor: linuxiarz.pl + linuxiarz.pl  |  - Kod źródłowy: gitea.linuxiarz.pl/gru/pve-ha-web