feat: support configuring aliyun resource group id
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ export type AccessConfigForACMEHttpReq = {
|
||||
export type AccessConfigForAliyun = {
|
||||
accessKeyId: string;
|
||||
accessKeySecret: string;
|
||||
resourceGroupId?: string;
|
||||
};
|
||||
|
||||
export type AccessConfigForAWS = {
|
||||
|
||||
@@ -69,6 +69,9 @@
|
||||
"access.form.aliyun_access_key_secret.label": "Aliyun AccessKeySecret",
|
||||
"access.form.aliyun_access_key_secret.placeholder": "Please enter Aliyun AccessKeySecret",
|
||||
"access.form.aliyun_access_key_secret.tooltip": "For more information, see <a href=\"https://www.alibabacloud.com/help/en/acr/create-and-obtain-an-accesskey-pair\" target=\"_blank\">https://www.alibabacloud.com/help/en/acr/create-and-obtain-an-accesskey-pair</a>",
|
||||
"access.form.aliyun_resource_group_id.label": "Aliyun resource group ID (Optional)",
|
||||
"access.form.aliyun_resource_group_id.placeholder": "Please enter Aliyun resource group ID",
|
||||
"access.form.aliyun_resource_group_id.tooltip": "For more information, see <a href=\"https://www.alibabacloud.com/help/en/resource-management/product-overview\" target=\"_blank\">https://www.alibabacloud.com/help/en/resource-management/product-overview</a>",
|
||||
"access.form.aws_access_key_id.label": "AWS AccessKeyId",
|
||||
"access.form.aws_access_key_id.placeholder": "Please enter AWS AccessKeyId",
|
||||
"access.form.aws_access_key_id.tooltip": "For more information, see <a href=\"https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/id_credentials_access-keys.html\" target=\"_blank\">https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/id_credentials_access-keys.html</a>",
|
||||
|
||||
@@ -69,6 +69,9 @@
|
||||
"access.form.aliyun_access_key_secret.label": "阿里云 AccessKeySecret",
|
||||
"access.form.aliyun_access_key_secret.placeholder": "请输入阿里云 AccessKeySecret",
|
||||
"access.form.aliyun_access_key_secret.tooltip": "这是什么?请参阅 <a href=\"https://help.aliyun.com/zh/ram/user-guide/create-an-accesskey-pair\" target=\"_blank\">https://help.aliyun.com/zh/ram/user-guide/create-an-accesskey-pair</a>",
|
||||
"access.form.aliyun_resource_group_id.label": "阿里云资源组 ID(可选)",
|
||||
"access.form.aliyun_resource_group_id.placeholder": "请输入阿里云资源组 ID",
|
||||
"access.form.aliyun_resource_group_id.tooltip": "这是什么?请参阅 <a href=\"https://help.aliyun.com/zh/resource-management/resource-group/product-overview\" target=\"_blank\">https://help.aliyun.com/zh/resource-management/resource-group/product-overview</a>",
|
||||
"access.form.aws_access_key_id.label": "AWS AccessKeyId",
|
||||
"access.form.aws_access_key_id.placeholder": "请输入 AWS AccessKeyId",
|
||||
"access.form.aws_access_key_id.tooltip": "这是什么?请参阅 <a href=\"https://docs.aws.amazon.com/zh_cn/IAM/latest/UserGuide/id_credentials_access-keys.html\" target=\"_blank\">https://docs.aws.amazon.com/zh_cn/IAM/latest/UserGuide/id_credentials_access-keys.html</a>",
|
||||
|
||||
Reference in New Issue
Block a user