feat: configure k8s secret type
This commit is contained in:
@@ -45,6 +45,10 @@ const DeployNodeFormAliyunCLBFields = () => {
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const formInst = Form.useFormInstance();
|
||||
|
||||
const initialValues: Partial<z.infer<typeof formSchema>> = {
|
||||
listenerPort: 443,
|
||||
};
|
||||
|
||||
const fieldResourceType = Form.useWatch("resourceType", formInst);
|
||||
|
||||
return (
|
||||
@@ -84,7 +88,7 @@ const DeployNodeFormAliyunCLBFields = () => {
|
||||
label={t("workflow_node.deploy.form.aliyun_clb_listener_port.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.aliyun_clb_listener_port.tooltip") }}></span>}
|
||||
initialValue={443}
|
||||
initialValue={initialValues.listenerPort}
|
||||
>
|
||||
<Input type="number" min={1} max={65535} placeholder={t("workflow_node.deploy.form.aliyun_clb_listener_port.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
@@ -17,6 +17,11 @@ const DeployNodeFormKubernetesSecretFields = () => {
|
||||
.nonempty(t("workflow_node.deploy.form.k8s_secret_name.placeholder"))
|
||||
.max(256, t("common.errmsg.string_max", { max: 256 }))
|
||||
.trim(),
|
||||
secretType: z
|
||||
.string({ message: t("workflow_node.deploy.form.k8s_secret_type.placeholder") })
|
||||
.nonempty(t("workflow_node.deploy.form.k8s_secret_type.placeholder"))
|
||||
.max(256, t("common.errmsg.string_max", { max: 256 }))
|
||||
.trim(),
|
||||
secretDataKeyForCrt: z
|
||||
.string({ message: t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.placeholder") })
|
||||
.nonempty(t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.placeholder"))
|
||||
@@ -30,6 +35,13 @@ const DeployNodeFormKubernetesSecretFields = () => {
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const initialValues: Partial<z.infer<typeof formSchema>> = {
|
||||
namespace: "default",
|
||||
secretType: "kubernetes.io/tls",
|
||||
secretDataKeyForCrt: "tls.crt",
|
||||
secretDataKeyForKey: "tls.key",
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item
|
||||
@@ -37,7 +49,7 @@ const DeployNodeFormKubernetesSecretFields = () => {
|
||||
label={t("workflow_node.deploy.form.k8s_namespace.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.k8s_namespace.tooltip") }}></span>}
|
||||
initialValue="default"
|
||||
initialValue={initialValues.namespace}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.k8s_namespace.placeholder")} />
|
||||
</Form.Item>
|
||||
@@ -51,12 +63,22 @@ const DeployNodeFormKubernetesSecretFields = () => {
|
||||
<Input placeholder={t("workflow_node.deploy.form.k8s_secret_name.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="secretType"
|
||||
label={t("workflow_node.deploy.form.k8s_secret_type.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.k8s_secret_type.tooltip") }}></span>}
|
||||
initialValue={initialValues.secretType}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.k8s_secret_type.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="secretDataKeyForCrt"
|
||||
label={t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.tooltip") }}></span>}
|
||||
initialValue="tls.crt"
|
||||
initialValue={initialValues.secretDataKeyForCrt}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.k8s_secret_data_key_for_crt.placeholder")} />
|
||||
</Form.Item>
|
||||
@@ -66,7 +88,7 @@ const DeployNodeFormKubernetesSecretFields = () => {
|
||||
label={t("workflow_node.deploy.form.k8s_secret_data_key_for_key.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.k8s_secret_data_key_for_key.tooltip") }}></span>}
|
||||
initialValue="tls.key"
|
||||
initialValue={initialValues.secretDataKeyForKey}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.k8s_secret_data_key_for_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
@@ -71,6 +71,13 @@ const DeployNodeFormLocalFields = () => {
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const formInst = Form.useFormInstance();
|
||||
|
||||
const initialValues: Partial<z.infer<typeof formSchema>> = {
|
||||
format: FORMAT_PEM,
|
||||
certPath: "/etc/ssl/certs/cert.crt",
|
||||
keyPath: "/etc/ssl/certs/cert.key",
|
||||
shellEnv: SHELLENV_SH,
|
||||
};
|
||||
|
||||
const fieldFormat = Form.useWatch("format", formInst);
|
||||
const fieldCertPath = Form.useWatch("certPath", formInst);
|
||||
|
||||
@@ -183,7 +190,7 @@ Remove-Item -Path "$pfxPath" -Force
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item name="format" label={t("workflow_node.deploy.form.local_format.label")} rules={[formRule]} initialValue={FORMAT_PEM}>
|
||||
<Form.Item name="format" label={t("workflow_node.deploy.form.local_format.label")} rules={[formRule]} initialValue={initialValues.format}>
|
||||
<Select placeholder={t("workflow_node.deploy.form.local_format.placeholder")} onSelect={handleFormatSelect}>
|
||||
<Select.Option key={FORMAT_PEM} value={FORMAT_PEM}>
|
||||
{t("workflow_node.deploy.form.local_format.option.pem.label")}
|
||||
@@ -202,7 +209,7 @@ Remove-Item -Path "$pfxPath" -Force
|
||||
label={t("workflow_node.deploy.form.local_cert_path.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.local_cert_path.tooltip") }}></span>}
|
||||
initialValue="/etc/ssl/certs/cert.crt"
|
||||
initialValue={initialValues.certPath}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.local_cert_path.placeholder")} />
|
||||
</Form.Item>
|
||||
@@ -213,7 +220,7 @@ Remove-Item -Path "$pfxPath" -Force
|
||||
label={t("workflow_node.deploy.form.local_key_path.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.local_key_path.tooltip") }}></span>}
|
||||
initialValue="/etc/ssl/certs/cert.key"
|
||||
initialValue={initialValues.keyPath}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.local_key_path.placeholder")} />
|
||||
</Form.Item>
|
||||
@@ -259,7 +266,7 @@ Remove-Item -Path "$pfxPath" -Force
|
||||
</Form.Item>
|
||||
</Show>
|
||||
|
||||
<Form.Item name="shellEnv" label={t("workflow_node.deploy.form.local_shell_env.label")} rules={[formRule]} initialValue={SHELLENV_SH}>
|
||||
<Form.Item name="shellEnv" label={t("workflow_node.deploy.form.local_shell_env.label")} rules={[formRule]} initialValue={initialValues.shellEnv}>
|
||||
<Select placeholder={t("workflow_node.deploy.form.local_shell_env.placeholder")}>
|
||||
<Select.Option key={SHELLENV_SH} value={SHELLENV_SH}>
|
||||
{t("workflow_node.deploy.form.local_shell_env.option.sh.label")}
|
||||
|
||||
@@ -64,6 +64,12 @@ const DeployNodeFormSSHFields = () => {
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const formInst = Form.useFormInstance();
|
||||
|
||||
const initialValues: Partial<z.infer<typeof formSchema>> = {
|
||||
format: FORMAT_PEM,
|
||||
certPath: "/etc/ssl/certs/cert.crt",
|
||||
keyPath: "/etc/ssl/certs/cert.key",
|
||||
};
|
||||
|
||||
const fieldFormat = Form.useWatch("format", formInst);
|
||||
const fieldCertPath = Form.useWatch("certPath", formInst);
|
||||
|
||||
@@ -109,7 +115,7 @@ const DeployNodeFormSSHFields = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item name="format" label={t("workflow_node.deploy.form.ssh_format.label")} rules={[formRule]} initialValue={FORMAT_PEM}>
|
||||
<Form.Item name="format" label={t("workflow_node.deploy.form.ssh_format.label")} rules={[formRule]} initialValue={initialValues.format}>
|
||||
<Select placeholder={t("workflow_node.deploy.form.ssh_format.placeholder")} onSelect={handleFormatSelect}>
|
||||
<Select.Option key={FORMAT_PEM} value={FORMAT_PEM}>
|
||||
{t("workflow_node.deploy.form.ssh_format.option.pem.label")}
|
||||
@@ -128,7 +134,7 @@ const DeployNodeFormSSHFields = () => {
|
||||
label={t("workflow_node.deploy.form.ssh_cert_path.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_cert_path.tooltip") }}></span>}
|
||||
initialValue="/etc/ssl/certs/cert.crt"
|
||||
initialValue={initialValues.certPath}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.ssh_cert_path.placeholder")} />
|
||||
</Form.Item>
|
||||
@@ -139,7 +145,7 @@ const DeployNodeFormSSHFields = () => {
|
||||
label={t("workflow_node.deploy.form.ssh_key_path.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_key_path.tooltip") }}></span>}
|
||||
initialValue="/etc/ssl/certs/cert.key"
|
||||
initialValue={initialValues.keyPath}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.ssh_key_path.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user