diff --git a/src/api/types.ts b/src/api/types.ts index cc1d001b..afd781a0 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -831,3 +831,23 @@ export interface SystemNotification { // 通知时间 date: string } + +// 下载目录/媒体库目录 +export interface MediaDirectory { + // 类型 download/library + type?: string + // 别名 + name?: string + // 路径 + path?: string + // 媒体类型 电影/电视剧 + media_type?: string + // 媒体类别 动画电影/国产剧 + category?: string + // 刮削媒体信息 + scrape?: boolean + // 自动二级分类,未指定类别时自动分类 + auto_category?: boolean + // 优先级 + priority?: number +} diff --git a/src/components/cards/MediaDirectoryCard.vue b/src/components/cards/MediaDirectoryCard.vue new file mode 100644 index 00000000..0dcf2ac9 --- /dev/null +++ b/src/components/cards/MediaDirectoryCard.vue @@ -0,0 +1,92 @@ + + + diff --git a/src/pages/setting.vue b/src/pages/setting.vue index 79c3ed95..c6f94be9 100644 --- a/src/pages/setting.vue +++ b/src/pages/setting.vue @@ -9,6 +9,7 @@ import AccountSettingSearch from '@/views/setting/AccountSettingSearch.vue' import AccountSettingSubscribe from '@/views/setting/AccountSettingSubscribe.vue' import AccountSettingService from '@/views/setting/AccountSettingService.vue' import AccountSettingSystem from '@/views/setting/AccountSettingSystem.vue' +import AccountSettingDirectory from '@/views/setting/AccountSettingDirectory.vue' const route = useRoute() @@ -22,10 +23,15 @@ const tabs = [ tab: 'account', }, { - title: '系统', - icon: 'mdi-cog', + title: '连接', + icon: 'mdi-server-network', tab: 'system', }, + { + title: '目录', + icon: 'mdi-folder', + tab: 'directory', + }, { title: '站点', icon: 'mdi-web', @@ -81,13 +87,20 @@ const tabs = [ - + + + + + + + + @@ -122,12 +135,14 @@ const tabs = [ + + diff --git a/src/views/setting/AccountSettingDirectory.vue b/src/views/setting/AccountSettingDirectory.vue new file mode 100644 index 00000000..a6beede8 --- /dev/null +++ b/src/views/setting/AccountSettingDirectory.vue @@ -0,0 +1,318 @@ + + + + + diff --git a/src/views/setting/AccountSettingNotification.vue b/src/views/setting/AccountSettingNotification.vue index c9230c15..d3fab17e 100644 --- a/src/views/setting/AccountSettingNotification.vue +++ b/src/views/setting/AccountSettingNotification.vue @@ -67,8 +67,7 @@ async function loadNotificationSwitchs() { const result: NotificationSwitch[] = await api.get('message/switchs') messagemTypes.value = result - } - catch (error) { + } catch (error) { console.log(error) } } @@ -76,17 +75,11 @@ async function loadNotificationSwitchs() { // 调用API保存消息开关 async function saveNotificationSwitchs() { try { - const result: { [key: string]: any } = await api.post( - 'message/switchs', - messagemTypes.value, - ) + const result: { [key: string]: any } = await api.post('message/switchs', messagemTypes.value) - if (result.success) - $toast.success('保存通知消息设置成功') - else - $toast.error('保存通知消息设置失败!') - } - catch (error) { + if (result.success) $toast.success('保存通知消息设置成功') + else $toast.error('保存通知消息设置失败!') + } catch (error) { console.log(error) } } @@ -143,8 +136,7 @@ async function loadNotificationSettings() { VOCECHAT_CHANNEL_ID, } } - } - catch (error) { + } catch (error) { console.log(error) } } @@ -152,23 +144,17 @@ async function loadNotificationSettings() { // 调用API保存消息渠道设置 async function saveNotificationSettings() { try { - const result1: { [key: string]: any } = await api.post( - 'system/setting/MESSAGER', - selectedChannels.value.join(','), - ) + const result1: { [key: string]: any } = await api.post('system/setting/MESSAGER', selectedChannels.value.join(',')) - const result2: { [key: string]: any } = await api.post( - 'system/env', - notificationSettings.value, - ) + const result2: { [key: string]: any } = await api.post('system/env', notificationSettings.value) if (result1.success && result2.success) { $toast.success('保存通知渠道设置成功') reloadModule() + } else { + $toast.error('保存通知渠道设置失败!') } - else { $toast.error('保存通知渠道设置失败!') } - } - catch (error) { + } catch (error) { console.log(error) } } @@ -177,12 +163,9 @@ async function saveNotificationSettings() { async function reloadModule() { try { const result: { [key: string]: any } = await api.get('system/reload') - if (result.success) - $toast.success('重新加载模块成功') - else - $toast.error('重新加载模块失败!') - } - catch (error) { + if (result.success) $toast.success('重新加载模块成功') + else $toast.error('重新加载模块失败!') + } catch (error) { console.log(error) } } @@ -197,8 +180,11 @@ onMounted(() => {