Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: link a gitlab account to an agent

This commit is contained in:
atlas 2026-11-02 17:27:48 +01:00 • committed by mara
commit 3e5b5b54a2

View file

@ -98,6 +98,7 @@ export function useAgentActions(
const [customTarget, setCustomTarget] = useState<AgentRow | null>(null);
const [matrixTarget, setMatrixTarget] = useState<AgentRow | null>(null);
const [forgeTarget, setForgeTarget] = useState<AgentRow | null>(null);
const [gitlabTarget, setGitlabTarget] = useState<AgentRow | null>(null);
const [githubTarget, setGithubTarget] = useState<AgentRow | null>(null);
const [backendTarget, setBackendTarget] = useState<AgentRow | null>(null);
const [linkVersion, setLinkVersion] = useState(0);
@ -111,6 +112,10 @@ export function useAgentActions(
setForgeTarget(null);
linkClosed();
};
const closeGitlab = () => {
setGitlabTarget(null);
linkClosed();
};
const closeGithub = () => {
setGithubTarget(null);
linkClosed();
@ -233,12 +238,28 @@ export function useAgentActions(
>
{forgeTarget?.hive ? (
<LinkForgeAccountForm
kind="forge"
hive={forgeTarget.hive}
agent={forgeTarget.name}
onClose={closeForge}
/>
) : null}
</Dialog>
<Dialog
open={gitlabTarget !== null}
onClose={closeGitlab}
label="link a gitlab account"
plain
>
{gitlabTarget?.hive ? (
<LinkForgeAccountForm
kind="gitlab"
hive={gitlabTarget.hive}
agent={gitlabTarget.name}
onClose={closeGitlab}
/>
) : null}
</Dialog>
<Dialog
open={githubTarget !== null}
onClose={closeGithub}
@ -330,6 +351,7 @@ export function useAgentActions(
openLink: (row, kind) => {
if (kind === "matrix") setMatrixTarget(row);
else if (kind === "forge") setForgeTarget(row);
else if (kind === "gitlab") setGitlabTarget(row);
else if (kind === "github") setGithubTarget(row);
else setBackendTarget(row);
},