swarm-ui: link a gitlab account to an agent
This commit is contained in:
parent
b7d8c0dfc0
commit
3e5b5b54a2
1 changed files with 240 additions and 56 deletions
|
|
@ -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);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue