Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 68f59c49a2 | |||
| a3c0818fef | |||
| 4dd7fc16f3 | |||
| 0b33589106 | |||
| ca4bcef26c | |||
| 15120a280f | |||
| 906869f425 | |||
| c027b5422a |
@@ -160,6 +160,16 @@ def index():
|
||||
last_check = db.get_state('last_check', 'Never')
|
||||
snapshot = json.loads(snapshot_raw) if snapshot_raw else {}
|
||||
suppressions = db.get_active_suppressions()
|
||||
for ev in events:
|
||||
sup_type = (
|
||||
'unifi_device' if ev.get('event_type') == 'unifi_device_offline'
|
||||
else 'interface' if ev.get('event_type') == 'interface_down'
|
||||
else 'host'
|
||||
)
|
||||
ev['is_suppressed'] = db.check_suppressed(
|
||||
suppressions, sup_type,
|
||||
ev.get('target_name', ''), ev.get('target_detail', '') or '',
|
||||
)
|
||||
recent_resolved = db.get_recent_resolved(hours=24, limit=10)
|
||||
return render_template(
|
||||
'index.html',
|
||||
@@ -214,6 +224,17 @@ def suppressions_page():
|
||||
@require_auth
|
||||
def api_status():
|
||||
active = db.get_active_events(limit=_PAGE_LIMIT)
|
||||
suppressions = db.get_active_suppressions()
|
||||
for ev in active:
|
||||
sup_type = (
|
||||
'unifi_device' if ev.get('event_type') == 'unifi_device_offline'
|
||||
else 'interface' if ev.get('event_type') == 'interface_down'
|
||||
else 'host'
|
||||
)
|
||||
ev['is_suppressed'] = db.check_suppressed(
|
||||
suppressions, sup_type,
|
||||
ev.get('target_name', ''), ev.get('target_detail', '') or '',
|
||||
)
|
||||
last_check = db.get_state('last_check', 'Never')
|
||||
return jsonify({
|
||||
'summary': db.get_status_summary(),
|
||||
|
||||
+15
-6
@@ -222,9 +222,12 @@ function updateEventsTable(events, totalActive) {
|
||||
? `<a href="${lt.escHtml(ticketBase)}${lt.escHtml(String(e.ticket_id))}" target="_blank"
|
||||
class="ticket-link">#${e.ticket_id}</a>`
|
||||
: '–';
|
||||
const supBadge = e.is_suppressed
|
||||
? `<span class="lt-badge badge-suppressed" title="Alert suppressed">🔕 sup</span>`
|
||||
: '';
|
||||
return `
|
||||
<tr class="row-${e.severity}">
|
||||
<td><span class="lt-badge badge-${e.severity}">${e.severity}</span></td>
|
||||
<tr class="row-${e.severity}${e.is_suppressed ? ' row-suppressed' : ''}">
|
||||
<td><span class="lt-badge badge-${e.severity}">${e.severity}</span>${supBadge}</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>
|
||||
@@ -273,9 +276,12 @@ function openSuppressModal(type, name, detail) {
|
||||
updateSuppressForm();
|
||||
lt.modal.open('suppress-modal');
|
||||
|
||||
document.querySelectorAll('#suppress-modal .pill').forEach(p => p.classList.remove('active'));
|
||||
document.querySelectorAll('#suppress-modal .pill').forEach(p => {
|
||||
p.classList.remove('active');
|
||||
p.setAttribute('aria-pressed', 'false');
|
||||
});
|
||||
const manualPill = document.querySelector('#suppress-modal .pill-manual');
|
||||
if (manualPill) manualPill.classList.add('active');
|
||||
if (manualPill) { manualPill.classList.add('active'); manualPill.setAttribute('aria-pressed', 'true'); }
|
||||
const hint = document.getElementById('duration-hint');
|
||||
if (hint) hint.textContent = 'Suppression will persist until manually removed.';
|
||||
}
|
||||
@@ -294,8 +300,11 @@ function updateSuppressForm() {
|
||||
|
||||
function setDuration(mins, el) {
|
||||
document.getElementById('sup-expires').value = mins || '';
|
||||
document.querySelectorAll('#suppress-modal .pill').forEach(p => p.classList.remove('active'));
|
||||
if (el) el.classList.add('active');
|
||||
document.querySelectorAll('#suppress-modal .pill').forEach(p => {
|
||||
p.classList.remove('active');
|
||||
p.setAttribute('aria-pressed', 'false');
|
||||
});
|
||||
if (el) { el.classList.add('active'); el.setAttribute('aria-pressed', 'true'); }
|
||||
const hint = document.getElementById('duration-hint');
|
||||
if (hint) {
|
||||
if (mins) {
|
||||
|
||||
@@ -118,6 +118,39 @@
|
||||
padding: 0.2rem 0.45rem;
|
||||
}
|
||||
|
||||
/* ── Form group modifiers ────────────────────────────────────────── */
|
||||
.lt-form-group--last { margin-bottom: 0; }
|
||||
|
||||
/* ── Search input size variant ───────────────────────────────────── */
|
||||
.lt-search-input--sm { width: 180px; }
|
||||
|
||||
/* ── Notification panel helpers ──────────────────────────────────── */
|
||||
.lt-notif-empty {
|
||||
padding: 1rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
.lt-notif-view-all {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
.lt-notif-dot {
|
||||
border-radius: 50%;
|
||||
margin-top: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* ── Divider variants ────────────────────────────────────────────── */
|
||||
.lt-divider--compact { margin: 1rem 0 0.75rem; }
|
||||
.lt-divider--unifi { margin: 20px 0 12px; }
|
||||
.lt-divider-label--unifi { color: var(--cyan); letter-spacing: .1em; }
|
||||
|
||||
/* ── Stats grid spacing variant ──────────────────────────────────── */
|
||||
.lt-stats-grid--mb { margin-bottom: 16px; }
|
||||
|
||||
/* ── Topology section collapse toggle ────────────────────────────── */
|
||||
.topo-collapse-btn {
|
||||
margin-left: auto;
|
||||
@@ -185,6 +218,7 @@
|
||||
.events-filter-bar .lt-input-sm { width: 220px; }
|
||||
.sev-pills { display: flex; gap: 4px; }
|
||||
.g-page-sub { font-size: .78em; color: var(--text-muted); margin-top: 4px; }
|
||||
.g-page-sub-aside { font-size: .78em; color: var(--text-muted); margin-left: 8px; }
|
||||
|
||||
/* ── Badge severity color variants (used with lt-badge) ───────────── */
|
||||
.badge-critical { color: var(--red); border-color: var(--red); text-shadow: var(--glow-red); }
|
||||
@@ -203,6 +237,8 @@
|
||||
.lt-table tr.row-warning td { background: rgba(255,107,0,.04); }
|
||||
.lt-table tr.row-warning td:first-child { border-left: 2px solid var(--orange); }
|
||||
.lt-table tr.row-resolved td { opacity: .65; }
|
||||
.lt-table tr.row-suppressed td { opacity: .6; }
|
||||
.lt-table tr.row-suppressed td:first-child{ border-left-color: var(--text-muted) !important; }
|
||||
|
||||
/* ── Table size modifier ─────────────────────────────────────────── */
|
||||
.lt-table-sm th,
|
||||
@@ -408,6 +444,9 @@
|
||||
background: linear-gradient(to bottom, var(--cyan), var(--green));
|
||||
opacity: .7;
|
||||
}
|
||||
.topo-vc-wire--wan { background: linear-gradient(to bottom, var(--cyan), rgba(0,212,255,.3)); opacity: .7; }
|
||||
.topo-vc-wire--10g { background: var(--amber); opacity: .6; }
|
||||
.topo-vc-wire--mgmt { background: var(--border-color); opacity: .5; }
|
||||
/* Blurred copy of the wire for a soft glow halo */
|
||||
.topo-vc-wire::before {
|
||||
content: '';
|
||||
@@ -465,6 +504,7 @@
|
||||
.topo-v2-sub { font-size: .58em; color: var(--text-muted); letter-spacing: .02em; }
|
||||
.topo-v2-vlan { font-size: .54em; color: var(--cyan); opacity: .75; }
|
||||
|
||||
.topo-v2-host--bus { min-width: 80px; max-width: 96px; }
|
||||
.topo-v2-internet { border-color: var(--cyan); color: var(--cyan); text-shadow: var(--glow-cyan); box-shadow: 0 0 12px rgba(0,212,255,.12); }
|
||||
.topo-v2-router { border-color: var(--cyan); color: var(--cyan); text-shadow: var(--glow-cyan); box-shadow: 0 0 12px rgba(0,212,255,.14); }
|
||||
.topo-v2-switch { border-color: var(--amber); color: var(--amber); text-shadow: var(--glow-amber); box-shadow: 0 0 12px rgba(255,179,0,.12); }
|
||||
@@ -514,6 +554,7 @@
|
||||
/* Bus rails */
|
||||
.topo-bus-section {
|
||||
width: 100%;
|
||||
max-width: 860px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
+27
-25
@@ -133,10 +133,10 @@
|
||||
<button type="button" class="lt-notif-panel-clear" id="lt-notif-clear-btn">Mark all read</button>
|
||||
</div>
|
||||
<div class="lt-notif-panel-list" id="lt-notif-list">
|
||||
<div style="padding:0.75rem;font-size:0.75rem;color:var(--text-muted);text-align:center">Loading…</div>
|
||||
<div class="lt-notif-empty">Loading…</div>
|
||||
</div>
|
||||
<div class="lt-notif-panel-footer">
|
||||
<a href="{{ url_for('index') }}" class="lt-btn lt-btn-ghost lt-btn-sm" style="width:100%;text-align:center;display:block;font-size:0.72rem">View dashboard</a>
|
||||
<a href="{{ url_for('index') }}" class="lt-btn lt-btn-ghost lt-btn-sm lt-notif-view-all">View dashboard</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -207,7 +207,7 @@
|
||||
</div>
|
||||
<form id="suppress-form">
|
||||
<div class="lt-modal-body">
|
||||
<div class="lt-form-group" style="margin-bottom:12px">
|
||||
<div class="lt-form-group">
|
||||
<label class="lt-label" for="sup-type">Target Type</label>
|
||||
<select class="lt-select" id="sup-type" name="target_type">
|
||||
<option value="host">Host (all interfaces)</option>
|
||||
@@ -216,27 +216,27 @@
|
||||
<option value="all">Global Maintenance</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="lt-form-group" id="sup-name-group" style="margin-bottom:12px">
|
||||
<div class="lt-form-group" id="sup-name-group">
|
||||
<label class="lt-label" for="sup-name">Target Name</label>
|
||||
<input type="text" class="lt-input" id="sup-name" name="target_name" placeholder="e.g. large1">
|
||||
</div>
|
||||
<div class="lt-form-group" id="sup-detail-group" style="margin-bottom:12px;display:none">
|
||||
<div class="lt-form-group" id="sup-detail-group" style="display:none">
|
||||
<label class="lt-label" for="sup-detail">Interface <span class="lt-field-hint">(interface type only)</span></label>
|
||||
<input type="text" class="lt-input" id="sup-detail" name="target_detail" placeholder="e.g. enp35s0">
|
||||
</div>
|
||||
<div class="lt-form-group" style="margin-bottom:12px">
|
||||
<div class="lt-form-group">
|
||||
<label class="lt-label" for="sup-reason">Reason <span class="required">*</span></label>
|
||||
<input type="text" class="lt-input" id="sup-reason" name="reason"
|
||||
placeholder="e.g. Planned switch reboot" required>
|
||||
</div>
|
||||
<div class="lt-form-group" style="margin-bottom:0">
|
||||
<div class="lt-form-group lt-form-group--last">
|
||||
<label class="lt-label">Duration</label>
|
||||
<div class="duration-pills">
|
||||
<button type="button" class="pill" data-duration="30">30 min</button>
|
||||
<button type="button" class="pill" data-duration="60">1 hr</button>
|
||||
<button type="button" class="pill" data-duration="240">4 hr</button>
|
||||
<button type="button" class="pill" data-duration="480">8 hr</button>
|
||||
<button type="button" class="pill pill-manual active" data-duration="">Manual ∞</button>
|
||||
<div class="duration-pills" role="group" aria-label="Select suppression duration">
|
||||
<button type="button" class="pill" data-duration="30" aria-pressed="false">30 min</button>
|
||||
<button type="button" class="pill" data-duration="60" aria-pressed="false">1 hr</button>
|
||||
<button type="button" class="pill" data-duration="240" aria-pressed="false">4 hr</button>
|
||||
<button type="button" class="pill" data-duration="480" aria-pressed="false">8 hr</button>
|
||||
<button type="button" class="pill pill-manual active" data-duration="" aria-pressed="true">Manual ∞</button>
|
||||
</div>
|
||||
<input type="hidden" id="sup-expires" name="expires_minutes" value="">
|
||||
<div class="lt-field-hint" id="duration-hint">Persists until manually removed.</div>
|
||||
@@ -258,7 +258,7 @@
|
||||
<button type="button" class="lt-modal-close" data-modal-close aria-label="Close">✕</button>
|
||||
</div>
|
||||
<div class="lt-modal-body">
|
||||
<table class="lt-table" style="width:100%">
|
||||
<table class="lt-table">
|
||||
<thead><tr><th>Shortcut</th><th>Action</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>Ctrl / ⌘ + K</td><td>Command palette</td></tr>
|
||||
@@ -286,16 +286,16 @@
|
||||
<div class="lt-modal-body">
|
||||
<div class="lt-form-group">
|
||||
<label class="lt-label">Auto-refresh interval</label>
|
||||
<div class="duration-pills" id="settings-refresh-pills">
|
||||
<button type="button" class="pill" data-refresh-interval="15">15 s</button>
|
||||
<button type="button" class="pill" data-refresh-interval="30">30 s</button>
|
||||
<button type="button" class="pill" data-refresh-interval="60">1 min</button>
|
||||
<button type="button" class="pill" data-refresh-interval="300">5 min</button>
|
||||
<button type="button" class="pill" data-refresh-interval="0">Off</button>
|
||||
<div class="duration-pills" id="settings-refresh-pills" role="group" aria-label="Select auto-refresh interval">
|
||||
<button type="button" class="pill" data-refresh-interval="15" aria-pressed="false">15 s</button>
|
||||
<button type="button" class="pill" data-refresh-interval="30" aria-pressed="false">30 s</button>
|
||||
<button type="button" class="pill" data-refresh-interval="60" aria-pressed="false">1 min</button>
|
||||
<button type="button" class="pill" data-refresh-interval="300" aria-pressed="false">5 min</button>
|
||||
<button type="button" class="pill" data-refresh-interval="0" aria-pressed="false">Off</button>
|
||||
</div>
|
||||
<div class="lt-field-hint" id="settings-refresh-hint"></div>
|
||||
</div>
|
||||
<div class="lt-divider" style="margin:1rem 0 0.75rem"></div>
|
||||
<div class="lt-divider lt-divider--compact"></div>
|
||||
<div class="lt-kv-grid">
|
||||
<span class="lt-kv-key">User</span>
|
||||
<span class="lt-kv-val lt-kv-val--cyan">{{ user.name or user.username }}</span>
|
||||
@@ -381,7 +381,9 @@
|
||||
|
||||
function applyRefreshPillUI(interval) {
|
||||
document.querySelectorAll('#settings-refresh-pills .pill').forEach(function(p) {
|
||||
p.classList.toggle('active', parseInt(p.dataset.refreshInterval) === interval);
|
||||
var isActive = parseInt(p.dataset.refreshInterval) === interval;
|
||||
p.classList.toggle('active', isActive);
|
||||
p.setAttribute('aria-pressed', isActive ? 'true' : 'false');
|
||||
});
|
||||
var hint = document.getElementById('settings-refresh-hint');
|
||||
if (hint) {
|
||||
@@ -455,14 +457,14 @@
|
||||
lt.notif.set(bell, unreadCount);
|
||||
|
||||
if (!active.length) {
|
||||
list.innerHTML = '<div style="padding:1rem;font-size:0.75rem;color:var(--text-muted);text-align:center">✔ No active alerts</div>';
|
||||
list.innerHTML = '<div class="lt-notif-empty">✔ No active alerts</div>';
|
||||
return;
|
||||
}
|
||||
list.innerHTML = active.slice(0, 25).map(function(e) {
|
||||
var isUnread = toMs(e.last_seen) > readBefore;
|
||||
var dotColor = SEV_DOT[e.severity] || 'var(--text-muted)';
|
||||
return '<div class="lt-notif-item' + (isUnread ? ' lt-notif-item--unread' : '') + '">' +
|
||||
'<div class="lt-notif-dot' + (isUnread ? '' : ' lt-notif-dot--read') + '" style="background:' + dotColor + ';border-radius:50%;margin-top:4px"></div>' +
|
||||
'<div class="lt-notif-dot' + (isUnread ? '' : ' lt-notif-dot--read') + '" style="background:' + dotColor + '"></div>' +
|
||||
'<div class="lt-notif-item-body">' +
|
||||
'<div class="lt-notif-item-title">' + esc(e.target_name) + (e.target_detail ? ' · ' + esc(e.target_detail) : '') + '</div>' +
|
||||
'<div class="lt-notif-item-time">' + esc(e.event_type.replace(/_/g,' ')) + ' · ' + fmtAgo(e.last_seen) + '</div>' +
|
||||
@@ -486,7 +488,7 @@
|
||||
}
|
||||
})
|
||||
.catch(function() {
|
||||
if (andRender) list.innerHTML = '<div style="padding:0.75rem;font-size:0.75rem;color:var(--text-muted);text-align:center">Could not load</div>';
|
||||
if (andRender) list.innerHTML = '<div class="lt-notif-empty">Could not load</div>';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+42
-30
@@ -31,32 +31,32 @@
|
||||
<div class="lt-stat-card{% if summary.critical %} lt-stat-card--alert{% endif %}"
|
||||
id="stat-critical" role="button" tabindex="0"
|
||||
data-stat-filter="critical" aria-label="{{ summary.critical or 0 }} critical alerts">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:var(--red);text-shadow:var(--glow-red)">●</span>
|
||||
<span class="lt-stat-icon lt-text-red" aria-hidden="true">●</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" id="stat-critical-val" style="color:var(--red)">{{ summary.critical or 0 }}</span>
|
||||
<span class="lt-stat-value lt-text-red" id="stat-critical-val">{{ summary.critical or 0 }}</span>
|
||||
<span class="lt-stat-label">Critical</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lt-stat-card"
|
||||
id="stat-warning" role="button" tabindex="0"
|
||||
data-stat-filter="warning" aria-label="{{ summary.warning or 0 }} warning alerts">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:var(--amber)">●</span>
|
||||
<span class="lt-stat-icon lt-text-amber" aria-hidden="true">●</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" id="stat-warning-val" style="color:var(--amber)">{{ summary.warning or 0 }}</span>
|
||||
<span class="lt-stat-value lt-text-amber" id="stat-warning-val">{{ summary.warning or 0 }}</span>
|
||||
<span class="lt-stat-label">Warning</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lt-stat-card" id="stat-hosts" aria-label="Monitored hosts">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:var(--cyan)">⬡</span>
|
||||
<span class="lt-stat-icon lt-text-cyan" aria-hidden="true">⬡</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" id="stat-hosts-val" style="color:var(--cyan)">{{ snapshot.hosts | length }}</span>
|
||||
<span class="lt-stat-value lt-text-cyan" id="stat-hosts-val">{{ snapshot.hosts | length }}</span>
|
||||
<span class="lt-stat-label">Hosts</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lt-stat-card" id="stat-resolved" aria-label="{{ recent_resolved | length }} alerts resolved in last 24 hours">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:var(--green);text-shadow:var(--glow)">✔</span>
|
||||
<span class="lt-stat-icon lt-text-green" aria-hidden="true">✔</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" id="stat-resolved-val" style="color:var(--green)">{{ recent_resolved | length }}</span>
|
||||
<span class="lt-stat-value lt-text-green" id="stat-resolved-val">{{ recent_resolved | length }}</span>
|
||||
<span class="lt-stat-label">Resolved 24h</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,12 +73,13 @@
|
||||
<div class="lt-toolbar-left">
|
||||
<div class="lt-search">
|
||||
<input type="search" class="lt-input lt-search-input" id="events-search"
|
||||
placeholder="Filter by target, type, description…" autocomplete="off">
|
||||
placeholder="Filter by target, type, description…" autocomplete="off"
|
||||
aria-label="Filter active alerts">
|
||||
</div>
|
||||
<div class="sev-pills">
|
||||
<button type="button" class="pill active" data-sev="">All</button>
|
||||
<button type="button" class="pill" data-sev="critical">Critical</button>
|
||||
<button type="button" class="pill" data-sev="warning">Warning</button>
|
||||
<div class="sev-pills" role="group" aria-label="Filter by severity">
|
||||
<button type="button" class="pill active" data-sev="" aria-pressed="true">All</button>
|
||||
<button type="button" class="pill" data-sev="critical" aria-pressed="false">Critical</button>
|
||||
<button type="button" class="pill" data-sev="warning" aria-pressed="false">Warning</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,8 +112,11 @@
|
||||
<tbody>
|
||||
{% for e in events %}
|
||||
{% if e.severity != 'info' %}
|
||||
<tr class="row-{{ e.severity }}">
|
||||
<td><span class="lt-badge badge-{{ e.severity }}">{{ e.severity }}</span></td>
|
||||
<tr class="row-{{ e.severity }}{% if e.is_suppressed %} row-suppressed{% endif %}">
|
||||
<td>
|
||||
<span class="lt-badge badge-{{ e.severity }}">{{ e.severity }}</span>
|
||||
{% if e.is_suppressed %}<span class="lt-badge badge-suppressed" title="Alert suppressed">🔕 sup</span>{% endif %}
|
||||
</td>
|
||||
<td>{{ e.event_type | replace('_', ' ') }}</td>
|
||||
<td><strong>{{ e.target_name }}</strong></td>
|
||||
<td>{{ e.target_detail or '–' }}</td>
|
||||
@@ -185,9 +189,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- WAN wire: cyan → green gradient, labeled -->
|
||||
<!-- WAN wire: cyan → WAN gradient -->
|
||||
<div class="topo-vc">
|
||||
<div class="topo-vc-wire" style="background:linear-gradient(to bottom,var(--cyan),rgba(0,212,255,.3)); opacity:.7;"></div>
|
||||
<div class="topo-vc-wire topo-vc-wire--wan"></div>
|
||||
<span class="topo-vc-label">WAN · 10G SFP+</span>
|
||||
</div>
|
||||
|
||||
@@ -205,7 +209,7 @@
|
||||
|
||||
<!-- UDM-Pro → USW-Agg (10G SFP+) -->
|
||||
<div class="topo-vc">
|
||||
<div class="topo-vc-wire" style="background:var(--amber);opacity:.6;"></div>
|
||||
<div class="topo-vc-wire topo-vc-wire--10g"></div>
|
||||
<span class="topo-vc-label">10G SFP+</span>
|
||||
</div>
|
||||
|
||||
@@ -224,7 +228,7 @@
|
||||
|
||||
<!-- USW-Agg → Pro 24 PoE (10G trunk) -->
|
||||
<div class="topo-vc">
|
||||
<div class="topo-vc-wire" style="background:var(--amber);opacity:.6;"></div>
|
||||
<div class="topo-vc-wire topo-vc-wire--10g"></div>
|
||||
<span class="topo-vc-label">10G trunk</span>
|
||||
</div>
|
||||
|
||||
@@ -243,14 +247,14 @@
|
||||
|
||||
<!-- Pro 24 PoE → host bus section -->
|
||||
<div class="topo-vc">
|
||||
<div class="topo-vc-wire" style="background:var(--border-color);opacity:.5;"></div>
|
||||
<div class="topo-vc-wire topo-vc-wire--mgmt"></div>
|
||||
</div>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════════════════
|
||||
TIER 4 connecting bus – two rails (10G green + 1G amber dashed)
|
||||
showing dual-homing for all 6 servers
|
||||
══════════════════════════════════════════════════════════ -->
|
||||
<div class="topo-bus-section" style="max-width:860px;">
|
||||
<div class="topo-bus-section">
|
||||
|
||||
<!-- 10G storage bus (Agg → VLAN90) -->
|
||||
<div class="topo-bus-10g">
|
||||
@@ -283,8 +287,8 @@
|
||||
<div class="topo-v2-wire-1g" data-host="{{ hname }}" title="1G → Pro 24 PoE"></div>
|
||||
</div>
|
||||
<!-- host box -->
|
||||
<div class="topo-v2-node topo-v2-host topo-host topo-v2-status-{{ st }}{{ ' topo-v2-offrack' if off_rack else '' }}"
|
||||
data-host="{{ hname }}" style="min-width:80px; max-width:96px;">
|
||||
<div class="topo-v2-node topo-v2-host topo-host topo-v2-status-{{ st }}{{ ' topo-v2-offrack' if off_rack else '' }} topo-v2-host--bus"
|
||||
data-host="{{ hname }}">
|
||||
<span class="topo-v2-icon">▣</span>
|
||||
<span class="topo-v2-label">{{ hlabel }}</span>
|
||||
<span class="topo-v2-sub">{{ hsub }}</span>
|
||||
@@ -312,8 +316,8 @@
|
||||
<div class="lt-toolbar" id="host-toolbar">
|
||||
<div class="lt-toolbar-left">
|
||||
<div class="lt-search">
|
||||
<input type="search" class="lt-input lt-search-input" id="host-search"
|
||||
placeholder="Filter hosts…" autocomplete="off" style="width:180px">
|
||||
<input type="search" class="lt-input lt-search-input lt-search-input--sm" id="host-search"
|
||||
placeholder="Filter hosts…" autocomplete="off" aria-label="Filter hosts">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -354,7 +358,7 @@
|
||||
data-sup-type="host"
|
||||
data-sup-name="{{ name }}"
|
||||
data-sup-detail=""
|
||||
title="Suppress alerts for this host">
|
||||
aria-label="Suppress alerts for {{ name }}">
|
||||
🔕 Suppress
|
||||
</button>
|
||||
<a href="{{ url_for('links_page') }}#{{ name }}"
|
||||
@@ -413,7 +417,8 @@
|
||||
<button class="lt-btn lt-btn-ghost lt-btn-sm btn-suppress"
|
||||
data-sup-type="unifi_device"
|
||||
data-sup-name="{{ d.name }}"
|
||||
data-sup-detail="">
|
||||
data-sup-detail=""
|
||||
aria-label="Suppress alerts for {{ d.name }}">
|
||||
🔕 Suppress
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -537,8 +542,12 @@
|
||||
document.querySelector('.sev-pills')?.addEventListener('click', e => {
|
||||
const pill = e.target.closest('.pill[data-sev]');
|
||||
if (!pill) return;
|
||||
document.querySelectorAll('.sev-pills .pill').forEach(p => p.classList.remove('active'));
|
||||
document.querySelectorAll('.sev-pills .pill').forEach(p => {
|
||||
p.classList.remove('active');
|
||||
p.setAttribute('aria-pressed', 'false');
|
||||
});
|
||||
pill.classList.add('active');
|
||||
pill.setAttribute('aria-pressed', 'true');
|
||||
_filterSev = pill.dataset.sev;
|
||||
applyEventsFilter();
|
||||
});
|
||||
@@ -560,9 +569,12 @@
|
||||
document.querySelectorAll('.lt-stat-card[data-stat-filter]').forEach(card => {
|
||||
card.addEventListener('click', () => {
|
||||
const sev = card.dataset.statFilter;
|
||||
document.querySelectorAll('.sev-pills .pill').forEach(p => p.classList.remove('active'));
|
||||
document.querySelectorAll('.sev-pills .pill').forEach(p => {
|
||||
p.classList.remove('active');
|
||||
p.setAttribute('aria-pressed', 'false');
|
||||
});
|
||||
const matchPill = document.querySelector(`.sev-pills .pill[data-sev="${sev}"]`);
|
||||
if (matchPill) matchPill.classList.add('active');
|
||||
if (matchPill) { matchPill.classList.add('active'); matchPill.setAttribute('aria-pressed', 'true'); }
|
||||
_filterSev = sev;
|
||||
applyEventsFilter();
|
||||
document.getElementById('events-table-wrap')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<h1 class="lt-page-title">Network Inspector</h1>
|
||||
<p class="g-page-sub">
|
||||
Visual switch chassis diagrams. Click a port to see detailed stats and LLDP path debug.
|
||||
<span id="inspector-updated" style="margin-left:8px"></span>
|
||||
<span id="inspector-updated" class="g-page-sub-aside"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -320,7 +320,9 @@ function renderPanel(swName, idx) {
|
||||
_apiData.hosts && _apiData.hosts[d.lldp.system_name]);
|
||||
const diagHtml = hasDiagTarget ? `
|
||||
<div class="diag-bar">
|
||||
<button class="btn-diag" data-action="run-diagnostic" data-sw="${escHtml(swName)}" data-idx="${idx}">Run Link Diagnostics</button>
|
||||
<button class="btn-diag lt-btn lt-btn-secondary lt-btn-sm" data-action="run-diagnostic"
|
||||
data-sw="${escHtml(swName)}" data-idx="${idx}"
|
||||
aria-label="Run link diagnostics for port ${idx} on ${escHtml(swName)}">Run Diagnostics</button>
|
||||
<span class="diag-status" id="diag-status"></span>
|
||||
</div>
|
||||
<div class="diag-results" id="diag-results"></div>` : '';
|
||||
@@ -433,7 +435,7 @@ function renderInspector(data) {
|
||||
}
|
||||
|
||||
if (!Object.keys(switches).length) {
|
||||
main.innerHTML = '<p class="empty-state">No switch data available. Monitor may still be initialising.</p>';
|
||||
main.innerHTML = '<div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-icon">⬡</div><div class="lt-empty-state-title">No switch data available</div><div class="lt-empty-state-body">Monitor may still be initialising.</div></div>';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -460,7 +462,7 @@ async function loadInspector() {
|
||||
renderInspector(data);
|
||||
} catch (e) {
|
||||
document.getElementById('inspector-main').innerHTML =
|
||||
'<p class="empty-state">Failed to load inspector data.</p>';
|
||||
'<div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-icon">✕</div><div class="lt-empty-state-title">Failed to load inspector data</div></div>';
|
||||
lt.toast.error('Failed to load inspector data');
|
||||
}
|
||||
}
|
||||
|
||||
+15
-14
@@ -8,7 +8,7 @@
|
||||
<h1 class="lt-page-title">Link Debug</h1>
|
||||
<p class="g-page-sub">
|
||||
Per-interface stats: speed, duplex, SFP optical levels, TX/RX rates, errors, and carrier changes.
|
||||
<span id="links-updated" style="margin-left:8px"></span>
|
||||
<span id="links-updated" class="g-page-sub-aside"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,7 +17,8 @@
|
||||
<div class="lt-toolbar-left">
|
||||
<div class="lt-search">
|
||||
<input type="search" class="lt-input lt-search-input" id="links-search"
|
||||
placeholder="Filter by host or switch name…" autocomplete="off">
|
||||
placeholder="Filter by host or switch name…" autocomplete="off"
|
||||
aria-label="Filter by host or switch name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="lt-toolbar-right">
|
||||
@@ -358,7 +359,7 @@ function renderUnifiSwitches(unifiSwitches, dataUpdated) {
|
||||
</div>`;
|
||||
}).join('');
|
||||
|
||||
return `<div class="lt-divider" style="margin:20px 0 12px"><span class="lt-divider-label" style="color:var(--cyan);letter-spacing:.1em">UNIFI SWITCH PORTS</span></div>${html}`;
|
||||
return `<div class="lt-divider lt-divider--unifi"><span class="lt-divider-label lt-divider-label--unifi">UNIFI SWITCH PORTS</span></div>${html}`;
|
||||
}
|
||||
|
||||
// ── Panel collapse / expand ───────────────────────────────────────
|
||||
@@ -407,37 +408,37 @@ function buildLinkSummary(hosts, unifiSwitches) {
|
||||
}
|
||||
const allTotal = totalIfaces + swTotal;
|
||||
const allDown = downIfaces + swDown;
|
||||
const downColor = allDown > 0 ? 'var(--red)' : 'var(--green)';
|
||||
const errColor = errIfaces > 0 ? 'var(--amber)' : 'var(--green)';
|
||||
const downCls = allDown > 0 ? 'lt-text-red' : 'lt-text-green';
|
||||
const errCls = errIfaces > 0 ? 'lt-text-amber' : 'lt-text-green';
|
||||
const downCardCls = allDown > 0 ? ' lt-stat-card--alert' : '';
|
||||
const poeCard = totalPoe > 0 ? `
|
||||
<div class="lt-stat-card">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:var(--amber)">⚡</span>
|
||||
<span class="lt-stat-icon lt-text-amber" aria-hidden="true">⚡</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" style="color:var(--amber)">${totalPoe.toFixed(1)}</span>
|
||||
<span class="lt-stat-value lt-text-amber">${totalPoe.toFixed(1)}</span>
|
||||
<span class="lt-stat-label">PoE Load (W)</span>
|
||||
</div>
|
||||
</div>` : '';
|
||||
return `
|
||||
<div class="lt-stats-grid" style="margin-bottom:16px">
|
||||
<div class="lt-stats-grid lt-stats-grid--mb">
|
||||
<div class="lt-stat-card">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:var(--cyan)">⬡</span>
|
||||
<span class="lt-stat-icon lt-text-cyan" aria-hidden="true">⬡</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" style="color:var(--cyan)">${allTotal}</span>
|
||||
<span class="lt-stat-value lt-text-cyan">${allTotal}</span>
|
||||
<span class="lt-stat-label">Interfaces</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lt-stat-card${downCardCls}">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:${downColor}">●</span>
|
||||
<span class="lt-stat-icon ${downCls}" aria-hidden="true">●</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" style="color:${downColor}">${allDown}</span>
|
||||
<span class="lt-stat-value ${downCls}">${allDown}</span>
|
||||
<span class="lt-stat-label">Ports Down</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lt-stat-card">
|
||||
<span class="lt-stat-icon" aria-hidden="true" style="color:${errColor}">▲</span>
|
||||
<span class="lt-stat-icon ${errCls}" aria-hidden="true">▲</span>
|
||||
<div class="lt-stat-info">
|
||||
<span class="lt-stat-value" style="color:${errColor}">${errIfaces}</span>
|
||||
<span class="lt-stat-value ${errCls}">${errIfaces}</span>
|
||||
<span class="lt-stat-label">With Errors</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+15
-10
@@ -58,12 +58,12 @@
|
||||
<div class="form-row form-row-align">
|
||||
<div class="lt-form-group">
|
||||
<label class="lt-label">Duration</label>
|
||||
<div class="duration-pills">
|
||||
<button type="button" class="pill" data-duration="30">30 min</button>
|
||||
<button type="button" class="pill" data-duration="60">1 hr</button>
|
||||
<button type="button" class="pill" data-duration="240">4 hr</button>
|
||||
<button type="button" class="pill" data-duration="480">8 hr</button>
|
||||
<button type="button" class="pill pill-manual active" data-duration="">Manual ∞</button>
|
||||
<div class="duration-pills" role="group" aria-label="Select suppression duration">
|
||||
<button type="button" class="pill" data-duration="30" aria-pressed="false">30 min</button>
|
||||
<button type="button" class="pill" data-duration="60" aria-pressed="false">1 hr</button>
|
||||
<button type="button" class="pill" data-duration="240" aria-pressed="false">4 hr</button>
|
||||
<button type="button" class="pill" data-duration="480" aria-pressed="false">8 hr</button>
|
||||
<button type="button" class="pill pill-manual active" data-duration="" aria-pressed="true">Manual ∞</button>
|
||||
</div>
|
||||
<input type="hidden" id="s-expires" name="expires_minutes" value="">
|
||||
<div class="lt-field-hint" id="s-dur-hint">Persists until manually removed.</div>
|
||||
@@ -110,7 +110,8 @@
|
||||
<td class="ts-cell">{{ s.created_at }}</td>
|
||||
<td class="ts-cell">{% if s.expires_at %}{{ s.expires_at }}{% else %}<em>manual</em>{% endif %}</td>
|
||||
<td>
|
||||
<button class="lt-btn lt-btn-danger lt-btn-sm" data-action="remove-sup" data-sup-id="{{ s.id }}">Remove</button>
|
||||
<button class="lt-btn lt-btn-danger lt-btn-sm" data-action="remove-sup" data-sup-id="{{ s.id }}"
|
||||
aria-label="Remove suppression for {{ s.target_name or 'global' }}">Remove</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -221,8 +222,11 @@
|
||||
|
||||
function setDur(mins, el) {
|
||||
document.getElementById('s-expires').value = mins || '';
|
||||
document.querySelectorAll('.duration-pills .pill').forEach(p => p.classList.remove('active'));
|
||||
if (el) el.classList.add('active');
|
||||
document.querySelectorAll('.duration-pills .pill').forEach(p => {
|
||||
p.classList.remove('active');
|
||||
p.setAttribute('aria-pressed', 'false');
|
||||
});
|
||||
if (el) { el.classList.add('active'); el.setAttribute('aria-pressed', 'true'); }
|
||||
const hint = document.getElementById('s-dur-hint');
|
||||
if (mins) {
|
||||
const h = Math.floor(mins/60), m = mins%60;
|
||||
@@ -251,7 +255,8 @@
|
||||
<td>${lt.escHtml(s.suppressed_by)}</td>
|
||||
<td class="ts-cell">${lt.escHtml(s.created_at || '')}</td>
|
||||
<td class="ts-cell">${s.expires_at ? lt.escHtml(s.expires_at) : '<em>manual</em>'}</td>
|
||||
<td><button class="lt-btn lt-btn-danger lt-btn-sm" data-action="remove-sup" data-sup-id="${s.id}">Remove</button></td>
|
||||
<td><button class="lt-btn lt-btn-danger lt-btn-sm" data-action="remove-sup" data-sup-id="${s.id}"
|
||||
aria-label="Remove suppression for ${lt.escHtml(s.target_name || 'global')}">Remove</button></td>
|
||||
</tr>`).join('');
|
||||
wrap.innerHTML = `
|
||||
<div class="lt-frame">
|
||||
|
||||
Reference in New Issue
Block a user