Polish: phone alert cards, quieter badges, footer, small layout fixes
Lint / JS (eslint) (push) Successful in 14s
Lint / Python (flake8) (push) Successful in 1m17s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / Python (flake8) (pull_request) Successful in 57s
Security / Python Security (bandit) (push) Successful in 1m0s
Test / Python Tests (pytest) (push) Successful in 1m56s
Security / Python Security (bandit) (pull_request) Successful in 1m52s
Lint / JS (eslint) (pull_request) Successful in 8s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Test / Python Tests (pytest) (pull_request) Successful in 1m25s
Lint / JS (eslint) (push) Successful in 14s
Lint / Python (flake8) (push) Successful in 1m17s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / Python (flake8) (pull_request) Successful in 57s
Security / Python Security (bandit) (push) Successful in 1m0s
Test / Python Tests (pytest) (push) Successful in 1m56s
Security / Python Security (bandit) (pull_request) Successful in 1m52s
Lint / JS (eslint) (pull_request) Successful in 8s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Test / Python Tests (pytest) (pull_request) Successful in 1m25s
- Active alerts on the dashboard become one card per alert on phones instead of a table squeezed to a letter per line. - Section count badges are neutral; red is kept for active alerts and tickets to follow up, so "History 0" no longer looks like a problem. - Host cards only tag the data source when it isn't node_exporter (a ping-only host), instead of "prometheus" on every card. - WAN / Fiber: the BGW320 doesn't report uptime here, so show the last restart instead of a permanent "Uptime -". - Footer: CFG and HELP read like the hints beside them rather than grey browser buttons, and the footer sits at the bottom of short pages. - Wider alert filter and suppression name fields so their hints fit. - "just now" instead of a negative age when a clock runs a little ahead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
73787daaec
commit
7da4cc26e2
6 files changed
+87
-35
No files matched your search
+22
-12
@@ -363,6 +363,16 @@ function _modemLastRestart(history) {
|
||||
return `restarted ${_modemWhen(last.at)}${last.by ? ` by ${last.by}` : ''}`;
|
||||
}
|
||||
|
||||
function _modemUptimeStat(data) {
|
||||
if (data.uptime_s !== null && data.uptime_s !== undefined) {
|
||||
return _modemStat('Uptime', _modemUptime(data.uptime_s), '', _modemLastRestart(data.wan_history));
|
||||
}
|
||||
const restarts = (data.wan_history && data.wan_history.restarts) || [];
|
||||
if (!restarts.length) return '';
|
||||
const last = restarts[restarts.length - 1];
|
||||
return _modemStat('Last restart', _modemWhen(last.at), '', last.by ? `by ${last.by}` : '');
|
||||
}
|
||||
|
||||
function _modemDuration(seconds) {
|
||||
if (seconds < 60) return `${Math.round(seconds)}s`;
|
||||
if (seconds < 3600) return `${Math.floor(seconds / 60)}m ${Math.round(seconds % 60)}s`;
|
||||
@@ -467,7 +477,7 @@ function updateModem(data) {
|
||||
${_modemOptic('Optics temp', optics.temperature, status.temperature, '°C')}
|
||||
${_modemStat('Throughput', `↓ ${_modemRate(rates.rx_bytes)}`, '', `↑ ${_modemRate(rates.tx_bytes)}`)}
|
||||
${_modemStat('Errors / drops', `${errs} / ${drops}`, errs ? 'lt-text-amber' : '', 'since modem reboot')}
|
||||
${_modemStat('Uptime', _modemUptime(data.uptime_s), '', _modemLastRestart(data.wan_history))}
|
||||
${_modemUptimeStat(data)}
|
||||
</div>
|
||||
${_modemQuality(data.wan_quality)}
|
||||
${_modemChart(data.history)}
|
||||
@@ -526,16 +536,16 @@ function updateEventsTable(events, totalActive) {
|
||||
: '';
|
||||
return `
|
||||
<tr class="row-${e.severity}${e.is_suppressed ? ' row-suppressed' : ''}">
|
||||
<td><span class="lt-badge badge-${e.severity}">${e.severity}</span>${supBadge}${staleBadge}${closedBadge}</td>
|
||||
<td>${lt.escHtml(e.event_type.replace(/_/g,' '))}</td>
|
||||
<td><strong>${lt.escHtml(e.target_name)}</strong></td>
|
||||
<td>${lt.escHtml(e.target_detail || '-')}</td>
|
||||
<td class="desc-cell" title="${lt.escHtml(e.description || '')}">${lt.escHtml((e.description||'').substring(0,60))}${(e.description||'').length>60?'…':''}</td>
|
||||
<td class="ts-cell" title="${lt.escHtml(e.first_seen||'')}">${lt.time.ago(_toIso(e.first_seen))}</td>
|
||||
<td class="ts-cell" title="${lt.escHtml(e.last_seen||'')}">${lt.time.ago(_toIso(e.last_seen))}</td>
|
||||
<td>${e.consecutive_failures}</td>
|
||||
<td>${ticket}</td>
|
||||
<td>
|
||||
<td data-label="Sev"><span class="lt-badge badge-${e.severity}">${e.severity}</span>${supBadge}${staleBadge}${closedBadge}</td>
|
||||
<td data-label="Type">${lt.escHtml(e.event_type.replace(/_/g,' '))}</td>
|
||||
<td data-label="Target"><strong>${lt.escHtml(e.target_name)}</strong></td>
|
||||
<td data-label="Detail">${lt.escHtml(e.target_detail || '-')}</td>
|
||||
<td data-label="Description" class="desc-cell" title="${lt.escHtml(e.description || '')}">${lt.escHtml((e.description||'').substring(0,60))}${(e.description||'').length>60?'…':''}</td>
|
||||
<td data-label="First seen" class="ts-cell" title="${lt.escHtml(e.first_seen||'')}">${lt.time.ago(_toIso(e.first_seen))}</td>
|
||||
<td data-label="Last seen" class="ts-cell" title="${lt.escHtml(e.last_seen||'')}">${lt.time.ago(_toIso(e.last_seen))}</td>
|
||||
<td data-label="Failures">${e.consecutive_failures}</td>
|
||||
<td data-label="Ticket">${ticket}</td>
|
||||
<td data-label="Actions">
|
||||
<button class="lt-btn lt-btn-ghost lt-btn-sm btn-suppress"
|
||||
data-sup-type="${lt.escHtml(supType)}"
|
||||
data-sup-name="${lt.escHtml(e.target_name)}"
|
||||
@@ -548,7 +558,7 @@ function updateEventsTable(events, totalActive) {
|
||||
wrap.innerHTML = `
|
||||
${countNotice}
|
||||
<div class="lt-table-wrap">
|
||||
<table class="lt-table" id="events-table">
|
||||
<table class="lt-table lt-table-responsive" id="events-table">
|
||||
<caption class="lt-sr-only">Active network alerts</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
Reference in new issue
Block a user