Skip to content

feat(ui): redesign cluster and access administration: Workers, Add worker, Users, Sharing - #13386

Merged
mudler merged 17 commits into
masterfrom
feat/admin-redesign
Nov 22, 2026
Merged

mudler merged 17 commits into
masterfrom
feat/admin-redesign

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

What this changes

Cluster and access administration move onto the Administration template (page header, filter bar, side sheets).

Workers

  • /app/nodes is now the Workers page: one roster of every machine of the cluster (backend, agent and model-split workers), with a chip per connection (NATS, WebSocket, P2P) and its state, an inspector with the health of each connection and the actions for the worker's state, a summary strip, and a connectivity pill that says how the serving frontend broadcasts (NATS or PostgreSQL).
  • The old Cluster transport panel, node list, fleet hero and "Add a node" flow are removed. The Failover page draws a lost worker's connections with the same chips.
  • Cluster settings is one shared component, drawn twice: as a side sheet opened from the Workers page and as a Cluster group in Settings (only when distributed mode is on). It holds the live frontends, the NATS addresses, the connection preference sliders (formerly "carrier weights") and the joining choice. Settings search finds its sections.
  • Add worker is a three-step flow: choose connections, run the command, wait for the worker. The page mints a join token, hides it on screen, puts it in the command only when you copy, counts down to the expiry, lets you pick uses and lifetime, and revokes the token it replaces. Tabs cover the install script (Linux/macOS and Windows), Docker, Docker Compose, Kubernetes and a manual start. A model-split worker has its own steps.

Access

  • Users is on the admin template: stat strip, filters (pending, admins, disabled, inactive 30 d+), sort, a last-active column and a key-count column, and an Invite someone side sheet that replaces the Invites panel.
  • API keys (/app/api-keys) is its own page for the signed-in person's own keys.
  • Sharing lists devices, remotes and invites only; cluster workers moved to Workers. A P2P settings link keeps working.
  • Placement has plain wording for the policy and shows how a lost worker was connected.
  • New cluster and admin i18n namespaces. Nine locales are machine translated (see below).
  • Docs follow the renames (Workers, Administration > Access).

Already on master earlier in this series

Administration sidebar and command palette (8b99ab3, a809ca0), the Overview page (9280153), and the join-token backend: admin API to mint tokens (247597a), workers that join with a token and hold a per-node credential (bf3ce1e), join scripts and the installer worker mode (b979ec7, 4676bbc), docs (073b7e9). This PR is the UI that sits on top of them.

Proposed backend changes: please review

Both are admin-only additions to GET /api/auth/admin/users. No other endpoint returns them.

  • users.last_active_at (nullable, indexed, added by AutoMigrate). Only the time of a person's last authenticated request is recorded: no address, user agent or path. It is written at most once per 5 minutes per user (an in-process check plus a conditional UPDATE ... WHERE last_active_at IS NULL OR last_active_at < now - 5m, so several frontends on one database also write once per window). The write uses UpdateColumn, so updated_at does not move. A failed write is logged and never fails the request. Requests made with a paired client key do not count as the person's activity. Deleting a user drops its in-process entry.
  • apiKeyCount: a count of the user's keys (client keys excluded), computed in one grouped query. Never the keys or their names. LocalAI still lists a person's keys only to that person.

The handler moved out of the route file into AdminListUsersHandler so it can be tested; behaviour is otherwise unchanged. Documented in administration/authentication.md.

Breaking changes

  • The shared registration token no longer authenticates a worker's heartbeat, drain or deregister calls: those need the per-node credential a worker gets when it joins with a join token. Workers started before this series must be updated; there is no mixed-version support.
  • UI: the Cluster transport panel, the Invites panel and the combined Users and keys page are gone; their functions are on Workers, the Users invite sheet and API keys.

How it was verified

  • go build -tags nosqlite,purego_utp on ./core/... ./cmd/..., go vet and golangci-lint on the touched packages, and Go tests for core/http/auth, core/http/routes, core/http/endpoints/localai, core/services/nodes, core/cli/...: all pass.
  • UI: lint:ui-kit, lint:colours, lint:inline-styles, eslint, i18n-check, the UI unit tests.
  • Playwright: the full suite (4139 tests), the @production-chunks specs against the production bundle, and the coverage ratchet (line coverage 91.69%, above its baseline). Two other specs failed once under load and passed on three repeats.
  • Screenshots of Workers, Add worker step 2, Settings > Cluster, Users, Sharing, Placement and Overview, light and dark, desktop and phone, checked against the design mock.

