mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
feat: 新增智能体(Agent)消息类型,优化通知开关加载逻辑自动合并新增类型
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "2.9.23",
|
"version": "2.9.24",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
|
|||||||
@@ -282,6 +282,10 @@ export const notificationSwitchOptions = [
|
|||||||
title: i18n.global.t('notificationSwitch.plugin'),
|
title: i18n.global.t('notificationSwitch.plugin'),
|
||||||
value: '插件',
|
value: '插件',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: i18n.global.t('notificationSwitch.agent'),
|
||||||
|
value: '智能体',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: i18n.global.t('notificationSwitch.other'),
|
title: i18n.global.t('notificationSwitch.other'),
|
||||||
value: '其它',
|
value: '其它',
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ const notificationTypes = [
|
|||||||
{ value: '媒体服务器', title: t('notificationSwitch.mediaServer') },
|
{ value: '媒体服务器', title: t('notificationSwitch.mediaServer') },
|
||||||
{ value: '手动处理', title: t('notificationSwitch.manual') },
|
{ value: '手动处理', title: t('notificationSwitch.manual') },
|
||||||
{ value: '插件', title: t('notificationSwitch.plugin') },
|
{ value: '插件', title: t('notificationSwitch.plugin') },
|
||||||
|
{ value: '智能体', title: t('notificationSwitch.agent') },
|
||||||
{ value: '其它', title: t('notificationSwitch.other') },
|
{ value: '其它', title: t('notificationSwitch.other') },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ export default {
|
|||||||
mediaServer: 'Media Server',
|
mediaServer: 'Media Server',
|
||||||
manual: 'Manual',
|
manual: 'Manual',
|
||||||
plugin: 'Plugin',
|
plugin: 'Plugin',
|
||||||
|
agent: 'Agent',
|
||||||
other: 'Other',
|
other: 'Other',
|
||||||
},
|
},
|
||||||
actionStep: {
|
actionStep: {
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ export default {
|
|||||||
mediaServer: '媒体服务器',
|
mediaServer: '媒体服务器',
|
||||||
manual: '手动处理',
|
manual: '手动处理',
|
||||||
plugin: '插件',
|
plugin: '插件',
|
||||||
|
agent: '智能体',
|
||||||
other: '其它',
|
other: '其它',
|
||||||
},
|
},
|
||||||
actionStep: {
|
actionStep: {
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ export default {
|
|||||||
mediaServer: '媒體伺服器',
|
mediaServer: '媒體伺服器',
|
||||||
manual: '手動處理',
|
manual: '手動處理',
|
||||||
plugin: '插件',
|
plugin: '插件',
|
||||||
|
agent: '智能體',
|
||||||
other: '其它',
|
other: '其它',
|
||||||
},
|
},
|
||||||
actionStep: {
|
actionStep: {
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ const notificationSwitchs = ref<NotificationSwitchConf[]>([
|
|||||||
type: '插件',
|
type: '插件',
|
||||||
action: 'admin',
|
action: 'admin',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: '智能体',
|
||||||
|
action: 'admin',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: '其它',
|
type: '其它',
|
||||||
action: 'admin',
|
action: 'admin',
|
||||||
@@ -214,7 +218,17 @@ function changNotificationSetting(notification: NotificationConf, name: string)
|
|||||||
async function loadNotificationSwitchs() {
|
async function loadNotificationSwitchs() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/setting/NotificationSwitchs')
|
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) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const notificationTypes = [
|
|||||||
{ value: '媒体服务器', title: t('notificationSwitch.mediaServer') },
|
{ value: '媒体服务器', title: t('notificationSwitch.mediaServer') },
|
||||||
{ value: '手动处理', title: t('notificationSwitch.manual') },
|
{ value: '手动处理', title: t('notificationSwitch.manual') },
|
||||||
{ value: '插件', title: t('notificationSwitch.plugin') },
|
{ value: '插件', title: t('notificationSwitch.plugin') },
|
||||||
|
{ value: '智能体', title: t('notificationSwitch.agent') },
|
||||||
{ value: '其它', title: t('notificationSwitch.other') },
|
{ value: '其它', title: t('notificationSwitch.other') },
|
||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user