mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-13 21:01:32 +08:00
feat: add preset webhook data for messagenest, wxpush and pushme
This commit is contained in:
parent
79f6d78d0e
commit
edb858cfec
@ -97,6 +97,24 @@ const AccessConfigFormFieldsProviderWebhook = ({ usage = "none" }: AccessConfigF
|
||||
);
|
||||
break;
|
||||
|
||||
case "messagenest":
|
||||
formInst.setFieldValue([parentNamePath, "url"], "http://<your-messagenest-server>/api/v1/message/send");
|
||||
formInst.setFieldValue([parentNamePath, "method"], "POST");
|
||||
formInst.setFieldValue([parentNamePath, "headers"], "Content-Type: application/json");
|
||||
formInst.setFieldValue(
|
||||
[parentNamePath, "data"],
|
||||
JSON.stringify(
|
||||
{
|
||||
token: "<your-messagenest-token>",
|
||||
title: "${CERTIMATE_NOTIFIER_SUBJECT}",
|
||||
text: "${CERTIMATE_NOTIFIER_MESSAGE}",
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case "ntfy":
|
||||
formInst.setFieldValue([parentNamePath, "url"], "https://<your-ntfy-server>/");
|
||||
formInst.setFieldValue([parentNamePath, "method"], "POST");
|
||||
@ -116,6 +134,25 @@ const AccessConfigFormFieldsProviderWebhook = ({ usage = "none" }: AccessConfigF
|
||||
);
|
||||
break;
|
||||
|
||||
case "pushme":
|
||||
formInst.setFieldValue([parentNamePath, "url"], "https://push.i-i.me/");
|
||||
formInst.setFieldValue([parentNamePath, "method"], "POST");
|
||||
formInst.setFieldValue([parentNamePath, "headers"], "Content-Type: application/json");
|
||||
formInst.setFieldValue(
|
||||
[parentNamePath, "data"],
|
||||
JSON.stringify(
|
||||
{
|
||||
push_key: "<your-pushme-pushkey>",
|
||||
type: "text",
|
||||
title: "${CERTIMATE_NOTIFIER_SUBJECT}",
|
||||
content: "${CERTIMATE_NOTIFIER_MESSAGE}",
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case "pushover":
|
||||
formInst.setFieldValue([parentNamePath, "url"], "https://api.pushover.net/1/messages.json");
|
||||
formInst.setFieldValue([parentNamePath, "method"], "POST");
|
||||
@ -187,6 +224,23 @@ const AccessConfigFormFieldsProviderWebhook = ({ usage = "none" }: AccessConfigF
|
||||
);
|
||||
break;
|
||||
|
||||
case "wxpush":
|
||||
formInst.setFieldValue([parentNamePath, "url"], "http://<your-wxpush-server>/wxsend");
|
||||
formInst.setFieldValue([parentNamePath, "method"], "POST");
|
||||
formInst.setFieldValue([parentNamePath, "headers"], "Content-Type: application/json\r\nAuthorization: <your-wxpush-token>");
|
||||
formInst.setFieldValue(
|
||||
[parentNamePath, "data"],
|
||||
JSON.stringify(
|
||||
{
|
||||
title: "${CERTIMATE_NOTIFIER_SUBJECT}",
|
||||
content: "${CERTIMATE_NOTIFIER_MESSAGE}",
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
formInst.setFieldValue([parentNamePath, "method"], "POST");
|
||||
formInst.setFieldValue([parentNamePath, "headers"], "Content-Type: application/json");
|
||||
@ -269,11 +323,13 @@ const AccessConfigFormFieldsProviderWebhook = ({ usage = "none" }: AccessConfigF
|
||||
<div className="absolute -top-1.5 right-0 -translate-y-full">
|
||||
<Dropdown
|
||||
menu={{
|
||||
items: ["bark", "ntfy", "gotify", "pushover", "pushplus", "serverchan3", "serverchanturbo", "common"].map((key) => ({
|
||||
key,
|
||||
label: <span dangerouslySetInnerHTML={{ __html: t(`access.form.webhook_preset_data.${key}`) }}></span>,
|
||||
onClick: () => handlePresetDataForNotificationClick(key),
|
||||
})),
|
||||
items: ["bark", "ntfy", "gotify", "serverchan3", "serverchanturbo", "pushover", "pushplus", "messagenest", "wxpush", "pushme", "common"].map(
|
||||
(key) => ({
|
||||
key,
|
||||
label: <span dangerouslySetInnerHTML={{ __html: t(`access.form.webhook_preset_data.${key}`) }}></span>,
|
||||
onClick: () => handlePresetDataForNotificationClick(key),
|
||||
})
|
||||
),
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
|
||||
@ -701,11 +701,14 @@
|
||||
"access.form.webhook_preset_data": "Use preset Webhook",
|
||||
"access.form.webhook_preset_data.bark": "Bark",
|
||||
"access.form.webhook_preset_data.gotify": "Gotify",
|
||||
"access.form.webhook_preset_data.messagenest": "Message Nest",
|
||||
"access.form.webhook_preset_data.ntfy": "ntfy",
|
||||
"access.form.webhook_preset_data.pushme": "PushMe",
|
||||
"access.form.webhook_preset_data.pushover": "Pushover",
|
||||
"access.form.webhook_preset_data.pushplus": "PushPlus",
|
||||
"access.form.webhook_preset_data.serverchan3": "ServerChan<sup>3</sup>",
|
||||
"access.form.webhook_preset_data.serverchanturbo": "ServerChan<sup>Turbo</sup>",
|
||||
"access.form.webhook_preset_data.wxpush": "WXPush",
|
||||
"access.form.webhook_preset_data.common": "General data",
|
||||
"access.form.wecombot_webhook_url.label": "WeCom bot Webhook URL",
|
||||
"access.form.wecombot_webhook_url.placeholder": "Please enter WeCom bot Webhook URL",
|
||||
|
||||
@ -700,11 +700,14 @@
|
||||
"access.form.webhook_preset_data": "使用预设回调",
|
||||
"access.form.webhook_preset_data.bark": "Bark",
|
||||
"access.form.webhook_preset_data.gotify": "Gotify",
|
||||
"access.form.webhook_preset_data.messagenest": "Message Nest",
|
||||
"access.form.webhook_preset_data.ntfy": "ntfy",
|
||||
"access.form.webhook_preset_data.pushme": "PushMe",
|
||||
"access.form.webhook_preset_data.pushover": "Pushover",
|
||||
"access.form.webhook_preset_data.pushplus": "PushPlus 推送加",
|
||||
"access.form.webhook_preset_data.serverchan3": "Server 酱 <sup>3</sup>",
|
||||
"access.form.webhook_preset_data.serverchanturbo": "Server酱 <sup>Turbo</sup>",
|
||||
"access.form.webhook_preset_data.wxpush": "WXPush",
|
||||
"access.form.webhook_preset_data.common": "通用内容",
|
||||
"access.form.wecombot_webhook_url.label": "企业微信群机器人 Webhook 地址",
|
||||
"access.form.wecombot_webhook_url.placeholder": "请输入企业微信群机器人 Webhook 地址",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user