diff --git a/package-lock.json b/package-lock.json index 0595d5b7..61e065bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "vue3-apexcharts": "^1.4.4", "vue3-toastify": "^0.1.14", "vuedraggable": "^4.1.0", - "vuetify": "^3.4.2" + "vuetify": "^3.4.3" }, "devDependencies": { "@pinia/testing": "^0.1.3", @@ -8090,9 +8090,9 @@ } }, "node_modules/vuetify": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.4.2.tgz", - "integrity": "sha512-WvfVmES1SkhrCfYcfzPp8jpfIM+L+OcN9EYiBM+4bpmsIXLNJyMv42QhoDDWihSO6/zbE8RqCtyHawpu4ApyzA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.4.3.tgz", + "integrity": "sha512-b8yi87Zv4bn2JbaVkkV9uzSRw0fdY/v3ieWne0OTI29w/CNSyLyfHGBCrmx7eD74i562M1j+AwSSRJCX3wF0+Q==", "engines": { "node": "^12.20 || >=14.13" }, diff --git a/package.json b/package.json index b91f55ea..258c6026 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "vue3-apexcharts": "^1.4.4", "vue3-toastify": "^0.1.14", "vuedraggable": "^4.1.0", - "vuetify": "^3.4.2" + "vuetify": "^3.4.3" }, "devDependencies": { "@pinia/testing": "^0.1.3", diff --git a/src/components/DnDZone.vue b/src/components/DnDZone.vue index 8f9d31d8..f28a1bc3 100644 --- a/src/components/DnDZone.vue +++ b/src/components/DnDZone.vue @@ -11,7 +11,10 @@ const authStore = useAuthStore() const dndZoneRef = ref() function onDragEnter() { - if (['login', 'settings'].includes(route.name as string) || !authStore.isAuthenticated) return + if ( + (route.name as string) === 'login' + || (route.name as string) === 'settings' && route.params.tab === 'vuetorrent' && route.params.subtab === 'torrentCard' + || !authStore.isAuthenticated) return isOverDropZone.value = true } diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 8de5c2ac..6e3ed765 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -13,7 +13,7 @@ import VGeneral from '@/components/Settings/VueTorrent/General.vue' import VTorrentCard from '@/components/Settings/VueTorrent/TorrentCard.vue' import WebUI from '@/components/Settings/WebUI.vue' import { useDialogStore, usePreferenceStore } from '@/stores' -import { onBeforeUnmount, onMounted, ref } from 'vue' +import { onBeforeUnmount, onMounted, ref, watchEffect } from 'vue' import { useI18n } from 'vue-i18n' import { useRouter } from 'vue-router' import { toast } from 'vue3-toastify' @@ -23,6 +23,30 @@ const { t } = useI18n() const dialogStore = useDialogStore() const preferenceStore = usePreferenceStore() +const tabs = [ + { text: t('settings.tabs.vuetorrent.title'), value: 'vuetorrent' }, + { text: t('settings.tabs.behavior'), value: 'behavior' }, + { text: t('settings.tabs.downloads'), value: 'downloads' }, + { text: t('settings.tabs.connection'), value: 'connection' }, + { text: t('settings.tabs.speed'), value: 'speed' }, + { text: t('settings.tabs.bittorrent'), value: 'bittorrent' }, + { text: t('settings.tabs.rss.title'), value: 'rss' }, + { text: t('settings.tabs.webui'), value: 'webui' }, + { text: t('settings.tabs.tagsAndCategories'), value: 'tagsAndCategories' }, + { text: t('settings.tabs.advanced'), value: 'advanced' } +] + +const tabsV = [ + { text: t('settings.tabs.vuetorrent.general'), value: 'general' }, + { text: t('settings.tabs.vuetorrent.torrent_card'), value: 'torrentCard' } +] + +const tabsR = [ + { text: t('settings.tabs.rss.general'), value: 'general' }, + { text: t('settings.tabs.rss.feeds'), value: 'feeds' }, + { text: t('settings.tabs.rss.rules'), value: 'rules' } +] + const tab = ref('vuetorrent') const innerTabV = ref('general') const innerTabR = ref('general') @@ -57,8 +81,27 @@ function handleKeyboardShortcut(e: KeyboardEvent) { } } +function updateTabHandle() { + const tabRouteParam = router.currentRoute.value.params.tab as string + const subtabRouteParam = router.currentRoute.value.params.subtab as string + if (tabRouteParam) { + if (tabRouteParam === 'vuetorrent' && subtabRouteParam) { + innerTabV.value = subtabRouteParam + } else if (tabRouteParam === 'rss' && subtabRouteParam) { + innerTabR.value = subtabRouteParam + } + tab.value = tabRouteParam + } +} + +watchEffect(() => { + updateTabHandle() +}) + onMounted(() => { document.addEventListener('keydown', handleKeyboardShortcut) + updateTabHandle() + }) onBeforeUnmount(() => { document.removeEventListener('keydown', handleKeyboardShortcut) @@ -83,29 +126,18 @@ onBeforeUnmount(() => { - {{ t('settings.tabs.vuetorrent.title') }} - {{ t('settings.tabs.behavior') }} - {{ t('settings.tabs.downloads') }} - {{ t('settings.tabs.connection') }} - {{ t('settings.tabs.speed') }} - {{ t('settings.tabs.bittorrent') }} - {{ t('settings.tabs.rss.title') }} - {{ t('settings.tabs.webui') }} - {{ t('settings.tabs.tagsAndCategories') }} - {{ t('settings.tabs.advanced') }} + - - - {{ t('settings.tabs.vuetorrent.general') }} - - - {{ t('settings.tabs.vuetorrent.torrent_card') }} - + + + + @@ -138,15 +170,9 @@ onBeforeUnmount(() => { - - {{ t('settings.tabs.rss.general') }} - - - {{ t('settings.tabs.rss.feeds') }} - - - {{ t('settings.tabs.rss.rules') }} - + + diff --git a/src/pages/index.ts b/src/pages/index.ts index 6497504c..6307a806 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -8,7 +8,7 @@ export const routes: RouteRecordRaw[] = [ }, { name: 'settings', - path: '/settings', + path: '/settings/:tab?/:subtab?', component: () => import('./Settings.vue') }, {