@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -28,14 +28,15 @@ const AccessFormHuaweiCloudConfig = ({ form: formInst, formName, disabled, initi
|
||||
const formSchema = z.object({
|
||||
accessKeyId: z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1, t("access.form.huaweicloud_access_key_id.placeholder"))
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||
.trim(),
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretAccessKey: z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1, t("access.form.huaweicloud_secret_access_key.placeholder"))
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||
.trim(),
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
enterpriseProjectId: z.string().nullish(),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
@@ -69,6 +70,15 @@ const AccessFormHuaweiCloudConfig = ({ form: formInst, formName, disabled, initi
|
||||
>
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.huaweicloud_secret_access_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="enterpriseProjectId"
|
||||
label={t("access.form.huaweicloud_enterprise_project_id.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.huaweicloud_enterprise_project_id.tooltip") }}></span>}
|
||||
>
|
||||
<Input allowClear autoComplete="new-password" placeholder={t("access.form.huaweicloud_enterprise_project_id.placeholder")} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -224,7 +224,24 @@ const AccessFormWebhookConfig = ({ form: formInst, formName, disabled, initialVa
|
||||
);
|
||||
break;
|
||||
|
||||
case "serverchan":
|
||||
case "serverchan3":
|
||||
formInst.setFieldValue("url", "https://<your-serverchan-uid>.push.ft07.com/send/<your-serverchan-sendkey>.send");
|
||||
formInst.setFieldValue("method", "POST");
|
||||
formInst.setFieldValue("headers", "Content-Type: application/json");
|
||||
formInst.setFieldValue(
|
||||
"defaultDataForNotification",
|
||||
JSON.stringify(
|
||||
{
|
||||
title: "${SUBJECT}",
|
||||
desp: "${MESSAGE}",
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case "serverchanturbo":
|
||||
formInst.setFieldValue("url", "https://sctapi.ftqq.com/<your-serverchan-key>.send");
|
||||
formInst.setFieldValue("method", "POST");
|
||||
formInst.setFieldValue("headers", "Content-Type: application/json");
|
||||
@@ -329,9 +346,9 @@ const AccessFormWebhookConfig = ({ form: formInst, formName, disabled, initialVa
|
||||
<div className="text-right">
|
||||
<Dropdown
|
||||
menu={{
|
||||
items: ["bark", "ntfy", "gotify", "pushover", "pushplus", "serverchan", "common"].map((key) => ({
|
||||
items: ["bark", "ntfy", "gotify", "pushover", "pushplus", "serverchan3", "serverchanturbo", "common"].map((key) => ({
|
||||
key,
|
||||
label: t(`access.form.webhook_preset_data.option.${key}.label`),
|
||||
label: <span dangerouslySetInnerHTML={{ __html: t(`access.form.webhook_preset_data.option.${key}.label`) }}></span>,
|
||||
onClick: () => handlePresetDataForNotificationClick(key),
|
||||
})),
|
||||
}}
|
||||
|
||||
@@ -101,6 +101,7 @@ export type AccessConfigForACMEHttpReq = {
|
||||
export type AccessConfigForAliyun = {
|
||||
accessKeyId: string;
|
||||
accessKeySecret: string;
|
||||
resourceGroupId?: string;
|
||||
};
|
||||
|
||||
export type AccessConfigForAWS = {
|
||||
@@ -264,6 +265,7 @@ export type AccessConfigForHetzner = {
|
||||
export type AccessConfigForHuaweiCloud = {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
enterpriseProjectId?: string;
|
||||
};
|
||||
|
||||
export type AccessConfigForJDCloud = {
|
||||
|
||||
@@ -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>",
|
||||
@@ -252,6 +255,9 @@
|
||||
"access.form.huaweicloud_secret_access_key.label": "Huawei Cloud SecretAccessKey",
|
||||
"access.form.huaweicloud_secret_access_key.placeholder": "Please enter Huawei Cloud SecretAccessKey",
|
||||
"access.form.huaweicloud_secret_access_key.tooltip": "For more information, see <a href=\"https://support.huaweicloud.com/intl/en-us/usermanual-ca/ca_01_0003.html\" target=\"_blank\">https://support.huaweicloud.com/intl/en-us/usermanual-ca/ca_01_0003.html</a>",
|
||||
"access.form.huaweicloud_enterprise_project_id.label": "Huawei Cloud enterprise project ID (Optional)",
|
||||
"access.form.huaweicloud_enterprise_project_id.placeholder": "Please enter Huawei Cloud enterprise project ID",
|
||||
"access.form.huaweicloud_enterprise_project_id.tooltip": "For more information, see <a href=\"https://support.huaweicloud.com/intl/en-us/usermanual-em/em_03_0000.html\" target=\"_blank\">https://support.huaweicloud.com/intl/en-us/usermanual-em/em_03_0000.html</a>",
|
||||
"access.form.jdcloud_access_key_id.label": "JD Cloud AccessKeyId",
|
||||
"access.form.jdcloud_access_key_id.placeholder": "Please enter JD Cloud AccessKeyId",
|
||||
"access.form.jdcloud_access_key_id.tooltip": "For more information, see <a href=\"https://docs.jdcloud.com/en/account-management/accesskey-management\" target=\"_blank\">https://docs.jdcloud.com/en/account-management/accesskey-management</a>",
|
||||
@@ -459,7 +465,8 @@
|
||||
"access.form.webhook_preset_data.option.ntfy.label": "ntfy",
|
||||
"access.form.webhook_preset_data.option.pushover.label": "Pushover",
|
||||
"access.form.webhook_preset_data.option.pushplus.label": "PushPlus",
|
||||
"access.form.webhook_preset_data.option.serverchan.label": "ServerChan",
|
||||
"access.form.webhook_preset_data.option.serverchan3.label": "ServerChan<sup>3</sup>",
|
||||
"access.form.webhook_preset_data.option.serverchanturbo.label": "ServerChan<sup>Turbo</sup>",
|
||||
"access.form.webhook_preset_data.option.common.label": "General template",
|
||||
"access.form.wecombot_webhook_url.label": "WeCom bot Webhook URL",
|
||||
"access.form.wecombot_webhook_url.placeholder": "Please enter WeCom bot Webhook URL",
|
||||
|
||||
@@ -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>",
|
||||
@@ -252,6 +255,9 @@
|
||||
"access.form.huaweicloud_secret_access_key.label": "华为云 SecretAccessKey",
|
||||
"access.form.huaweicloud_secret_access_key.placeholder": "请输入华为云 SecretAccessKey",
|
||||
"access.form.huaweicloud_secret_access_key.tooltip": "这是什么?请参阅 <a href=\"https://support.huaweicloud.com/usermanual-ca/ca_01_0003.html\" target=\"_blank\">https://support.huaweicloud.com/usermanual-ca/ca_01_0003.html</a>",
|
||||
"access.form.huaweicloud_enterprise_project_id.label": "华为云企业项目 ID(可选)",
|
||||
"access.form.huaweicloud_enterprise_project_id.placeholder": "请输入华为云企业项目 ID",
|
||||
"access.form.huaweicloud_enterprise_project_id.tooltip": "这是什么?请参阅 <a href=\"https://support.huaweicloud.com/usermanual-em/zh-cn_topic_0126101490.html\" target=\"_blank\">https://support.huaweicloud.com/usermanual-em/zh-cn_topic_0126101490.html</a>",
|
||||
"access.form.jdcloud_access_key_id.label": "京东云 AccessKeyId",
|
||||
"access.form.jdcloud_access_key_id.placeholder": "请输入京东云 AccessKeyId",
|
||||
"access.form.jdcloud_access_key_id.tooltip": "这是什么?请参阅 <a href=\"https://docs.jdcloud.com/cn/account-management/accesskey-management\" target=\"_blank\">https://docs.jdcloud.com/cn/account-management/accesskey-management</a>",
|
||||
@@ -459,7 +465,8 @@
|
||||
"access.form.webhook_preset_data.option.ntfy.label": "ntfy",
|
||||
"access.form.webhook_preset_data.option.pushover.label": "Pushover",
|
||||
"access.form.webhook_preset_data.option.pushplus.label": "PushPlus 推送加",
|
||||
"access.form.webhook_preset_data.option.serverchan.label": "Server 酱",
|
||||
"access.form.webhook_preset_data.option.serverchan3.label": "Server 酱 <sup>3</sup>",
|
||||
"access.form.webhook_preset_data.option.serverchanturbo.label": "Server酱 <sup>Turbo</sup>",
|
||||
"access.form.webhook_preset_data.option.common.label": "通用模板",
|
||||
"access.form.wecombot_webhook_url.label": "企业微信群机器人 Webhook 地址",
|
||||
"access.form.wecombot_webhook_url.placeholder": "请输入企业微信群机器人 Webhook 地址",
|
||||
|
||||
Reference in New Issue
Block a user