feat: support configuring aliyun resource group id

This commit is contained in:
Fu Diwei
2025-05-27 21:04:25 +08:00
parent b8b94dfd77
commit df1f216b5b
26 changed files with 186 additions and 82 deletions

View File

@@ -28,14 +28,15 @@ const AccessFormAliyunConfig = ({ form: formInst, formName, disabled, initialVal
const formSchema = z.object({
accessKeyId: z
.string()
.trim()
.min(1, t("access.form.aliyun_access_key_id.placeholder"))
.max(64, t("common.errmsg.string_max", { max: 64 }))
.trim(),
.max(64, t("common.errmsg.string_max", { max: 64 })),
accessKeySecret: z
.string()
.trim()
.min(1, t("access.form.aliyun_access_key_secret.placeholder"))
.max(64, t("common.errmsg.string_max", { max: 64 }))
.trim(),
.max(64, t("common.errmsg.string_max", { max: 64 })),
resourceGroupId: z.string().nullish(),
});
const formRule = createSchemaFieldRule(formSchema);
@@ -69,6 +70,24 @@ const AccessFormAliyunConfig = ({ form: formInst, formName, disabled, initialVal
>
<Input.Password autoComplete="new-password" placeholder={t("access.form.aliyun_access_key_secret.placeholder")} />
</Form.Item>
<Form.Item
name="securityToken"
label={t("access.form.aliyun_security_token.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.aliyun_security_token.tooltip") }}></span>}
>
<Input allowClear autoComplete="new-password" placeholder={t("access.form.aliyun_security_token.placeholder")} />
</Form.Item>
<Form.Item
name="resourceGroupId"
label={t("access.form.aliyun_resource_group_id.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.aliyun_resource_group_id.tooltip") }}></span>}
>
<Input allowClear autoComplete="new-password" placeholder={t("access.form.aliyun_resource_group_id.placeholder")} />
</Form.Item>
</Form>
);
};

View File

@@ -36,11 +36,7 @@ const AccessFormHuaweiCloudConfig = ({ form: formInst, formName, disabled, initi
.trim()
.min(1, t("access.form.huaweicloud_secret_access_key.placeholder"))
.max(64, t("common.errmsg.string_max", { max: 64 })),
enterpriseProjectId: z
.string()
.trim()
.max(64, t("common.errmsg.string_max", { max: 64 }))
.nullish(),
enterpriseProjectId: z.string().nullish(),
});
const formRule = createSchemaFieldRule(formSchema);