Repository navigation
feat(ui): redesign cluster and access administration: Workers, Add worker, Users, Sharing - #13386
Merged
Merged
Conversation
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
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
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.
What this changes
Cluster and access administration move onto the Administration template (page header, filter bar, side sheets).
Workers
/app/nodesis 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).Access
/app/api-keys) is its own page for the signed-in person's own keys.clusterandadmini18n namespaces. Nine locales are machine translated (see below).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 conditionalUPDATE ... 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 usesUpdateColumn, soupdated_atdoes 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
AdminListUsersHandlerso it can be tested; behaviour is otherwise unchanged. Documented inadministration/authentication.md.Breaking changes
How it was verified
go build -tags nosqlite,purego_utpon./core/... ./cmd/...,go vetandgolangci-linton the touched packages, and Go tests forcore/http/auth,core/http/routes,core/http/endpoints/localai,core/services/nodes,core/cli/...: all pass.lint:ui-kit,lint:colours,lint:inline-styles, eslint,i18n-check, the UI unit tests.@production-chunksspecs 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.Not verified
users.last_active_atcolumn was only run through SQLite (AutoMigrate); the PostgreSQL migration was not run.local-machine(2),page-header-no-crumb(activity),updates-models(2) andupdates-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