Skip to content

admin: org edit/delete + kube-context banner + remove legacy dashboard pages#826

Merged
benben merged 2 commits into
mainfrom
ben/admin-org-crud
Jun 29, 2026
Merged

admin: org edit/delete + kube-context banner + remove legacy dashboard pages#826
benben merged 2 commits into
mainfrom
ben/admin-org-crud

Conversation

@benben

@benben benben commented Jun 29, 2026

Copy link
Copy Markdown
Member

Three changes to the control-plane admin dashboard. The models explorer is now the only dashboard surface. Pure admin-UI/route changes; the /api/v1 admin API is unchanged.

1. Org edit + delete (detail panel)

Clicking an org → detail panel gains Edit and Delete (orgs model only; backed by existing PUT/DELETE /api/v1/orgs/:id).

  • Delete → inline confirm mode (no native confirm()); on confirm → DELETE → close + reload orgs.
  • Edit → prefilled form of the PUT-mergeable Org fields (max_workers, max_connections, default_worker_{cpu,memory,ttl,min_hot_idle}, hostname_alias); field set = live columns ∩ allowlist, so it auto-adapts. Save → PUT → re-render + reload.
  • api() helper extended to {method, body} (keeps the 401 gate).

2. Kube-context banner (red when prod)

Top bar showing which cluster you're looking at, strong-red when the kube context name contains "prod". No env var, no CP endpoint — a dev-only cue: the devserver answers /api/v1/cluster-info from the kube context it's serving; the UI hides the banner when the label is empty (the real deployed CP has no such endpoint).

3. Remove legacy dashboard pages

Deleted static/{index,orgs,workers,sessions}.html + their routes + nav links. /, /models → models explorer; POST /login stays.

devserver reworked (peepernetes-style)

One --context drives everything: fetch the internal secret (kubectl get secret duckgres-tokens), port-forward that context's control plane on an ephemeral local port, and label the banner with the context.

just ui-dev mw-prod-us-admin    # :5173, red prod banner
just ui-dev mw-dev-admin        # :5173, dev banner
just ui-dev-all                 # prod :5173 + dev :5174 side by side

Falls back to --target/--secret without --context.

Preserves the explorer's column sorting, header tooltips, and orgs cross-model links (#823).

Verified: go build -tags kubernetes ./controlplane/admin/... ./controlplane/admin/devserver/, go vet, admin dashboard/auth tests pass, models.html has no {{, both context-driven servers serve + banner correctly (prod red, dev muted).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Test Impact Plan

Deterministic summary of how this PR changes tests, CI runners, and coverage-risk signals.

Summary

Area Added Changed Deleted
Test files 0 1 0
E2E/journey files 0 0 0
Workflow files 0 0 0

Signals

  • Test cases: +0 / -0
  • Assertions: +2 / -0
  • Skips or known failures added: 0
  • Workflow continue-on-error added: 0
  • Workflow path filters added: 0
  • Test commands removed from justfile: 0
  • E2E/journey retry lines added: 0

Coverage risk: neutral or increased

No coverage-reduction warnings detected.

Three admin-dashboard changes (the models explorer is now the only dashboard):

1. Org edit + delete in the detail panel (orgs model). Delete uses an inline
   confirm mode (no native confirm()); edit renders a prefilled form of the
   PUT-mergeable Org fields (column-driven allowlist, so it adapts as columns
   change) and PUTs the changes. Wires to the existing DELETE/PUT
   /api/v1/orgs/:id. The api() helper gained {method,body} support (keeps the
   401 gate).

2. Cluster-context banner across the top, RED when the kube context name
   contains "prod". No env var, no CP endpoint — it is a DEV-ONLY cue: the
   devserver answers /api/v1/cluster-info from the kube context it serves; the
   UI hides the banner when the label is empty (i.e. in the real deployment).

3. Removed the legacy dashboard pages (index/orgs/workers/sessions html + their
   routes + nav links); models explorer (/, /models) + login remain. The
   /api/v1 admin API is unchanged.

devserver reworked peepernetes-style: a single --context drives everything — it
fetches the internal secret (kubectl get secret duckgres-tokens), port-forwards
that context's control plane on an ephemeral local port, and labels the banner
with the context. just ui-dev <context> runs one; just ui-dev-all runs prod
(:5173, red) + dev (:5174) side by side. Without --context it falls back to
--target/--secret.

Preserves the explorer's column sorting, header tooltips, and orgs cross-model
links.
@benben benben force-pushed the ben/admin-org-crud branch from 876e245 to ad4b644 Compare June 29, 2026 14:17
@benben benben changed the title admin: org edit/delete + cluster banner + remove legacy dashboard pages admin: org edit/delete + kube-context banner + remove legacy dashboard pages Jun 29, 2026
…on line

- COLUMN_TOOLTIPS now covers every column of all 9 models (grounded in the
  configstore model doc comments), incl. one-liners for the embedded warehouse
  sub-configs; preserves the existing orgs hostname_alias/users/warehouse tips.
- Adds MODEL_DESCRIPTIONS: a dim one-line 'what this model is' subtitle under
  the model title in the toolbar.
- devserver: check the freeLocalPort listener Close (errcheck/lint fix).
@benben benben merged commit 18e219b into main Jun 29, 2026
30 of 31 checks passed
@benben benben deleted the ben/admin-org-crud branch June 29, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant