feat(notify): add pushplus

This commit is contained in:
catfishlty
2025-04-02 13:53:22 +08:00
parent 893391a3d1
commit b585782007
12 changed files with 228 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import NotifyChannelEditFormBarkFields from "./NotifyChannelEditFormBarkFields";
import NotifyChannelEditFormDingTalkFields from "./NotifyChannelEditFormDingTalkFields";
import NotifyChannelEditFormEmailFields from "./NotifyChannelEditFormEmailFields";
import NotifyChannelEditFormLarkFields from "./NotifyChannelEditFormLarkFields";
import NotifyChannelEditFormPushPlusFields from "./NotifyChannelEditFormPushPlusFields";
import NotifyChannelEditFormServerChanFields from "./NotifyChannelEditFormServerChanFields";
import NotifyChannelEditFormTelegramFields from "./NotifyChannelEditFormTelegramFields";
import NotifyChannelEditFormWebhookFields from "./NotifyChannelEditFormWebhookFields";
@@ -50,6 +51,8 @@ const NotifyChannelEditForm = forwardRef<NotifyChannelEditFormInstance, NotifyCh
return <NotifyChannelEditFormEmailFields />;
case NOTIFY_CHANNELS.LARK:
return <NotifyChannelEditFormLarkFields />;
case NOTIFY_CHANNELS.PUSHPLUS:
return <NotifyChannelEditFormPushPlusFields />;
case NOTIFY_CHANNELS.SERVERCHAN:
return <NotifyChannelEditFormServerChanFields />;
case NOTIFY_CHANNELS.TELEGRAM:

View File

@@ -0,0 +1,28 @@
import { useTranslation } from "react-i18next";
import { Form, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";
const NotifyChannelEditFormPushPlusFields = () => {
const { t } = useTranslation();
const formSchema = z.object({
token: z.string({ message: t("settings.notification.channel.form.pushplus_token.placeholder") }),
});
const formRule = createSchemaFieldRule(formSchema);
return (
<>
<Form.Item
name="token"
label={t("settings.notification.channel.form.pushplus_token.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("settings.notification.channel.form.pushplus_token.tooltip") }}></span>}
>
<Input placeholder={t("settings.notification.channel.form.pushplus_token.placeholder")} />
</Form.Item>
</>
);
};
export default NotifyChannelEditFormPushPlusFields;