admin: vector servers on the dashboard (#12606)

* admin: vector servers on the dashboard

A Vector servers count in the Cluster card and a Vector Servers table
after S3 Servers, from the engines the dashboard already discovers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* admin: drop the dashboard's vector server kind

Every vector server is a weed-vector engine, so the column said the
same thing on every row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 authored and GitHub committed 2026-11-13 20:16:43 -08:00
1 parent 58d25998d0
commit a8436a621a
3 files changed
+438 -262

No files matched your search

+50
View File
@@ -335,6 +335,10 @@ templ Admin(data dash.AdminData) {
<div class="h5 mb-0">{fmt.Sprintf("%d", len(data.S3Nodes))}</div>
<small class="text-muted">S3 servers</small>
</a>
<a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/vector-servers") }>
<div class="h5 mb-0">{fmt.Sprintf("%d", len(data.VectorNodes))}</div>
<small class="text-muted">Vector servers</small>
</a>
<a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/mount-clients") }>
<div class="h5 mb-0">{fmt.Sprintf("%d", data.TotalMountClients)}</div>
<small class="text-muted">Mount clients</small>
@@ -549,6 +553,52 @@ templ Admin(data dash.AdminData) {
</div>
</div>
<!-- Vector Servers -->
<div class="row mb-4">
<div class="col-12">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">
<i class="bi bi-arrow-up-right me-2"></i>Vector Servers
</h6>
<a href={ dash.PUrl(ctx, "/cluster/vector-servers") } class="btn btn-sm btn-outline-primary">
View all <i class="bi bi-arrow-right ms-1"></i>
</a>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover" width="100%" cellspacing="0">
<thead>
<tr>
<th>Address</th>
<th>Version</th>
<th>Status</th>
</tr>
</thead>
<tbody>
for _, vectorNode := range data.VectorNodes {
<tr>
<td>{vectorNode.Address}</td>
<td title={vectorNode.Version}>{dash.ShortVersion(vectorNode.Version)}</td>
<td>{vectorNode.Status}</td>
</tr>
}
if len(data.VectorNodes) == 0 {
<tr>
<td colspan="3" class="text-center text-muted py-4">
<i class="bi bi-info-circle me-2"></i>
No vector servers found
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Last Updated -->
<div class="row">
<div class="col-12">
+19
View File
@@ -84,3 +84,22 @@ func TestClusterHealthSummary(t *testing.T) {
t.Errorf("empty cluster issues = %q", got)
}
}
func TestAdminDashboardListsVectorServers(t *testing.T) {
var out bytes.Buffer
data := dash.AdminData{VectorNodes: []dash.VectorNode{{Address: "10.0.0.6:18888", Version: "0.1.0", Status: "Ready"}}}
if err := Admin(data).Render(context.Background(), &out); err != nil {
t.Fatal(err)
}
page := out.String()
if !strings.Contains(page, "Vector servers") || !strings.Contains(page, "<td>10.0.0.6:18888</td>") || strings.Contains(page, "No vector servers found") {
t.Fatal("the dashboard does not list the vector engine")
}
out.Reset()
if err := Admin(dash.AdminData{}).Render(context.Background(), &out); err != nil {
t.Fatal(err)
}
if !strings.Contains(out.String(), "No vector servers found") {
t.Fatal("no empty state without vector servers")
}
}
File diff suppressed because it is too large. Load diff