From 1e60e8351424588d07dbee4157e7fd28bb4838d5 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 2 Apr 2026 19:11:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E4=BD=93(Agent)=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9A=E7=9F=A5=E5=BC=80=E5=85=B3=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=80=BB=E8=BE=91=E8=87=AA=E5=8A=A8=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/api/constants.ts | 4 ++++ src/components/cards/NotificationChannelCard.vue | 1 + src/locales/en-US.ts | 1 + src/locales/zh-CN.ts | 1 + src/locales/zh-TW.ts | 1 + src/views/setting/AccountSettingNotification.vue | 16 +++++++++++++++- src/views/setup/NotificationSettingsStep.vue | 1 + 8 files changed, 25 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dbd84413..a527dc75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "2.9.23", + "version": "2.9.24", "private": true, "type": "module", "bin": "dist/service.js", diff --git a/src/api/constants.ts b/src/api/constants.ts index 995269bd..83a31079 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -282,6 +282,10 @@ export const notificationSwitchOptions = [ title: i18n.global.t('notificationSwitch.plugin'), value: '插件', }, + { + title: i18n.global.t('notificationSwitch.agent'), + value: '智能体', + }, { title: i18n.global.t('notificationSwitch.other'), value: '其它', diff --git a/src/components/cards/NotificationChannelCard.vue b/src/components/cards/NotificationChannelCard.vue index 59c23631..5fd052cc 100644 --- a/src/components/cards/NotificationChannelCard.vue +++ b/src/components/cards/NotificationChannelCard.vue @@ -64,6 +64,7 @@ const notificationTypes = [ { value: '媒体服务器', title: t('notificationSwitch.mediaServer') }, { value: '手动处理', title: t('notificationSwitch.manual') }, { value: '插件', title: t('notificationSwitch.plugin') }, + { value: '智能体', title: t('notificationSwitch.agent') }, { value: '其它', title: t('notificationSwitch.other') }, ] diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index c6a2cdd8..b1b91d80 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -90,6 +90,7 @@ export default { mediaServer: 'Media Server', manual: 'Manual', plugin: 'Plugin', + agent: 'Agent', other: 'Other', }, actionStep: { diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7893c73d..a8291a3d 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -90,6 +90,7 @@ export default { mediaServer: '媒体服务器', manual: '手动处理', plugin: '插件', + agent: '智能体', other: '其它', }, actionStep: { diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 074638e2..37429b6b 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -90,6 +90,7 @@ export default { mediaServer: '媒體伺服器', manual: '手動處理', plugin: '插件', + agent: '智能體', other: '其它', }, actionStep: { diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index a6ff17b3..864f23d9 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -91,6 +91,10 @@ const notificationSwitchs = ref([ type: '插件', action: 'admin', }, + { + type: '智能体', + action: 'admin', + }, { type: '其它', action: 'admin', @@ -214,7 +218,17 @@ function changNotificationSetting(notification: NotificationConf, name: string) async function loadNotificationSwitchs() { try { const result: { [key: string]: any } = await api.get('system/setting/NotificationSwitchs') - if (result.data?.value && result.data?.value.length > 0) notificationSwitchs.value = result.data?.value + if (result.data?.value && result.data?.value.length > 0) { + const savedSwitchs: NotificationSwitchConf[] = result.data.value + // 合并默认值中存在但后端数据中缺失的类型(如新增的类型) + const defaults = notificationSwitchs.value + for (const def of defaults) { + if (!savedSwitchs.find(item => item.type === def.type)) { + savedSwitchs.push(def) + } + } + notificationSwitchs.value = savedSwitchs + } } catch (error) { console.log(error) } diff --git a/src/views/setup/NotificationSettingsStep.vue b/src/views/setup/NotificationSettingsStep.vue index 19034ea5..121747a1 100644 --- a/src/views/setup/NotificationSettingsStep.vue +++ b/src/views/setup/NotificationSettingsStep.vue @@ -15,6 +15,7 @@ const notificationTypes = [ { value: '媒体服务器', title: t('notificationSwitch.mediaServer') }, { value: '手动处理', title: t('notificationSwitch.manual') }, { value: '插件', title: t('notificationSwitch.plugin') }, + { value: '智能体', title: t('notificationSwitch.agent') }, { value: '其它', title: t('notificationSwitch.other') }, ]