diff --git a/src/api/types.ts b/src/api/types.ts index d1c16f69..db9d825e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -870,7 +870,7 @@ export interface NotificationConf { // 类型 telegram/wechat/vocechat/synologychat type: string // 配置 - config?: { [key: string]: any } + config: { [key: string]: any } // 场景开关 switchs?: string[] // 是否启用 diff --git a/src/components/cards/DownloaderCard.vue b/src/components/cards/DownloaderCard.vue index 253e64a6..2020b48b 100644 --- a/src/components/cards/DownloaderCard.vue +++ b/src/components/cards/DownloaderCard.vue @@ -24,6 +24,9 @@ const download_rate = ref(0) // 下载器详情弹窗 const downloaderInfoDialog = ref(false) +// 下载器名称 +const downloaderName = ref('') + // 下载器详情 const downloaderInfo = ref({ name: '', @@ -36,12 +39,14 @@ const downloaderInfo = ref({ // 打开详情弹窗 function openDownloaderInfoDialog() { downloaderInfo.value = props.downloader + downloaderName.value = props.downloader.name downloaderInfoDialog.value = true } // 保存详情数据 function saveDownloaderInfo() { downloaderInfoDialog.value = false + downloaderInfo.value.name = downloaderName.value emit('change', downloaderInfo.value) } @@ -78,9 +83,15 @@ function onClose() {
-
- - {{ downloader.name }} +
+ + {{ downloader.name }}
{{ getSpeedText }}
@@ -104,7 +115,7 @@ function onClose() { ({ name: '', @@ -29,12 +32,14 @@ const mediaServerInfo = ref({ // 打开详情弹窗 function openMediaServerInfoDialog() { mediaServerInfo.value = props.mediaserver + mediaServerName.value = props.mediaserver.name mediaServerInfoDialog.value = true } // 保存详情数据 function saveMediaServerInfo() { mediaServerInfoDialog.value = false + mediaServerInfo.value.name = mediaServerName.value emit('change', mediaServerInfo.value) } @@ -81,7 +86,7 @@ function onClose() { ({ + name: '', + type: '', + enabled: false, + config: {}, +}) + +// 打开详情弹窗 +function openNotificationInfoDialog() { + notificationInfo.value = props.notification + notificationName.value = props.notification.name + notificationInfoDialog.value = true +} + +// 保存详情数据 +function saveNotificationInfo() { + notificationInfoDialog.value = false + notificationInfo.value.name = notificationName.value + emit('change', notificationInfo.value) +} + // 根据存储类型选择图标 const getIcon = computed(() => { switch (props.notification.type) { @@ -35,23 +66,275 @@ const getIcon = computed(() => { } }) -// 定义触发的自定义事件 -const emit = defineEmits(['close']) - // 按钮点击 function onClose() { emit('close') } diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index 32f9086b..1ddaddcc 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -17,6 +17,7 @@ function addNotification(notification: string) { name: `通知${notifications.value.length + 1}`, type: notification, enabled: false, + config: {}, }) } diff --git a/src/views/setting/AccountSettingSystem.vue b/src/views/setting/AccountSettingSystem.vue index b0c1a4f8..885697ed 100644 --- a/src/views/setting/AccountSettingSystem.vue +++ b/src/views/setting/AccountSettingSystem.vue @@ -167,7 +167,7 @@ onMounted(() => { 下载器 - 只有第1个启用的下载器才会被默认使用。 + 只有默认下载器才会被默认使用。