Not verified

  • A real cluster and a real worker joining through the new flow; every test uses stubbed APIs.
  • The install scripts on real machines, and anything on Windows or macOS.
  • The nine machine-made translations have had no native-speaker review.
  • Overview "Update all" and the Access card rows (skipped in the e2e suite).
  • The new users.last_active_at column was only run through SQLite (AutoMigrate); the PostgreSQL migration was not run.
  • Seven e2e specs fail identically on a clean checkout of master and are untouched here: local-machine (2), page-header-no-crumb (activity), updates-models (2) and updates-addon-queue (2). They still look for elements of the pre-Overview pages (operate-row-running, operate-updates-badge, an H1 as first child of the header).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DjrQyi41PW4ZXftzYw9C2u

Replace the cluster transport block at the top of the Workers page with
one form that is drawn in two places: a side sheet opened by a "Cluster
settings" button on the Workers page, and a Cluster group in the
Settings rail that shows only when the cluster is enabled.

The form has four sections: the broadcast bus and the frontends, the
NATS address and the address given to workers (with the reachability
result of the save), three sliders for the connection preference
weights with a live sentence, and a Joining section with the
auto-approve switch, which is off by default. Settings search finds the
sections that match, so "nats" and "weight" both lead to it.

The words say "connection" where the old panel said "carrier", and every
string is translated. Remove the old ClusterTransport and CarrierWeights
components, their styles and their spec.

