Compare commits

...

8 Commits

Author SHA1 Message Date
jxxghp
3ffe354770 v1.9.2-3 2024-05-31 08:04:48 +08:00
jxxghp
52e0d3a4bc fix tab route 2024-05-31 08:04:27 +08:00
jxxghp
e865a5ca62 Merge pull request #136 from hotlcc/develop-20240530 2024-05-30 15:24:06 +08:00
Allen
528a4ddb03 完善设定tab精确路由 2024-05-30 15:16:49 +08:00
jxxghp
36f3b649c6 Merge pull request #135 from hotlcc/develop-20240530 2024-05-30 11:59:54 +08:00
Allen
ce91c0cc30 await接口请求后才重新获取插件仪表板,解决仪表板调整配置保存时出现重复插件请求的问题 2024-05-30 11:36:13 +08:00
jxxghp
e31e9e3520 更新 dashboard.vue 2024-05-29 15:30:04 +08:00
jxxghp
df313ebe7f fix 2024-05-29 15:26:59 +08:00
8 changed files with 25 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "moviepilot", "name": "moviepilot",
"version": "1.9.2-2", "version": "1.9.2-3",
"private": true, "private": true,
"bin": "dist/service.js", "bin": "dist/service.js",
"scripts": { "scripts": {

View File

@@ -85,14 +85,14 @@ const superUser = store.state.auth.superUser
:item="{ :item="{
title: '电影', title: '电影',
icon: 'mdi-movie-check-outline', icon: 'mdi-movie-check-outline',
to: '/subscribe-movie', to: '/subscribe-movie/mysub',
}" }"
/> />
<VerticalNavLink <VerticalNavLink
:item="{ :item="{
title: '电视剧', title: '电视剧',
icon: 'mdi-television-classic', icon: 'mdi-television-classic',
to: '/subscribe-tv', to: '/subscribe-tv/mysub',
}" }"
/> />
<VerticalNavLink <VerticalNavLink
@@ -144,7 +144,7 @@ const superUser = store.state.auth.superUser
:item="{ :item="{
title: '插件', title: '插件',
icon: 'mdi-apps', icon: 'mdi-apps',
to: '/plugins', to: '/plugins/installed',
}" }"
/> />
<VerticalNavLink <VerticalNavLink
@@ -160,7 +160,7 @@ const superUser = store.state.auth.superUser
:item="{ :item="{
title: '设定', title: '设定',
icon: 'mdi-cog', icon: 'mdi-cog',
to: '/setting', to: '/setting/account',
}" }"
/> />
</template> </template>

View File

@@ -158,7 +158,8 @@ async function loadDashboardConfig() {
} }
} }
// 是否拉升高度 // 是否拉升高度
isElevated.value = localStorage.getItem('MP_DASHBOARD_ELEVATED') === 'true' const local_elevated = localStorage.getItem('MP_DASHBOARD_ELEVATED')
if (local_elevated) isElevated.value = local_elevated === 'true'
// 排序 // 排序
if (orderConfig.value) { if (orderConfig.value) {
sortDashboardConfigs() sortDashboardConfigs()
@@ -179,7 +180,7 @@ function sortDashboardConfigs() {
} }
// 设置项目 // 设置项目
function saveDashboardConfig() { async function saveDashboardConfig() {
// 启用配置 // 启用配置
const data = JSON.stringify(enableConfig.value) const data = JSON.stringify(enableConfig.value)
localStorage.setItem('MP_DASHBOARD', data) localStorage.setItem('MP_DASHBOARD', data)
@@ -190,12 +191,12 @@ function saveDashboardConfig() {
localStorage.setItem('MP_DASHBOARD_ELEVATED', isElevated.value.toString()) localStorage.setItem('MP_DASHBOARD_ELEVATED', isElevated.value.toString())
// 保存到服务端 // 保存到服务端
try { try {
api.post('/user/config/Dashboard', data, { await api.post('/user/config/Dashboard', data, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
}) })
api.post('/user/config/DashboardOrder', order, { await api.post('/user/config/DashboardOrder', order, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
@@ -339,7 +340,7 @@ onBeforeMount(async () => {
</VRow> </VRow>
<VRow> <VRow>
<VCol cols="12" md="6"> <VCol cols="12" md="6">
<VSwitch v-model="isElevated" label="高度拉升" /> <VSwitch v-model="isElevated" label="自适应组件高度" />
</VCol> </VCol>
</VRow> </VRow>
</VCardText> </VCardText>

View File

@@ -73,7 +73,7 @@ const tabs = [
<template> <template>
<div> <div>
<VTabs v-model="activeTab" show-arrows class="v-tabs-pill"> <VTabs v-model="activeTab" show-arrows class="v-tabs-pill">
<VTab v-for="item in tabs" :key="item.icon" :value="item.tab"> <VTab v-for="item in tabs" :key="item.icon" :value="item.tab" :to="'/setting/' + item.tab">
<VIcon size="20" start :icon="item.icon" /> <VIcon size="20" start :icon="item.icon" />
{{ item.title }} {{ item.title }}
</VTab> </VTab>

View File

@@ -23,7 +23,7 @@ const activeTab = ref(route.params.tab)
<template> <template>
<div> <div>
<VTabs v-model="activeTab"> <VTabs v-model="activeTab">
<VTab v-for="item in tabs" :value="item.tab"> <VTab v-for="item in tabs" :value="item.tab" :to="'/subscribe-movie/' + item.tab">
<span class="mx-5">{{ item.title }}</span> <span class="mx-5">{{ item.title }}</span>
</VTab> </VTab>
</VTabs> </VTabs>

View File

@@ -23,7 +23,7 @@ const activeTab = ref(route.params.tab)
<template> <template>
<div> <div>
<VTabs v-model="activeTab"> <VTabs v-model="activeTab">
<VTab v-for="item in tabs" :value="item.tab"> <VTab v-for="item in tabs" :value="item.tab" :to="'/subscribe-tv/' + item.tab">
<span class="mx-5">{{ item.title }}</span> <span class="mx-5">{{ item.title }}</span>
</VTab> </VTab>
</VTabs> </VTabs>

View File

@@ -10,8 +10,7 @@ const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL), history: createWebHashHistory(import.meta.env.BASE_URL),
scrollBehavior(to, from, savedPosition) { scrollBehavior(to, from, savedPosition) {
// 如果页面有缓存那么恢复其位置, 否则始终滚动到顶部 // 如果页面有缓存那么恢复其位置, 否则始终滚动到顶部
if (to.meta.keepAlive && savedPosition) if (to.meta.keepAlive && savedPosition) return savedPosition
return savedPosition
return { top: 0 } return { top: 0 }
}, },
routes: [ routes: [
@@ -43,14 +42,14 @@ const router = createRouter({
}, },
}, },
{ {
path: 'subscribe-movie', path: 'subscribe-movie/:tab',
component: () => import('../pages/subscribe-movie.vue'), component: () => import('../pages/subscribe-movie.vue'),
meta: { meta: {
requiresAuth: true, requiresAuth: true,
}, },
}, },
{ {
path: 'subscribe-tv', path: 'subscribe-tv/:tab',
component: () => import('../pages/subscribe-tv.vue'), component: () => import('../pages/subscribe-tv.vue'),
meta: { meta: {
requiresAuth: true, requiresAuth: true,
@@ -85,14 +84,14 @@ const router = createRouter({
}, },
}, },
{ {
path: 'plugins', path: 'plugins/:tab',
component: () => import('../pages/plugin.vue'), component: () => import('../pages/plugin.vue'),
meta: { meta: {
requiresAuth: true, requiresAuth: true,
}, },
}, },
{ {
path: 'setting', path: 'setting/:tab',
component: () => import('../pages/setting.vue'), component: () => import('../pages/setting.vue'),
meta: { meta: {
requiresAuth: true, requiresAuth: true,
@@ -165,8 +164,7 @@ router.beforeEach((to, from, next) => {
if (to.meta.requiresAuth && !isAuthenticated) { if (to.meta.requiresAuth && !isAuthenticated) {
next('/login') next('/login')
} } else {
else {
startNProgress() startNProgress()
next() next()
} }

View File

@@ -25,11 +25,11 @@ const activeTab = ref(route.params.tab)
const tabs = [ const tabs = [
{ {
title: '我的插件', title: '我的插件',
tab: 'myplugin', tab: 'installed',
}, },
{ {
title: '插件市场', title: '插件市场',
tab: 'pluginmarket', tab: 'market',
}, },
] ]
@@ -330,14 +330,14 @@ onBeforeMount(async () => {
<template> <template>
<div> <div>
<VTabs v-model="activeTab"> <VTabs v-model="activeTab">
<VTab v-for="item in tabs" :value="item.tab"> <VTab v-for="item in tabs" :value="item.tab" :to="'/plugins/' + item.tab">
<span class="mx-5">{{ item.title }}</span> <span class="mx-5">{{ item.title }}</span>
</VTab> </VTab>
</VTabs> </VTabs>
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false"> <VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
<!-- 我的插件 --> <!-- 我的插件 -->
<VWindowItem value="myplugin"> <VWindowItem value="installed">
<transition name="fade-slide" appear> <transition name="fade-slide" appear>
<div> <div>
<LoadingBanner v-if="!isRefreshed" class="mt-12" /> <LoadingBanner v-if="!isRefreshed" class="mt-12" />
@@ -363,7 +363,7 @@ onBeforeMount(async () => {
</transition> </transition>
</VWindowItem> </VWindowItem>
<!-- 插件市场 --> <!-- 插件市场 -->
<VWindowItem value="pluginmarket"> <VWindowItem value="market">
<transition name="fade-slide" appear> <transition name="fade-slide" appear>
<div> <div>
<LoadingBanner v-if="!isAppMarketLoaded" class="mt-12" /> <LoadingBanner v-if="!isAppMarketLoaded" class="mt-12" />