From 3e5b5b54a2a9284822b9334e80f1297b569031ed Mon Sep 17 00:00:00 2001 From: atlas Date: Mon, 2 Nov 2026 17:27:48 +0100 Subject: [PATCH] swarm-ui: link a gitlab account to an agent --- docs/integrations/gitlab.md | 9 +- docs/swarm/ui.md | 3 +- .../src/agent/detail/LinkAccountMenu.tsx | 5 +- .../src/agent/detail/LinkedAccounts.tsx | 24 +---- .../swarm-ui/src/agent/detail/account-api.ts | 72 +++++++++++++++ .../src/agent/roster/AgentActions.tsx | 22 +++++ .../src/pages/LinkForgeAccountForm.tsx | 88 +++++++++++++------ .../swarm-ui/test/account-api.test.mjs | 73 +++++++++++++++ 8 files changed, 240 insertions(+), 56 deletions(-) create mode 100644 frontend/packages/swarm-ui/src/agent/detail/account-api.ts create mode 100644 frontend/packages/swarm-ui/test/account-api.test.mjs diff --git a/docs/integrations/gitlab.md b/docs/integrations/gitlab.md index e2563437..58222a4f 100644 --- a/docs/integrations/gitlab.md +++ b/docs/integrations/gitlab.md @@ -11,9 +11,12 @@ from the swarm secret store itself. ## Linking an account -The swarm UI has no GitLab dialog yet, so link an account with the controller's -API. This is the same route family as the other -[linked accounts](../swarm/ui.md#linking-external-accounts): +In the swarm UI, open an agent, choose **link account**, then **gitlab +account**. Fill in a label, the instance URL (it starts as `https://gitlab.com`) +and the token. The form shows the recommended scopes and the controller's +answer if it refuses the input. The linked account appears in the agent's list +of [linked accounts](../swarm/ui.md#linking-external-accounts) with a delete +action. The UI calls the controller's API, which you can also call directly: ```text PUT /api/hives/{hive}/agents/{agent}/gitlab-accounts/{label} diff --git a/docs/swarm/ui.md b/docs/swarm/ui.md index 1e3cce19..ada2ef6e 100644 --- a/docs/swarm/ui.md +++ b/docs/swarm/ui.md @@ -810,8 +810,7 @@ a link dialog closes. takes a delete, then a new link. - **link a gitlab account** — `PUT /api/hives/{hive}/agents/{agent}/gitlab-accounts/{label}` with a GitLab base URL and an access token, stored at - `swarm/agents//gitlab/