refactor(v5): remove CLI-specific fields and labels from clusters UI

Remove server count badge, last run status, and CLI summary from the
cluster detail panel. Rename "CLI state" to "Cluster state" and update
the add-server dialog to drop "CLI-generated" wording. Add test
assertions covering all removed and renamed elements.
This commit is contained in:
Andras Bacsai
2026-06-19 13:53:10 +02:00
parent 24bbfe07c6
commit 155b07378c
2 changed files with 10 additions and 18 deletions
+2 -18
View File
@@ -1000,10 +1000,6 @@ export default function Clusters({
{isDeletingCluster ? 'Deleting...' : 'Delete cluster'}
</Button>
) : null}
<div className="rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-muted-foreground">
{selectedCluster.serversCount}{' '}
{selectedCluster.serversCount === 1 ? 'server' : 'servers'}
</div>
</div>
</div>
{deleteClusterError ? (
@@ -1067,7 +1063,7 @@ export default function Clusters({
<div className="rounded-lg border border-border bg-background p-4">
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
CLI state
Cluster state
</p>
<dl className="mt-3 space-y-2 text-xs">
<div className="flex justify-between gap-3">
@@ -1082,18 +1078,7 @@ export default function Clusters({
{selectedCluster.corrosionVersion}
</dd>
</div>
<div className="flex justify-between gap-3">
<dt className="text-muted-foreground">Last run</dt>
<dd className="font-medium text-foreground">
{selectedCluster.lastCliStatus ?? 'Never'}
</dd>
</div>
</dl>
{selectedCluster.lastCliSummary ? (
<pre className="mt-3 max-h-28 overflow-auto whitespace-pre-wrap rounded bg-muted/30 p-2 text-xs text-muted-foreground">
{selectedCluster.lastCliSummary}
</pre>
) : null}
</div>
</div>
@@ -1493,8 +1478,7 @@ export default function Clusters({
<DialogHeader>
<DialogTitle>Add server</DialogTitle>
<DialogDescription>
Add a remote server to this WireGuard cluster. CLI-generated mesh values are
saved after bootstrap or extend runs.
Add a remote server to this WireGuard cluster. Generated mesh values are saved after bootstrap or extend runs.
</DialogDescription>
</DialogHeader>
+8
View File
@@ -2043,6 +2043,13 @@ it('defines the v5 cluster management page and create cluster form', function ()
->toContain("import { csrfToken } from '@/lib/csrf';")
->toContain("fetch('/v5/clusters'")
->toContain('aria-label="Select a cluster"')
->toContain('Cluster state')
->not->toContain('Last run')
->not->toContain('selectedCluster.lastCliStatus')
->not->toContain('selectedCluster.lastCliSummary')
->toContain('Generated mesh values are saved after bootstrap or extend runs.')
->not->toContain('CLI state')
->not->toContain('CLI-generated mesh values')
->toContain('Select a cluster')
->toContain('setSelectedClusterId(value)')
->toContain('aria-label="Create cluster"')
@@ -2163,6 +2170,7 @@ it('defines the v5 cluster management page and create cluster form', function ()
->toContain("method: 'DELETE'")
->toContain('Delete cluster')
->toContain('selectedCluster.serversCount === 0')
->not->toContain("selectedCluster.serversCount === 1 ? 'server' : 'servers'")
->toContain('Only empty clusters can be deleted.')
->toContain('min-h-dvh overflow-y-auto bg-background text-foreground lg:h-dvh lg:overflow-hidden')
->toContain('flex min-h-dvh overflow-visible px-4 pt-16 lg:h-full lg:min-h-0 lg:overflow-hidden lg:px-6')