feat: allow fallback to use scp on deployment to ssh

This commit is contained in:
Fu Diwei
2025-01-23 23:47:37 +08:00
parent 5ee5460612
commit 9f7cffce21
9 changed files with 69 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";
import { DownOutlined as DownOutlinedIcon } from "@ant-design/icons";
import { Button, Dropdown, Form, type FormInstance, Input, Select } from "antd";
import { Button, Dropdown, Form, type FormInstance, Input, Select, Switch } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";
@@ -17,6 +17,7 @@ type DeployNodeConfigFormSSHConfigFieldValues = Nullish<{
jksStorepass?: string | null;
preCommand?: string | null;
postCommand?: string | null;
useSCP?: boolean;
}>;
export type DeployNodeConfigFormSSHConfigProps = {
@@ -89,6 +90,7 @@ const DeployNodeConfigFormSSHConfig = ({ form: formInst, formName, disabled, ini
.string()
.max(20480, t("common.errmsg.string_max", { max: 20480 }))
.nullish(),
useSCP: z.boolean().nullish(),
});
const formRule = createSchemaFieldRule(formSchema);
@@ -261,6 +263,15 @@ const DeployNodeConfigFormSSHConfig = ({ form: formInst, formName, disabled, ini
<Input.TextArea autoSize={{ minRows: 1, maxRows: 5 }} placeholder={t("workflow_node.deploy.form.ssh_post_command.placeholder")} />
</Form.Item>
</Form.Item>
<Form.Item
name="useSCP"
label={t("workflow_node.deploy.form.ssh_use_scp.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_use_scp.tooltip") }}></span>}
>
<Switch />
</Form.Item>
</Form>
);
};