Assisted-by: Claude:claude-sonnet-5-5 playwright
Rebuild the Workers page on the Administration page template. The header
shows the connectivity of the frontends in a compact pill ("NATS
connected · 2 frontends") and two buttons, Cluster settings and Add
worker. A slim strip under it replaces the fleet card: workers online,
models loaded, requests in flight and what needs attention.

One roster lists every machine of the cluster whatever way it connects.
Each row has a chip for every connection the worker holds (NATS,
WebSocket, P2P with its path and round trip), a failing route is a
warning chip with the reason the worker gave, and a limited relay is
marked. Model-split workers are rows of the same roster, marked as such,
so the panel at the bottom is gone from the cluster view; a single
install keeps it under the machine. The filter bar carries the search,
the health chips, a Filters popover and the sort.

The inspector on the right shows the health of each connection with its
weight, the models, the labels and the actions of the state (approve,
drain, resume, update, remove). A model-split worker has its own
inspector with the node it is attached to, the slow path choice, the
relay limits and the revoke.

Remove the old node list, inspector, fleet card, route badge and sparkline
and their words, and lower the translation baseline accordingly.

Assisted-by: Claude:claude-sonnet-5-5 playwright
Replace the "Add a node" page with a three-step Add worker flow. Step 1
lets the admin pick the connections of the worker as cards: NATS is
offered only when it is set up, P2P only when sharing is on, and an
unavailable way is disabled with its reason and a link to fix it. Step 2
mints a join token through the real API for the chosen connections and
shows the commands the server returns in tabs (install script with a
Windows choice, Docker, Docker Compose, Kubernetes and Manual). The token
is hidden on the page and whole in the copy. The page counts down to the
expiry, lets the admin choose how many workers may use the token and for
how long, mints a new one on request and revokes the one it replaces. A
P2P worker gets its link from the existing invite API. Step 3 waits by
diffing the roster and, once a worker arrives, says how many uses of the
token are left.

The model-split worker keeps its entry point on step 1 and its own steps.
A single install still starts with turning distributed mode on.

Remove the old flow, its route badge and its words, and replace its specs
with ones that cover every connection set, the tabs, the uses and expiry
choices, the countdown, waiting and found, and a phone width.

Assisted-by: Claude:claude-sonnet-5-5 playwright
The worker rows fold into two lines when their card is narrower than 700
px instead of 760 px, so a laptop screen with the inspector open keeps
the column layout. The state column is wider, and a state that still does
not fit is cut with an ellipsis and carries its words in a title.

Assisted-by: Claude:claude-sonnet-5-5 playwright
The Users page needs two facts per person: when they last made an
authenticated request, and how many API keys they hold.

users.last_active_at is set from the auth middleware for a session or a
user API key. A write happens at most once per five minutes per person:
an in-process map answers a burst of requests with one comparison, and
the UPDATE is conditional on the stored time, so several frontends on one
database also write once per window. It uses UpdateColumn, so updated_at
is not touched. A paired client key does not count, since it is a device
and not the person. Nothing else is stored: no address, agent or path.

The column is added by AutoMigrate on SQLite and PostgreSQL. The admin
users list now carries lastActiveAt and apiKeyCount. The count comes from
one grouped query and never names or returns a key. The handler moves out
of the route table into AdminListUsersHandler so the route tests run the
real code. Only administrators can call it.

Docs: say what is recorded, and use the Administration names for the
Users and API keys pages.

Assisted-by: Claude:claude-sonnet-5-5 Ginkgo
…ys on a page

The Users page now uses AdminPage and AdminFilterBar as the mock shows:
a summary strip, search, the chips All, Pending, Admins, Disabled and
Inactive 30 d+, a Filters popover (sign-in method, custom access) and a
sort that also orders by last active and by key count. The table gains
Last active and Keys, and the access sheet an Activity block. Both
fields come from the admin users list and are shown to administrators
only.

The Users, Invites and API keys tabs are gone. Invite someone is the
page's one primary action and opens a side sheet with the link generator
over the table of invites. API keys is a page of its own under Access,
at /app/api-keys; the old ?tab=keys and ?tab=invites addresses still
lead to it and to the sheet. The empty, no-match, load-failed and
refresh-failed states follow the States screen: a failed refresh keeps
the list under an error banner.

The strings of the page, the sheet and the dialogs move to the admin
namespace in all ten locales.

Assisted-by: Claude:claude-sonnet-5-5 Playwright
Sharing lists what other people hold on this server: the invites and the
paired devices and remotes. A worker or model-split worker that joined
over P2P is a worker of the cluster, so its rows no longer appear in the
invite and device lists; a note says that workers that joined over P2P
are on Workers and links there, on a cluster and wherever the page hid
some.

The page moves onto AdminPage, with the breadcrumb and Share this
instance as its one primary action. A short state row says that sharing
is on, shows the share address with a copy button and links to the P2P
settings, where the mode and the relays are set. The Federation and
Settings sub-routes are unchanged.

Assisted-by: Claude:claude-sonnet-5-5 Playwright
…onnection

A rule's routing policy was worded as a route ("It is routed by prefix
cache", "Default routing"), which reads like the connection a worker
has to the cluster. It now says policy: "Its policy is prefix cache",
"Default policy", "Policy only". The translations of those keys change
with it.

New rule is the header action of Placement, on the Rules view only, as
in the mock. The failover banner for a lost worker also lists how that
worker was connected (NATS, WebSocket, P2P with its path), from what the
worker last reported; a worker that reported nothing shows no line.

Two existing specs are fixed: the rule spec looked for the sidebar link
by its old name, and the scheduling spec's Model label matched the
sidebar group too.

Assisted-by: Claude:claude-sonnet-5-5 Playwright
…ment specs

Assisted-by: Claude:claude-sonnet-5-5 Playwright
# Conflicts:
#	core/http/react-ui/i18n-baseline.json
The Workers roster work removed NodeRoute and its styles while the
Failover page still imported it, so the merged tree did not build. Draw
the lost worker's connections with ConnectionChips instead, from the same
route state the roster reads.

Assisted-by: Claude Code:claude-sonnet-5-5
The pages were renamed by the admin redesign, but the install guide, the
model-split and migration guides, the backends page and three UI strings
still pointed at the Nodes page and Users and keys.

Assisted-by: Claude Code:claude-sonnet-5-5
The add-on locale bundles must repeat the host strings, and a unit test
checks that they do. Leave this string as it was.

Assisted-by: Claude Code:claude-sonnet-5-5
Assisted-by: Claude Code:claude-sonnet-5-5
The Overview redesign removed the "Running now" row, the Operate updates
badge on the Administration pages and the plain header of an
Administration page. Four specs still looked for them.

- local-machine: check the Overview's machine or cluster card (title,
  loaded models, memory, link to the full view) instead of the removed
  running-models preview.
- page-header-no-crumb: an Administration page opens its header with the
  breadcrumb trail, then the title; other pages still open with the title.
- updates-models: read the update count from the Updates item of the
  Administration sidebar.
- updates-addon-queue: leave the Updates page with the "Back to LocalAI"
  link, as the Administration sidebar has no Home link.

Assisted-by: Claude:claude-sonnet-5-5 Playwright
@mudler
mudler merged commit 1f37544 into master Nov 22, 2026
79 of 80 checks passed
@mudler
mudler deleted the feat/admin-redesign branch November 22, 2026 07:33
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.

2 participants