From 3425e38bb110c99d57ff77f911ab18f82f1a2d86 Mon Sep 17 00:00:00 2001 From: Rewrite0 Date: Sun, 13 Aug 2023 19:49:43 +0800 Subject: [PATCH] feat: create RSS page --- webui/package.json | 1 + webui/pnpm-lock.yaml | 11 +++++++++++ webui/public/images/RSS.svg | 3 +++ webui/src/components/layout/ab-sidebar.vue | 20 +++++++++++++++++--- webui/src/i18n/en.json | 3 ++- webui/src/i18n/zh-CN.json | 3 ++- webui/src/pages/index/rss.vue | 9 +++++++++ webui/tsconfig.json | 1 + webui/types/dts/auto-imports.d.ts | 1 + webui/types/dts/router-type.d.ts | 1 + webui/vite.config.ts | 1 + 11 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 webui/public/images/RSS.svg create mode 100644 webui/src/pages/index/rss.vue diff --git a/webui/package.json b/webui/package.json index b29dde76..0c5b929e 100644 --- a/webui/package.json +++ b/webui/package.json @@ -26,6 +26,7 @@ "pinia": "^2.1.3", "vue": "^3.3.4", "vue-i18n": "^9.2.2", + "vue-inline-svg": "^3.1.2", "vue-router": "^4.2.1" }, "devDependencies": { diff --git a/webui/pnpm-lock.yaml b/webui/pnpm-lock.yaml index 9e0133aa..bfdf406c 100644 --- a/webui/pnpm-lock.yaml +++ b/webui/pnpm-lock.yaml @@ -29,6 +29,9 @@ dependencies: vue-i18n: specifier: ^9.2.2 version: 9.2.2(vue@3.3.4) + vue-inline-svg: + specifier: ^3.1.2 + version: 3.1.2(vue@3.3.4) vue-router: specifier: ^4.2.1 version: 4.2.1(vue@3.3.4) @@ -9769,6 +9772,14 @@ packages: vue: 3.3.4 dev: true + /vue-inline-svg@3.1.2(vue@3.3.4): + resolution: {integrity: sha512-K01sLANBnjosObee4JrBu/igXpYIFhQfy4EcEyVWxEWf6nmrxp7Isz6pmeRCsWx6XGrGWfrQH3uNwt4nOmrFdA==} + peerDependencies: + vue: ^3 + dependencies: + vue: 3.3.4 + dev: false + /vue-router@4.2.1(vue@3.3.4): resolution: {integrity: sha512-nW28EeifEp8Abc5AfmAShy5ZKGsGzjcnZ3L1yc2DYUo+MqbBClrRP9yda3dIekM4I50/KnEwo1wkBLf7kHH5Cw==} peerDependencies: diff --git a/webui/public/images/RSS.svg b/webui/public/images/RSS.svg new file mode 100644 index 00000000..57f7c996 --- /dev/null +++ b/webui/public/images/RSS.svg @@ -0,0 +1,3 @@ + + + diff --git a/webui/src/components/layout/ab-sidebar.vue b/webui/src/components/layout/ab-sidebar.vue index 2893c064..23f23b5f 100644 --- a/webui/src/components/layout/ab-sidebar.vue +++ b/webui/src/components/layout/ab-sidebar.vue @@ -9,6 +9,7 @@ import { Play, SettingTwo, } from '@icon-park/vue-next'; +import InlineSvg from 'vue-inline-svg'; const props = withDefaults( defineProps<{ @@ -26,6 +27,12 @@ const toggle = () => (show.value = !show.value); const route = useRoute(); const { logout } = useAuth(); +const RSS = h( + 'span', + { class: ['rel', 'left-2px'] }, + h(InlineSvg, { src: '/images/RSS.svg' }) +); + const items = [ { id: 1, @@ -42,25 +49,31 @@ const items = [ }, { id: 3, + icon: RSS, + label: () => t('sidebar.rss'), + path: '/rss', + }, + { + id: 4, icon: Play, label: () => t('sidebar.player'), path: '/player', }, { - id: 4, + id: 5, icon: Download, label: () => t('sidebar.downloader'), path: '/downloader', hidden: true, }, { - id: 5, + id: 6, icon: Log, label: () => t('sidebar.log'), path: '/log', }, { - id: 6, + id: 7, icon: SettingTwo, label: () => t('sidebar.config'), path: '/config', @@ -123,6 +136,7 @@ const items = [ ]" > +
{{ i.label() }}
diff --git a/webui/src/i18n/en.json b/webui/src/i18n/en.json index 75e1a46a..26a30f7e 100644 --- a/webui/src/i18n/en.json +++ b/webui/src/i18n/en.json @@ -14,7 +14,8 @@ "config": "Config", "logout": "Logout", "downloader": "Downloader", - "calendar": "Calendar" + "calendar": "Calendar", + "rss": "RSS Manager" }, "topbar": { "start": "Start", diff --git a/webui/src/i18n/zh-CN.json b/webui/src/i18n/zh-CN.json index ab794519..3b13c481 100644 --- a/webui/src/i18n/zh-CN.json +++ b/webui/src/i18n/zh-CN.json @@ -14,7 +14,8 @@ "config": "设置", "logout": "退出", "calendar": "番剧日历", - "downloader": "下载器" + "downloader": "下载器", + "rss": "RSS 管理" }, "topbar": { "start": "启动", diff --git a/webui/src/pages/index/rss.vue b/webui/src/pages/index/rss.vue new file mode 100644 index 00000000..69e7d273 --- /dev/null +++ b/webui/src/pages/index/rss.vue @@ -0,0 +1,9 @@ + + + diff --git a/webui/tsconfig.json b/webui/tsconfig.json index 5bcd753a..71dca94e 100644 --- a/webui/tsconfig.json +++ b/webui/tsconfig.json @@ -16,6 +16,7 @@ "baseUrl": "./", "types": ["vite-plugin-pwa/client"], "paths": { + "~/*": ["./*"], "@/*": ["src/*"], "#/*": ["types/*"] } diff --git a/webui/types/dts/auto-imports.d.ts b/webui/types/dts/auto-imports.d.ts index 723b89f4..d557e4ba 100644 --- a/webui/types/dts/auto-imports.d.ts +++ b/webui/types/dts/auto-imports.d.ts @@ -13,6 +13,7 @@ declare global { const apiLog: typeof import('../../src/api/log')['apiLog'] const apiProgram: typeof import('../../src/api/program')['apiProgram'] const apiRSS: typeof import('../../src/api/rss')['apiRSS'] + const apiSearch: typeof import('../../src/api/search')['apiSearch'] const assert: typeof import('vitest')['assert'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] diff --git a/webui/types/dts/router-type.d.ts b/webui/types/dts/router-type.d.ts index ceb699a7..66ba5cf1 100644 --- a/webui/types/dts/router-type.d.ts +++ b/webui/types/dts/router-type.d.ts @@ -46,6 +46,7 @@ declare module 'vue-router/auto/routes' { 'Downloader': RouteRecordInfo<'Downloader', '/downloader', Record, Record>, 'Log': RouteRecordInfo<'Log', '/log', Record, Record>, 'Player': RouteRecordInfo<'Player', '/player', Record, Record>, + 'RSS': RouteRecordInfo<'RSS', '/rss', Record, Record>, 'Login': RouteRecordInfo<'Login', '/login', Record, Record>, } } diff --git a/webui/vite.config.ts b/webui/vite.config.ts index 683181d8..5de8be04 100644 --- a/webui/vite.config.ts +++ b/webui/vite.config.ts @@ -89,6 +89,7 @@ export default defineConfig({ }, resolve: { alias: { + '~': resolve(__dirname, './'), '@': resolve(__dirname, 'src'), '#': resolve(__dirname, 'types'), },