feat: add wecom notifier

This commit is contained in:
Fu Diwei
2024-12-22 11:25:08 +08:00
parent a1fec5f6ac
commit 01d30bb742
14 changed files with 235 additions and 39 deletions

View File

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