changes
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
|
@@ -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; }
|
||||
.table-responsive {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.table-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.table-nowrap-lg-normal { white-space: normal; }
|
||||
.table-nowrap-lg-normal {
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* sticky first column (for wide tables) */
|
||||
@@ -26,3 +58,15 @@ body { background-color: #0f1115; }
|
||||
background: var(--bs-body-bg);
|
||||
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;
|
||||
}
|
@@ -7,19 +7,6 @@
|
||||
<title>PVE HA Panel</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='styles.css') }}" rel="stylesheet">
|
||||
<style>
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -276,9 +263,9 @@
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2">
|
||||
<div>© 2025 PVE HA Panel</div>
|
||||
<div>
|
||||
Autor: <strong>linuxiarz.pl</strong>
|
||||
<strong>linuxiarz.pl</strong>
|
||||
|
|
||||
Kod źródłowy: <a href="https://gitea.linuxiarz.pl/gru/pve-ha-web" target="_blank"
|
||||
Source code: <a href="https://gitea.linuxiarz.pl/gru/pve-ha-web" target="_blank"
|
||||
rel="noopener">gitea.linuxiarz.pl/gru/pve-ha-web</a>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user