diff --git a/src/assets/images/logos/jellyfin.png b/src/assets/images/logos/jellyfin.png index e745f029..7b8293a1 100644 Binary files a/src/assets/images/logos/jellyfin.png and b/src/assets/images/logos/jellyfin.png differ diff --git a/src/assets/images/logos/plex.jpeg b/src/assets/images/logos/plex.jpeg deleted file mode 100644 index f77b465a..00000000 Binary files a/src/assets/images/logos/plex.jpeg and /dev/null differ diff --git a/src/assets/images/logos/plex.png b/src/assets/images/logos/plex.png new file mode 100644 index 00000000..24f768ab Binary files /dev/null and b/src/assets/images/logos/plex.png differ diff --git a/src/components/cards/MediaServerCard.vue b/src/components/cards/MediaServerCard.vue index 11645e02..42177950 100644 --- a/src/components/cards/MediaServerCard.vue +++ b/src/components/cards/MediaServerCard.vue @@ -1,2 +1,37 @@ - - + + diff --git a/src/components/cards/NotificationChannelCard.vue b/src/components/cards/NotificationChannelCard.vue index 11645e02..78586cd5 100644 --- a/src/components/cards/NotificationChannelCard.vue +++ b/src/components/cards/NotificationChannelCard.vue @@ -1,2 +1,45 @@ - - + + diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index 2083e5f7..d2cc12f1 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -8,39 +8,43 @@ import NotificationChannelCard from '@/components/cards/NotificationChannelCard. // 所有消息渠道 const notifications = ref([]) -// 消息渠道 -const NotificationChannels = [ - { - title: '微信', - value: 'wechat', - }, - { - title: 'Telegram', - value: 'telegram', - }, - { - title: 'Slack', - value: 'slack', - }, - { - title: 'SynologyChat', - value: 'synologychat', - }, - { - title: 'VoceChat', - value: 'vocechat', - }, - { - title: 'WebPush', - value: 'webpush', - }, -] - // 提示框 const $toast = useToast() +// 添加媒体服务器 +function addNotification(notification: string) { + notifications.value.push({ + name: `通知${notifications.value.length + 1}`, + type: notification, + enabled: false, + }) +} + +// 调用API查询通知设置 +async function loadNotificationSetting() { + try { + const result: { [key: string]: any } = await api.get('system/setting/Notifications') + notifications.value = result.data?.value ?? [] + } catch (error) { + console.log(error) + } +} + +// 调用API保存通知设置 +async function saveNotificationSetting() { + try { + const result: { [key: string]: any } = await api.post('system/setting/Notifications', notifications.value) + if (result.success) $toast.success('通知设置保存成功') + else $toast.error('通知设置保存失败!') + } catch (error) { + console.log(error) + } +} + // 加载数据 -onMounted(() => {}) +onMounted(() => { + loadNotificationSetting() +})