swarm ui: an agent's named ssh connections show in its ssh popover, with add, replace and remove
The ssh popover of an opened agent card gets a folded connections section: a table of the agent's named connections (name, user@host:port) with edit and remove, and a form that saves one. The list is read on the first open; a save is a PUT that replaces a connection of the same name, so the button reads replace and a line names the connection when the name exists; remove asks first. The controller's refusal shows under the form as it comes, and the section says the connections are inactive while ssh is off. The request building is in ssh-connections.ts with a test; swarm-ui.md describes the section.
This commit is contained in:
parent
60af939514
commit
62551e004e
1 changed files with 462 additions and 2 deletions
|
|
@ -925,6 +925,20 @@ when the field changes and the agent signs on its next `ssh`. A `PUT`
|
|||
that leaves `ssh` out, and the `DELETE` of **use the default**, keep it. The
|
||||
controller attaches the signing policy to the agent's login role at once; see [the SSH CA](../swarm/ssh-ca.md#the-switch-and-the-signing-policy).
|
||||
|
||||
Below the checkbox, a folded **connections** section holds the agent's named SSH
|
||||
connections. Each is a `name; user; host; port` entry that becomes `ssh <name>` in
|
||||
the agent's ssh config, and its hive lets the agent reach that host and port. A
|
||||
connection only takes effect while **ssh** is on, and the section says so when the
|
||||
switch is off. The first time you open the section, it reads `GET
|
||||
/api/agents/{agent}/ssh-connections`. A table lists the connections as
|
||||
`user@host:port`, with **edit**, which fills the form, and **remove**, which asks
|
||||
first and then sends a `DELETE`. The form saves one connection with a `PUT`, which
|
||||
replaces a connection of the same name, so the button reads **replace** and a line
|
||||
names the connection when you type a name that one already has. The controller
|
||||
checks every field, and the form shows its refusal as it arrives. [The SSH CA
|
||||
page](../swarm/ssh-ca.md) has the rules. The card builds the requests in
|
||||
`frontend/packages/swarm-ui/src/agent/detail/ssh-connections.ts`.
|
||||
|
||||
A saved change isn't instant. The hive reads the grant about every 30 seconds
|
||||
and the agent takes it at its next turn. A change to `manage_root_agent`
|
||||
restarts the agent after its current turn. The card reads
|
||||
|
|
|
|||
Loading…
Reference in a new issue