diff --git a/back/data/notify.ts b/back/data/notify.ts index ed52ba6c..110ba3be 100644 --- a/back/data/notify.ts +++ b/back/data/notify.ts @@ -49,9 +49,8 @@ export class PushDeerNotification extends NotificationBaseInfo { public pushDeerUrl = ''; } -export class ChatNotification extends NotificationBaseInfo { - public chatUrl = ''; - public chatToken = ''; +export class synologyChatNotification extends NotificationBaseInfo { + public synologyChatUrl = ''; } export class BarkNotification extends NotificationBaseInfo { @@ -61,7 +60,7 @@ export class BarkNotification extends NotificationBaseInfo { public barkGroup = 'qinglong'; public barkLevel = 'active'; public barkUrl = ''; - public barkArchive="" + public barkArchive = ''; } export class TelegramBotNotification extends NotificationBaseInfo { @@ -163,7 +162,7 @@ export interface NotificationInfo GotifyNotification, ServerChanNotification, PushDeerNotification, - ChatNotification, + synologyChatNotification, BarkNotification, TelegramBotNotification, DingtalkBotNotification, diff --git a/back/services/cron.ts b/back/services/cron.ts index add8f1df..7891e970 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -179,8 +179,8 @@ export default class CronService { for (const col of viewQuery.filters) { const { property, value, operation } = col; let q: any = {}; - let operate2 = null; - let operate = null; + let operate2: any = null; + let operate: any = null; switch (operation) { case 'Reg': operate = Op.like; @@ -203,9 +203,16 @@ export default class CronService { case 'Nin': q[Op.and] = [ { - [property]: { - [Op.notIn]: Array.isArray(value) ? value : [value], - }, + [Op.or]: [ + { + [property]: { + [Op.notIn]: Array.isArray(value) ? value : [value], + }, + }, + { + [property]: { [Op.is]: null }, + }, + ], }, property === 'status' && value.includes(2) ? { isDisabled: { [Op.ne]: 1 } } diff --git a/back/services/notify.ts b/back/services/notify.ts index 781a17ba..5386fce7 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -182,11 +182,10 @@ export default class NotificationService { } private async chat() { - const { chatUrl, chatToken } = this.params; - const url = `${chatUrl}${chatToken}`; + const { synologyChatUrl } = this.params; try { const res: any = await got - .post(url, { + .post(synologyChatUrl, { ...this.gotOption, body: `payload={"text":"${this.title}\n${this.content}"}`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 790e8596..a9f5d96a 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -344,7 +344,7 @@ "gotify的url地址,例如 https://push.example.de:8080": "gotify URL address, e.g., https://push.example.de:8080", "gotify的消息应用token码": "gotify message application token code", "推送消息的优先级": "Priority of Push Messages", - "chat的url地址": "Chat URL address", + "synologyChat的url地址": "Synology Chat Webhook URL address", "chat的token码": "Chat token code", "推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg": "Push to personal QQ: http://127.0.0.1/send_private_msg, group: http://127.0.0.1/send_group_msg", "访问密钥": "Access Key", diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index c3ac7226..19b15619 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -344,7 +344,7 @@ "gotify的url地址,例如 https://push.example.de:8080": "gotify的url地址,例如 https://push.example.de:8080", "gotify的消息应用token码": "gotify的消息应用token码", "推送消息的优先级": "推送消息的优先级", - "chat的url地址": "chat的url地址", + "synologyChat的url地址": "synologyChat的webhook url地址", "chat的token码": "chat的token码", "推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg": "推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg", "访问密钥": "访问密钥", diff --git a/src/utils/config.ts b/src/utils/config.ts index 35ce3bae..bfc64409 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -135,11 +135,10 @@ export default { ], chat: [ { - label: 'chatUrl', - tip: intl.get('chat的url地址'), + label: 'synologyChatUrl', + tip: intl.get('synologyChat的url地址'), required: true, }, - { label: 'chatToken', tip: intl.get('chat的token码'), required: true }, ], goCqHttpBot: [ { @@ -329,33 +328,23 @@ export default { }, { label: 'pushplusTemplate', - tip: intl.get( - '发送模板', - ), + tip: intl.get('发送模板'), }, { label: 'pushplusChannel', - tip: intl.get( - '发送渠道', - ), + tip: intl.get('发送渠道'), }, { label: 'pushplusWebhook', - tip: intl.get( - 'webhook编码', - ), + tip: intl.get('webhook编码'), }, { label: 'pushplusCallbackUrl', - tip: intl.get( - '发送结果回调地址', - ), + tip: intl.get('发送结果回调地址'), }, { label: 'pushplusTo', - tip: intl.get( - '好友令牌', - ), + tip: intl.get('好友令牌'), }, ], wePlusBot: [ @@ -368,9 +357,7 @@ export default { }, { label: 'wePlusBotReceiver', - tip: intl.get( - '消息接收人', - ), + tip: intl.get('消息接收人'), }, { label: 'wePlusBotVersion', @@ -414,7 +401,13 @@ export default { required: true, }, { label: 'emailUser', tip: intl.get('邮箱地址'), required: true }, - { label: 'emailPass', tip: intl.get('SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定'), required: true }, + { + label: 'emailPass', + tip: intl.get( + 'SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定', + ), + required: true, + }, ], pushMe: [ { @@ -424,7 +417,9 @@ export default { }, { label: 'pushMeUrl', - tip: intl.get('自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口'), + tip: intl.get( + '自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口', + ), required: false, }, ],