feat: new deployment providers: ratpanel console & site
This commit is contained in:
@@ -63,6 +63,7 @@ import DeployNodeConfigFormQiniuCDNConfig from "./DeployNodeConfigFormQiniuCDNCo
|
||||
import DeployNodeConfigFormQiniuKodoConfig from "./DeployNodeConfigFormQiniuKodoConfig";
|
||||
import DeployNodeConfigFormQiniuPiliConfig from "./DeployNodeConfigFormQiniuPiliConfig";
|
||||
import DeployNodeConfigFormRainYunRCDNConfig from "./DeployNodeConfigFormRainYunRCDNConfig";
|
||||
import DeployNodeConfigFormRatPanelSiteConfig from "./DeployNodeConfigFormRatPanelSiteConfig";
|
||||
import DeployNodeConfigFormSafeLineConfig from "./DeployNodeConfigFormSafeLineConfig";
|
||||
import DeployNodeConfigFormSSHConfig from "./DeployNodeConfigFormSSHConfig.tsx";
|
||||
import DeployNodeConfigFormTencentCloudCDNConfig from "./DeployNodeConfigFormTencentCloudCDNConfig.tsx";
|
||||
@@ -273,6 +274,8 @@ const DeployNodeConfigForm = forwardRef<DeployNodeConfigFormInstance, DeployNode
|
||||
return <DeployNodeConfigFormQiniuPiliConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.RAINYUN_RCDN:
|
||||
return <DeployNodeConfigFormRainYunRCDNConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.RATPANEL_SITE:
|
||||
return <DeployNodeConfigFormRatPanelSiteConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.SAFELINE:
|
||||
return <DeployNodeConfigFormSafeLineConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.SSH:
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Form, type FormInstance, Input } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
type DeployNodeConfigFormRatPanelSiteConfigFieldValues = Nullish<{
|
||||
siteName: string;
|
||||
}>;
|
||||
|
||||
export type DeployNodeConfigFormRatPanelSiteConfigProps = {
|
||||
form: FormInstance;
|
||||
formName: string;
|
||||
disabled?: boolean;
|
||||
initialValues?: DeployNodeConfigFormRatPanelSiteConfigFieldValues;
|
||||
onValuesChange?: (values: DeployNodeConfigFormRatPanelSiteConfigFieldValues) => void;
|
||||
};
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormRatPanelSiteConfigFieldValues => {
|
||||
return {
|
||||
siteName: "",
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormRatPanelSiteConfig = ({
|
||||
form: formInst,
|
||||
formName,
|
||||
disabled,
|
||||
initialValues,
|
||||
onValuesChange,
|
||||
}: DeployNodeConfigFormRatPanelSiteConfigProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
siteName: z.string().nonempty(t("workflow_node.deploy.form.ratpanel_site_name.placeholder")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||
onValuesChange?.(values);
|
||||
};
|
||||
|
||||
return (
|
||||
<Form
|
||||
form={formInst}
|
||||
disabled={disabled}
|
||||
initialValues={initialValues ?? initFormModel()}
|
||||
layout="vertical"
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item
|
||||
name="siteName"
|
||||
label={t("workflow_node.deploy.form.ratpanel_site_name.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ratpanel_site_name.tooltip") }}></span>}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.ratpanel_site_name.placeholder")} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeployNodeConfigFormRatPanelSiteConfig;
|
||||
@@ -68,7 +68,12 @@ const DeployNodeConfigFormSafeLineConfig = ({ form: formInst, formName, disabled
|
||||
</Form.Item>
|
||||
|
||||
<Show when={fieldResourceType === RESOURCE_TYPE_CERTIFICATE}>
|
||||
<Form.Item name="certificateId" label={t("workflow_node.deploy.form.safeline_certificate_id.label")} rules={[formRule]}>
|
||||
<Form.Item
|
||||
name="certificateId"
|
||||
label={t("workflow_node.deploy.form.safeline_certificate_id.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.safeline_certificate_id.tooltip") }}></span>}
|
||||
>
|
||||
<Input type="number" placeholder={t("workflow_node.deploy.form.safeline_certificate_id.placeholder")} />
|
||||
</Form.Item>
|
||||
</Show>
|
||||
|
||||
Reference in New Issue
Block a user