Skip to content

Commit

Permalink
修复群晖通知参数,任务视图不属于筛选
Browse files Browse the repository at this point in the history
  • Loading branch information
whyour committed Feb 16, 2025
1 parent 5d64aae commit 4969181
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 deletions.
9 changes: 4 additions & 5 deletions back/data/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -163,7 +162,7 @@ export interface NotificationInfo
GotifyNotification,
ServerChanNotification,
PushDeerNotification,
ChatNotification,
synologyChatNotification,
BarkNotification,
TelegramBotNotification,
DingtalkBotNotification,
Expand Down
17 changes: 12 additions & 5 deletions back/services/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 } }
Expand Down
5 changes: 2 additions & 3 deletions back/services/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"访问密钥": "访问密钥",
Expand Down
41 changes: 18 additions & 23 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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: [
Expand All @@ -368,9 +357,7 @@ export default {
},
{
label: 'wePlusBotReceiver',
tip: intl.get(
'消息接收人',
),
tip: intl.get('消息接收人'),
},
{
label: 'wePlusBotVersion',
Expand Down Expand Up @@ -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: [
{
Expand All @@ -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,
},
],
Expand Down

0 comments on commit 4969181

Please sign in to comment.