feat: merge report-only customers into Customers page, rename tab
- Customers page now shows ALL customers: both pre-configured (managed) and report-only (manual) — merged from customer_configs + reports tables - Renamed "Configurations" → "Customers" in navigation tabs - Renamed "+ New Configuration" → "+ Add Customer" - Status column with ok/warn/down badges, version column, managed/manual badge Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,11 +12,11 @@
|
||||
<h1>Felhom Hub</h1>
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Configurations</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<a href="/configs" class="back-link">← All Configurations</a>
|
||||
<a href="/configs" class="back-link">← All customers</a>
|
||||
|
||||
{{if .Flash}}
|
||||
<div class="flash flash-success">
|
||||
@@ -123,7 +123,7 @@
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>Felhom Hub — Configuration Management</p>
|
||||
<p>Felhom Hub — Customer Management</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Felhom Hub — {{if .IsNew}}New Configuration{{else}}Edit {{.Config.CustomerID}}{{end}}</title>
|
||||
<title>Felhom Hub — {{if .IsNew}}Add Customer{{else}}Edit {{.Config.CustomerID}}{{end}}</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
@@ -12,12 +12,12 @@
|
||||
<h1>Felhom Hub</h1>
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Configurations</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<a href="{{if .IsNew}}/configs{{else}}/configs/{{.Config.CustomerID}}{{end}}" class="back-link">← Back</a>
|
||||
<h2>{{if .IsNew}}New Customer Configuration{{else}}Edit: {{.Config.CustomerID}}{{end}}</h2>
|
||||
<h2>{{if .IsNew}}Add Customer{{else}}Edit: {{.Config.CustomerID}}{{end}}</h2>
|
||||
|
||||
{{if .Error}}
|
||||
<div class="flash flash-error">{{.Error}}</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Felhom Hub — Configurations</title>
|
||||
<title>Felhom Hub — Customers</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
@@ -12,25 +12,25 @@
|
||||
<h1>Felhom Hub</h1>
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Configurations</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
{{if .Flash}}
|
||||
<div class="flash flash-success">
|
||||
{{if eq .Flash "deleted"}}Configuration deleted.{{end}}
|
||||
{{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;">Customer Configurations</h2>
|
||||
<a href="/configs/new" class="btn">+ New Configuration</a>
|
||||
<h2 style="margin: 0;">Customers</h2>
|
||||
<a href="/configs/new" class="btn">+ Add Customer</a>
|
||||
</div>
|
||||
|
||||
{{if not .Configs}}
|
||||
{{if not .Customers}}
|
||||
<div class="empty-state">
|
||||
<p>No customer configurations yet.</p>
|
||||
<p class="hint">Create a configuration to pre-provision a customer node.</p>
|
||||
<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">
|
||||
@@ -39,16 +39,32 @@
|
||||
<th>Customer ID</th>
|
||||
<th>Name</th>
|
||||
<th>Domain</th>
|
||||
<th>Created</th>
|
||||
<th>Status</th>
|
||||
<th>Version</th>
|
||||
<th>Config</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Configs}}
|
||||
<tr onclick="window.location='/configs/{{.CustomerID}}'">
|
||||
{{range .Customers}}
|
||||
<tr onclick="window.location='{{if .HasConfig}}/configs/{{.CustomerID}}{{else}}/customers/{{.CustomerID}}{{end}}'">
|
||||
<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>{{timeAgo .CreatedAt}}</td>
|
||||
<td>
|
||||
{{if .OverallStatus}}
|
||||
<span class="status-badge status-badge-{{.OverallStatus}}">{{.OverallStatus}}</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 .HasConfig}}
|
||||
<span class="status-badge status-badge-ok">managed</span>
|
||||
{{else}}
|
||||
<span class="status-badge status-badge-disabled">manual</span>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
@@ -56,7 +72,7 @@
|
||||
{{end}}
|
||||
|
||||
<footer>
|
||||
<p>Felhom Hub — Configuration Management</p>
|
||||
<p>Felhom Hub — Customer Management</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<header>
|
||||
<nav class="nav-links" style="margin-bottom: 0.5rem;">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link">Configurations</a>
|
||||
<a href="/configs" class="nav-link">Customers</a>
|
||||
</nav>
|
||||
<a href="/" class="back-link">← Back to Dashboard</a>
|
||||
<h1>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<h1>Felhom Hub</h1>
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link active">Dashboard</a>
|
||||
<a href="/configs" class="nav-link">Configurations</a>
|
||||
<a href="/configs" class="nav-link">Customers</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user