admin: org edit/delete + kube-context banner + remove legacy dashboard pages#826
Merged
Conversation
Test Impact PlanDeterministic summary of how this PR changes tests, CI runners, and coverage-risk signals. Summary
Signals
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.
876e245 to
ad4b644
Compare
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes to the control-plane admin dashboard. The models explorer is now the only dashboard surface. Pure admin-UI/route changes; the
/api/v1admin 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).confirm()); on confirm → DELETE → close + reload orgs.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-infofrom 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 /loginstays.devserver reworked (peepernetes-style)
One
--contextdrives 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.Falls back to
--target/--secretwithout--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.htmlhas no{{, both context-driven servers serve + banner correctly (prod red, dev muted).🤖 Generated with Claude Code