diff --git a/docs/swarm/ui.md b/docs/swarm/ui.md index 860d38f68..14364b3ea 100644 --- a/docs/swarm/ui.md +++ b/docs/swarm/ui.md @@ -432,6 +432,11 @@ as optional `limits` and `inference` objects, the same shapes the two `PUT` routes take. The controller checks them with the `PUT` rules before it queues anything, so a bad value gets a refusal with its reason and creates no agent. +The dialog loads the hive list and the permission list when it opens. If either +load fails, the dialog shows the reason in an error panel above the fields, and +the hive picker or the permissions area reads `could not load hives` or +`could not load permissions` in place of `loading…`. + It stores them ahead of the job graph, before it declares the agent, so they are in place before the agent first runs. If the creation then fails, the controller puts back what it replaced. Each agent name keys its settings and diff --git a/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx b/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx index cb3c1f189..4fce32cc8 100644 --- a/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx +++ b/frontend/packages/swarm-ui/src/pages/CreateAgentForm.tsx @@ -309,7 +309,9 @@ export function CreateAgentForm({ disabled={!hivesReady} placeholder={ !hives - ? "loading…" + ? hivesError + ? "could not load hives" + : "loading…" : hives.length === 0 ? "no hives configured" : "select a hive" @@ -340,8 +342,8 @@ export function CreateAgentForm({ )} )} - -
+ +
{catalogue ? ( setSelected((s) => togglePermission(s, v))} /> ) : ( - loading… + + {catalogueError ? "could not load permissions" : "loading…"} + )}
diff --git a/frontend/packages/swarm-ui/src/ui/form-field/FormField.tsx b/frontend/packages/swarm-ui/src/ui/form-field/FormField.tsx index b93f9587a..dc6db9e2c 100644 --- a/frontend/packages/swarm-ui/src/ui/form-field/FormField.tsx +++ b/frontend/packages/swarm-ui/src/ui/form-field/FormField.tsx @@ -4,23 +4,36 @@ // don't each reinvent the label/spacing chrome; a bare labelled `
` // wrapper has no independent identity worth a `/components` entry of // its own. +// +// A control a `