diff --git a/src/api/constants.ts b/src/api/constants.ts index a30696ee..cbde31df 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -26,11 +26,6 @@ export const storageAttributes = [ icon: 'mdi-server-network-outline', remote: true, }, - { - type: 'custom', - icon: 'mdi-database', - remote: true, - }, ] export const storageIconDict = storageAttributes.reduce((dict, item) => { @@ -43,6 +38,46 @@ export const storageRemoteDict = storageAttributes.reduce((dict, item) => { return dict }, {} as Record) +export const downloaderOptions = [ + { + value: 'qbittorrent', + title: i18n.global.t('setting.system.qbittorrent'), + }, + { + value: 'transmission', + title: i18n.global.t('setting.system.transmission'), + }, +] + +export const downloaderDict = downloaderOptions.reduce((dict, item) => { + dict[item.value] = item.title + return dict +}, {} as Record) + +export const mediaServerOptions = [ + { + value: 'emby', + title: i18n.global.t('setting.system.emby'), + }, + { + value: 'jellyfin', + title: i18n.global.t('setting.system.jellyfin'), + }, + { + value: 'plex', + title: i18n.global.t('setting.system.plex'), + }, + { + value: 'trimemedia', + title: i18n.global.t('setting.system.trimeMedia'), + }, +] + +export const mediaServerDict = mediaServerOptions.reduce((dict, item) => { + dict[item.value] = item.title + return dict +}, {} as Record) + export const innerFilterRules = [ { title: i18n.global.t('filterRules.specSub'), value: ' SPECSUB ' }, { title: i18n.global.t('filterRules.cnSub'), value: ' CNSUB ' }, diff --git a/src/components/cards/DirectoryCard.vue b/src/components/cards/DirectoryCard.vue index 82829f70..1fa83712 100644 --- a/src/components/cards/DirectoryCard.vue +++ b/src/components/cards/DirectoryCard.vue @@ -33,8 +33,8 @@ const isCollapsed = ref(true) // 类型下拉字典 const typeItems = computed(() => [ { title: t('common.all'), value: '' }, - { title: t('media.movie'), value: '电影' }, - { title: t('media.tv'), value: '电视剧' }, + { title: t('mediaType.movie'), value: '电影' }, + { title: t('mediaType.tv'), value: '电视剧' }, ]) // 计算资源存储字典(整理方式为下载器时不能为远程存储) diff --git a/src/components/cards/DownloaderCard.vue b/src/components/cards/DownloaderCard.vue index 65526abc..f454504b 100644 --- a/src/components/cards/DownloaderCard.vue +++ b/src/components/cards/DownloaderCard.vue @@ -9,6 +9,7 @@ import transmission_image from '@images/logos/transmission.png' import custom_image from '@images/logos/downloader.png' import { cloneDeep } from 'lodash-es' import { useI18n } from 'vue-i18n' +import { downloaderDict } from '@/api/constants' // 获取i18n实例 const { t } = useI18n() @@ -173,11 +174,11 @@ onUnmounted(() => { /> {{ downloader.name }} -
+
{{ `↑ ${formatFileSize(upload_rate, 1)}/s ` }} {{ `↓ ${formatFileSize(download_rate, 1)}/s` }}
-
+
自定义下载器
@@ -324,11 +325,20 @@ onUnmounted(() => { + + + diff --git a/src/components/cards/MediaServerCard.vue b/src/components/cards/MediaServerCard.vue index 4b16cc39..2dcb4350 100644 --- a/src/components/cards/MediaServerCard.vue +++ b/src/components/cards/MediaServerCard.vue @@ -9,6 +9,7 @@ import custom_image from '@images/logos/mediaserver.png' import api from '@/api' import { cloneDeep } from 'lodash-es' import { useI18n } from 'vue-i18n' +import { mediaServerDict } from '@/api/constants' // 获取i18n实例 const { t } = useI18n() @@ -186,12 +187,12 @@ onMounted(() => {
{{ mediaserver.name }}
-
+
{{ item.amount }}
-
+
自定义媒体服务器
@@ -453,11 +454,15 @@ onMounted(() => { + + + diff --git a/src/components/cards/StorageCard.vue b/src/components/cards/StorageCard.vue index db5048b4..67e3a53d 100644 --- a/src/components/cards/StorageCard.vue +++ b/src/components/cards/StorageCard.vue @@ -15,6 +15,7 @@ import AlistConfigDialog from '../dialog/AlistConfigDialog.vue' import { useToast } from 'vue-toast-notification' import { isNullOrEmptyObject } from '@/@core/utils' import { useI18n } from 'vue-i18n' +import { storageIconDict } from '@/api/constants' // 国际化 const { t } = useI18n() @@ -50,6 +51,9 @@ const storage_ref = ref(props.storage) // 自定义存储名称 const customName = ref(props.storage.name) +// 自定义存储类型 +const storageType = ref(props.storage.type) + // 阿里云盘认证对话框 const aliyunAuthDialog = ref(false) // 115网盘认证对话框 @@ -76,11 +80,11 @@ function openStorageDialog() { case 'alist': aListConfigDialog.value = true break - case 'custom': - customConfigDialog.value = true + case 'local': + $toast.info(t('storage.noConfigNeeded')) break default: - $toast.info(t('storage.noConfigNeeded')) + customConfigDialog.value = true break } } @@ -98,10 +102,8 @@ const getIcon = computed(() => { return rclone_png case 'alist': return alist_png - case 'custom': - return custom_png default: - return storage_png + return custom_png } }) @@ -139,7 +141,9 @@ function handleDone() { rcloneConfigDialog.value = false aListConfigDialog.value = false customConfigDialog.value = false + // 更新存储 storage_ref.value.name = customName.value + storage_ref.value.type = storageType.value emit('done', storage_ref.value) } @@ -155,11 +159,11 @@ function onClose() {