feat: create RSS page

This commit is contained in:
Rewrite0
2023-08-13 19:49:43 +08:00
parent 6743219e59
commit 3425e38bb1
11 changed files with 49 additions and 5 deletions

View File

@@ -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": {

11
webui/pnpm-lock.yaml generated
View File

@@ -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:

View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.88235 20C2.07843 20 1.39706 19.7206 0.838235 19.1618C0.279412 18.6029 0 17.9216 0 17.1176C0 16.3137 0.279412 15.6324 0.838235 15.0735C1.39706 14.5147 2.07843 14.2353 2.88235 14.2353C3.68627 14.2353 4.36765 14.5147 4.92647 15.0735C5.48529 15.6324 5.76471 16.3137 5.76471 17.1176C5.76471 17.9216 5.48529 18.6029 4.92647 19.1618C4.36765 19.7206 3.68627 20 2.88235 20ZM17.3529 20C17.3529 17.6078 16.8971 15.3578 15.9853 13.25C15.0735 11.1422 13.8333 9.30392 12.2647 7.73529C10.6961 6.16667 8.85784 4.92647 6.75 4.01471C4.64216 3.10294 2.39216 2.64706 0 2.64706V0C2.76471 0 5.35784 0.52451 7.77941 1.57353C10.201 2.62255 12.3186 4.05392 14.1324 5.86765C15.9461 7.68137 17.3775 9.79902 18.4265 12.2206C19.4755 14.6422 20 17.2353 20 20H17.3529ZM10.3529 20C10.3529 16.902 9.40196 14.3627 7.5 12.3824C5.59804 10.402 3.09804 9.41177 0 9.41177V6.76471C1.90196 6.76471 3.64706 7.09804 5.23529 7.76471C6.82353 8.43137 8.19118 9.35294 9.33823 10.5294C10.4853 11.7059 11.3824 13.1029 12.0294 14.7206C12.6765 16.3382 13 18.098 13 20H10.3529Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -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 = [
]"
>
<Component :is="i.icon" :size="24" />
<div text-h2>{{ i.label() }}</div>
</RouterLink>

View File

@@ -14,7 +14,8 @@
"config": "Config",
"logout": "Logout",
"downloader": "Downloader",
"calendar": "Calendar"
"calendar": "Calendar",
"rss": "RSS Manager"
},
"topbar": {
"start": "Start",

View File

@@ -14,7 +14,8 @@
"config": "设置",
"logout": "退出",
"calendar": "番剧日历",
"downloader": "下载器"
"downloader": "下载器",
"rss": "RSS 管理"
},
"topbar": {
"start": "启动",

View File

@@ -0,0 +1,9 @@
<script lang="ts" setup>
definePage({
name: 'RSS',
});
</script>
<template>
<div>null</div>
</template>

View File

@@ -16,6 +16,7 @@
"baseUrl": "./",
"types": ["vite-plugin-pwa/client"],
"paths": {
"~/*": ["./*"],
"@/*": ["src/*"],
"#/*": ["types/*"]
}

View File

@@ -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']

View File

@@ -46,6 +46,7 @@ declare module 'vue-router/auto/routes' {
'Downloader': RouteRecordInfo<'Downloader', '/downloader', Record<never, never>, Record<never, never>>,
'Log': RouteRecordInfo<'Log', '/log', Record<never, never>, Record<never, never>>,
'Player': RouteRecordInfo<'Player', '/player', Record<never, never>, Record<never, never>>,
'RSS': RouteRecordInfo<'RSS', '/rss', Record<never, never>, Record<never, never>>,
'Login': RouteRecordInfo<'Login', '/login', Record<never, never>, Record<never, never>>,
}
}

View File

@@ -89,6 +89,7 @@ export default defineConfig({
},
resolve: {
alias: {
'~': resolve(__dirname, './'),
'@': resolve(__dirname, 'src'),
'#': resolve(__dirname, 'types'),
},