fix: add agent
ci-front / build (push) Successful in 2m28s

This commit is contained in:
2026-04-04 05:46:01 +03:00
parent 11cef95929
commit d62205b329
3 changed files with 41 additions and 4 deletions
+4 -2
View File
@@ -17,6 +17,7 @@ import {
const createEmptyAgentConfig = (): SSHAgentConfig => ({
user: "",
ip: "",
port: 22,
authMethod: "key",
sshKey: "",
password: "",
@@ -52,7 +53,8 @@ export const AddAgentsPage: React.FC = () => {
// Валидация
const isValid = agents.every((agent) => {
if (!agent.user || !agent.ip) return false;
if (!agent.user || !agent.ip || !agent.port) return false;
if (agent.port < 1 || agent.port > 65535) return false;
if (agent.authMethod === "key" && !agent.sshKey) return false;
if (agent.authMethod === "password" && !agent.password) return false;
return true;
@@ -74,11 +76,11 @@ export const AddAgentsPage: React.FC = () => {
agentLabel: `${agent.ip}-${agent.user}`,
ip: agent.ip,
user: agent.user,
port: agent.port,
authMethod: agent.authMethod as "key" | "password",
deployType: (agent.deployType === "deploy"
? "docker"
: agent.deployType) as "docker" | "binary",
port: 22,
...(agent.authMethod === "key"
? { sshKey: agent.sshKey }
: { password: agent.password }),