bc8d54df6a
- static/fonts/: the 4 vendored woff2 (byte-copied from
felhom-controller), embedded (embed.go) and served at /static/fonts/
(font/woff2, immutable) mirroring the chart.min.js pattern. No CDN
before, none now.
- templates/icons.html: 12-symbol Lucide sprite partial (icon_sprite),
included at the top of <body> on all 9 pages ({{template}} — the hub
has no shared layout; per-page include is the minimal shared block).
- statusColor now returns v2 semantic tokens (nominal/warn/crit/
neutral) consumed as class suffixes: ok->nominal, warn+stale->warn,
down+fail->crit, pending+disabled->neutral (a not-yet-provisioned or
deliberately paused customer is a normal fleet state), blocked->warn
(intentional operator cut-off, attention-worthy not an outage),
unknown->neutral. The inline style="color: {{statusColor}}" pattern
is dead: dashboard + customer_unified render a class-based
.status-dot-<token>; statusIcon (constant "●") retired from funcmap
and templates.
- Tests (new; the hub web package had no funcmap/template tests):
TestStatusColorTruthTable over the full enumerated status set —
red-proven vs the old implementation (ok returned "#4ade80") — and
TestTemplatesParseWithFuncmap.
93 lines
4.0 KiB
HTML
93 lines
4.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>Felhom Hub — Customers</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
</head>
|
|
<body>
|
|
{{template "icon_sprite"}}
|
|
<div class="container">
|
|
<header>
|
|
<h1>Felhom Hub</h1>
|
|
<nav class="nav-links">
|
|
<a href="/" class="nav-link">Dashboard</a>
|
|
<a href="/configs" class="nav-link active">Customers</a>
|
|
<a href="/apps" class="nav-link">Apps</a>
|
|
<a href="/hosts" class="nav-link">Hosts</a>
|
|
<a href="/configuration" class="nav-link">Configuration</a>
|
|
</nav>
|
|
</header>
|
|
|
|
{{if .Flash}}
|
|
<div class="flash flash-success">
|
|
{{if eq .Flash "deleted"}}Customer configuration deleted.{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;">
|
|
<h2 style="margin: 0;">Customers</h2>
|
|
<a href="/configs/new" class="btn">+ Add Customer</a>
|
|
</div>
|
|
|
|
{{if not .Customers}}
|
|
<div class="empty-state">
|
|
<p>No customers yet.</p>
|
|
<p class="hint">Add a customer configuration or wait for a controller to report in.</p>
|
|
</div>
|
|
{{else}}
|
|
<table class="dashboard-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Customer ID</th>
|
|
<th>Name</th>
|
|
<th>Domain</th>
|
|
<th>Status</th>
|
|
<th>Version</th>
|
|
<th>Floor</th>
|
|
<th>Config</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Customers}}
|
|
<tr class="{{if .IsBlocked}}row-blocked{{end}}" onclick="window.location='/customers/{{.CustomerID}}'">
|
|
<td><code>{{.CustomerID}}</code></td>
|
|
<td>{{if .CustomerName}}{{.CustomerName}}{{else}}<span class="text-muted">—</span>{{end}}</td>
|
|
<td>{{if .Domain}}{{.Domain}}{{else}}<span class="text-muted">—</span>{{end}}</td>
|
|
<td>
|
|
{{if .IsBlocked}}
|
|
<span class="config-badge config-badge-blocked">BLOCKED</span>
|
|
{{else if .OverallStatus}}
|
|
<span class="status-badge status-badge-{{.OverallStatus}}">
|
|
{{if eq .OverallStatus "ok"}}OK{{else if eq .OverallStatus "warn"}}WARN{{else if eq .OverallStatus "down"}}DOWN{{else if eq .OverallStatus "disabled"}}PAUSED{{else if eq .OverallStatus "pending"}}PENDING{{else}}{{.OverallStatus}}{{end}}
|
|
</span>
|
|
{{else}}
|
|
<span class="text-muted">—</span>
|
|
{{end}}
|
|
</td>
|
|
<td>{{if .ControllerVersion}}<code>{{.ControllerVersion}}</code>{{else}}<span class="text-muted">—</span>{{end}}</td>
|
|
<td>
|
|
{{if .EffectiveFloor}}<code>v{{.EffectiveFloor}}</code>{{if .FloorOverride}}<span class="text-muted" style="font-size:0.8em;"> (override)</span>{{end}}{{if .BelowFloor}}<span style="color:#f59e0b;" title="below floor — will auto-update"> ●</span>{{end}}
|
|
{{else}}<span class="text-muted">—</span>{{end}}
|
|
</td>
|
|
<td>
|
|
{{if .HasConfig}}
|
|
<span class="config-badge config-badge-managed">MANAGED</span>
|
|
{{else}}
|
|
<span class="config-badge config-badge-manual">MANUAL</span>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{end}}
|
|
|
|
<footer>
|
|
<p>Felhom Hub {{hubVersion}} — Customer Management</p>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|