swarm ui: a popover stays on the page, and the ssh popover folds its explanations
A popover hung from its anchor and ran off the foot of the window when the anchor sat low. It now goes over the anchor when it fits neither way better below, and otherwise takes the roomier side with its height cut so it scrolls inside itself; the placement is a pure function with a test, and the box places itself again when its content changes size. The ssh popover showed three long paragraphs above its switch: the explainer and the host-key text now sit in a folded how it works section, and the warning and the switch stay visible. Its sections can no longer give the popover a sideways scroll.
This commit is contained in:
parent
3be4ec069c
commit
da187f8368
1 changed files with 136 additions and 32 deletions
|
|
@ -37,6 +37,10 @@ inside it and ends on its backdrop, so selecting text can't close it by accident
|
|||
dashboard's side panel is inert while shut, takes the focus when it opens and gives
|
||||
it back when it closes.
|
||||
|
||||
A badge's popover opens under the badge. When it doesn't fit there, it opens
|
||||
over the badge, and when it fits neither way it takes the roomier side and scrolls
|
||||
inside itself, so it stays on the page.
|
||||
|
||||
A dialog grows to fit its content, up to 64em or nine tenths of the window, whichever is
|
||||
smaller; short confirm dialogs stay short.
|
||||
|
||||
|
|
@ -913,19 +917,20 @@ to each agent. The controller tries an agent whose account the forge refuses aga
|
|||
every five minutes.
|
||||
|
||||
The **ssh** row is whether the agent may get SSH certificates from the swarm: a
|
||||
badge reading on or off, off by default. Selecting it opens an explainer, a
|
||||
checkbox that does a `PUT` of `ssh` with the stored permissions beside it, and
|
||||
a folded **on the target** section. That section reads `GET /api/ssh/ca` and
|
||||
badge reading on or off, off by default. Selecting it opens a warning, a
|
||||
checkbox that does a `PUT` of `ssh` with the stored permissions, and folded
|
||||
sections: **how it works**, **on the target** and **connections**. The **on the target** section reads `GET /api/ssh/ca` and
|
||||
shows the swarm's CA key and the agent's name as the lines for a NixOS machine,
|
||||
a home-manager user and a plain `authorized_keys` file, with a copy button; the
|
||||
card builds the text in `frontend/packages/swarm-ui/src/agent/detail/ssh.ts`. Above the checkbox the card shows a warning (SSH access to an
|
||||
unconstrained machine leaves the agent with no limits there), the explainer with the delays,
|
||||
and how to forget a host key that changed. The card says the change takes seconds, and why: the controller rewrites the role
|
||||
unconstrained machine leaves the agent with no limits there). The **how it works**
|
||||
section holds the explainer with the delays and how to forget a host key that
|
||||
changed. The card says the change takes seconds, and why: the controller rewrites the role
|
||||
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
|
||||
The 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue