Traefik: routers are graded from their latest scrape (router_state: crit on any real 5xx share, warn on p95 past the latency critical cutoff or a high 4xx share). Failing and slow routers lead as cards that say why; healthy ones fold into one table that stays open or shut across polls. Proxy counts are stat tiles; certificates are graded by Settings -> Thresholds (tls_days). UniFi: WAN health is a stat strip (latency graded by the thresholds), devices carry status dots, event categories and firewall actions are badges, the alarm count reuses .count-badge (renamed from .nav-count). SNMP: each device wears a status badge and its readings are stat tiles. Agent fleet: the table comes first, with a Status column (Reporting / Silent / Never reported, by the host page's stale_after_seconds), silent agents first, hosts linked, last seen as |ago. Audit: entries name their entity (one query per type, steward/audit/ service.py) and link it; something deleted since keeps the name its entry recorded and says "(deleted)". Tokens: charts read colours through chart-colors.js (stewardColor resolves a token to the rgb the browser computed; Chart.js defaults take the page's text and border colours), so host, history, Traefik and SNMP charts drop their hex. Template hex colours reach 0 (HEX_CEILING = 0), the last rgba pills go, and heavy weights (600/700/bold, 60 of them) become 500, the house pair being 400/500; a guard keeps templates there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64 lines
3.0 KiB
HTML
64 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{ dashboard.name }} — Steward</title>
|
|
<script src="{{ url_for('static', filename='vendor/htmx-2.0.4.min.js') }}"></script>
|
|
<script src="{{ url_for('static', filename='vendor/chart-4.4.4.umd.min.js') }}"></script>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='fonts/fonts.css') }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='theme.css') }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='steward.css') }}">
|
|
<script src="{{ url_for('static', filename='chart-colors.js') }}"></script>
|
|
{# The palette, type and widget classes come from steward.css like every
|
|
other page; only the read-only page's own frame and its grid live here. #}
|
|
<style>
|
|
.share-header { background: var(--bg-card); padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border-mid); min-height: 48px; }
|
|
.share-name { font-family: var(--fs-font-display); font-weight: 500; font-size: 1.15rem; color: var(--gold); overflow-wrap: anywhere; }
|
|
.share-main { max-width: 1600px; }
|
|
/* Same grid as the authenticated view, rendered from x/y/w/h. */
|
|
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 70px; gap: 1rem; }
|
|
.dash-grid > .dash-cell { margin-bottom: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
|
|
.dash-cell .dash-cell-body { flex: 1; min-height: 0; overflow: auto; }
|
|
@media (max-width: 820px) {
|
|
.dash-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
|
|
.dash-grid > .dash-cell { grid-column: 1 / -1 !important; grid-row: auto !important; }
|
|
.dash-cell .dash-cell-body { overflow: visible; }
|
|
.share-main { padding: 1rem; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header class="share-header">
|
|
<span class="share-name">{{ dashboard.name }}</span>
|
|
<span style="font-size:0.78rem;color:var(--text-muted);">Steward · read-only view</span>
|
|
</header>
|
|
|
|
<main class="share-main">
|
|
{% if widgets %}
|
|
<div class="dash-grid">
|
|
{% for item in widgets %}
|
|
{% set gw = item.db %}
|
|
<div class="card ping-card dash-cell"
|
|
style="grid-column:{{ gw.grid_x + 1 }} / span {{ gw.grid_w }};grid-row:{{ gw.grid_y + 1 }} / span {{ gw.grid_h }};">
|
|
<div class="widget-header">
|
|
<span class="widget-title" title="{{ item.title }}">{{ item.title }}</span>
|
|
</div>
|
|
{# Pass share token as &s= param so require_role allows through #}
|
|
<div class="dash-cell-body" id="widget-{{ gw.id }}"
|
|
hx-get="{{ item.hx_url }}&s={{ raw_token }}"
|
|
hx-trigger="load{% if item.defn.poll %}, every {{ poll_interval }}s{% endif %}"
|
|
hx-swap="innerHTML">
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="empty-state">This dashboard has no widgets.</div>
|
|
{% endif %}
|
|
</main>
|
|
|
|
</body>
|
|
</html>
|