v0.3.30: 清理notifier参数 — 移除title/content/level/priority,标题内容由消息模板统一管理

This commit is contained in:
2026-05-17 19:29:05 +08:00
parent 063fa6b065
commit 4c46685d1f
16 changed files with 17 additions and 54 deletions

View File

@@ -1 +1 @@
0.3.29 0.3.30

View File

@@ -1 +1 @@
0.3.25 0.3.30

View File

@@ -2,10 +2,7 @@ import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'key', label: 'Bark Key', type: 'text', required: true, placeholder: 'xxxxxxxxxxxxxxxxx' }, { key: 'key', label: 'Bark Key', type: 'text', required: true, placeholder: 'xxxxxxxxxxxxxxxxx' },
{ key: 'server', label: '服务器', type: 'url', default: 'https://api.day.app', required: false, placeholder: 'https://api.day.app' }, { key: 'server', label: '服务器', type: 'url', default: 'https://api.day.app', required: false, placeholder: 'https://api.day.app' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch 通知', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'level', label: '级别', type: 'text', default: 'info', required: false },
]; ];
export const barkNotifier: Notifier = { export const barkNotifier: Notifier = {

View File

@@ -1,10 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://oapi.dingtalk.com/robot/send?access_token=xxx' }, { key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://oapi.dingtalk.com/robot/send?access_token=xxx' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'level', label: '级别', type: 'text', default: 'info', required: false },
]; ];
export const dingtalkNotifier: Notifier = { export const dingtalkNotifier: Notifier = {

View File

@@ -1,10 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://discord.com/api/webhooks/...' }, { key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://discord.com/api/webhooks/...' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'level', label: '级别', type: 'text', default: 'info', required: false },
]; ];
export const discordNotifier: Notifier = { export const discordNotifier: Notifier = {

View File

@@ -2,10 +2,7 @@ import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'server', label: '服务器地址', type: 'url', required: true, placeholder: 'https://gotify.example.com' }, { key: 'server', label: '服务器地址', type: 'url', required: true, placeholder: 'https://gotify.example.com' },
{ key: 'token', label: 'App Token', type: 'password', required: true, placeholder: 'Gotify App Token' }, { key: 'token', label: 'App Token', type: 'password', required: true, placeholder: 'Gotify App Token' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'priority', label: '优先级', type: 'text', default: 5, required: false },
]; ];
export const gotifyNotifier: Notifier = { export const gotifyNotifier: Notifier = {

View File

@@ -1,10 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://open.feishu.cn/open-apis/bot/v2/hook/xxx' }, { key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://open.feishu.cn/open-apis/bot/v2/hook/xxx' }
{ key: 'title', label: '\u6807\u9898', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '\u5185\u5bb9', type: 'text', required: true },
{ key: 'level', label: '\u7ea7\u522b', type: 'text', default: 'info', required: false },
]; ];
export const larkNotifier: Notifier = { export const larkNotifier: Notifier = {
@@ -24,7 +21,7 @@ export const larkNotifier: Notifier = {
header: { title: { tag: 'plain_text', content: p.title || 'CloudSearch' }, template }, header: { title: { tag: 'plain_text', content: p.title || 'CloudSearch' }, template },
elements: [ elements: [
{ tag: 'div', text: { tag: 'lark_md', content: p.content || '' } }, { tag: 'div', text: { tag: 'lark_md', content: p.content || '' } },
{ tag: 'note', elements: [{ tag: 'plain_text', content: 'CloudSearch \u00b7 ' + new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) }] }, { tag: 'note', elements: [{ tag: 'plain_text', content: 'CloudSearch \u00b7 ' + new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) }] }
], ],
}, },
}), }),

View File

@@ -2,10 +2,7 @@ import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'topic', label: 'Topic', type: 'text', required: true, placeholder: 'my-notification-topic' }, { key: 'topic', label: 'Topic', type: 'text', required: true, placeholder: 'my-notification-topic' },
{ key: 'server', label: '服务器', type: 'url', default: 'https://ntfy.sh', required: false, placeholder: 'https://ntfy.sh' }, { key: 'server', label: '服务器', type: 'url', default: 'https://ntfy.sh', required: false, placeholder: 'https://ntfy.sh' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'priority', label: '优先级(1-5)', type: 'text', default: 3, required: false },
]; ];
export const ntfyNotifier: Notifier = { export const ntfyNotifier: Notifier = {

View File

@@ -1,9 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'token', label: 'Token', type: 'password', required: true, placeholder: 'pushplus token' }, { key: 'token', label: 'Token', type: 'password', required: true, placeholder: 'pushplus token' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
]; ];
export const pushplusNotifier: Notifier = { export const pushplusNotifier: Notifier = {

View File

@@ -2,9 +2,7 @@ import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'key', label: 'API Key', type: 'password', required: true, placeholder: 'Qmsg API Key' }, { key: 'key', label: 'API Key', type: 'password', required: true, placeholder: 'Qmsg API Key' },
{ key: 'qq', label: 'QQ 号', type: 'text', required: false, placeholder: '留空则推送到所有绑定QQ' }, { key: 'qq', label: 'QQ 号', type: 'text', required: false, placeholder: '留空则推送到所有绑定QQ' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
]; ];
export const qmsgNotifier: Notifier = { export const qmsgNotifier: Notifier = {

View File

@@ -1,9 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'sendkey', label: 'SendKey', type: 'password', required: true, placeholder: 'Server酱 SendKey' }, { key: 'sendkey', label: 'SendKey', type: 'password', required: true, placeholder: 'Server酱 SendKey' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
]; ];
export const serverchanNotifier: Notifier = { export const serverchanNotifier: Notifier = {

View File

@@ -1,9 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'sendkey', label: 'SendKey', type: 'password', required: true, placeholder: 'Server酱 Turbo SendKey' }, { key: 'sendkey', label: 'SendKey', type: 'password', required: true, placeholder: 'Server酱 Turbo SendKey' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
]; ];
export const serverchanturboNotifier: Notifier = { export const serverchanturboNotifier: Notifier = {

View File

@@ -7,9 +7,7 @@ const params: NotifierParam[] = [
{ key: 'user', label: '用户名', type: 'text', required: true, placeholder: 'user@example.com' }, { key: 'user', label: '用户名', type: 'text', required: true, placeholder: 'user@example.com' },
{ key: 'pass', label: '密码/授权码', type: 'password', required: true, placeholder: 'SMTP 授权码' }, { key: 'pass', label: '密码/授权码', type: 'password', required: true, placeholder: 'SMTP 授权码' },
{ key: 'from', label: '发件人', type: 'text', required: true, placeholder: 'sender@example.com' }, { key: 'from', label: '发件人', type: 'text', required: true, placeholder: 'sender@example.com' },
{ key: 'to', label: '收件人', type: 'text', required: true, placeholder: 'receiver@example.com' }, { key: 'to', label: '收件人', type: 'text', required: true, placeholder: 'receiver@example.com' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
]; ];
export const smtpNotifier: Notifier = { export const smtpNotifier: Notifier = {

View File

@@ -2,10 +2,7 @@ import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'token', label: 'Bot Token', type: 'password', required: true, placeholder: '123456:ABC-def' }, { key: 'token', label: 'Bot Token', type: 'password', required: true, placeholder: '123456:ABC-def' },
{ key: 'chat_id', label: 'Chat ID', type: 'text', required: true, placeholder: '@频道 或 -1001234567890' }, { key: 'chat_id', label: 'Chat ID', type: 'text', required: true, placeholder: '@频道 或 -1001234567890' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'level', label: '级别', type: 'text', default: 'info', required: false },
]; ];
export const telegramNotifier: Notifier = { export const telegramNotifier: Notifier = {

View File

@@ -1,10 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://example.com/webhook' }, { key: 'url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://example.com/webhook' }
{ key: 'title', label: '\u6807\u9898', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '\u5185\u5bb9', type: 'text', required: true },
{ key: 'level', label: '\u7ea7\u522b', type: 'text', default: 'info', required: false },
]; ];
export const webhookNotifier: Notifier = { export const webhookNotifier: Notifier = {

View File

@@ -1,10 +1,7 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types'; import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [ const params: NotifierParam[] = [
{ key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx' }, { key: 'webhook_url', label: 'Webhook URL', type: 'url', required: true, placeholder: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx' }
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
{ key: 'level', label: '级别', type: 'text', default: 'info', required: false },
]; ];
export const wechatWorkBotNotifier: Notifier = { export const wechatWorkBotNotifier: Notifier = {