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",
"version": "1.9.2-2",
"version": "1.9.2-3",
"private": true,
"bin": "dist/service.js",
"scripts": {

View File

@@ -85,14 +85,14 @@ const superUser = store.state.auth.superUser
:item="{
title: '电影',
icon: 'mdi-movie-check-outline',
to: '/subscribe-movie',
to: '/subscribe-movie/mysub',
}"
/>
<VerticalNavLink
:item="{
title: '电视剧',
icon: 'mdi-television-classic',
to: '/subscribe-tv',
to: '/subscribe-tv/mysub',
}"
/>
<VerticalNavLink
@@ -144,7 +144,7 @@ const superUser = store.state.auth.superUser
:item="{
title: '插件',
icon: 'mdi-apps',
to: '/plugins',
to: '/plugins/installed',
}"
/>
<VerticalNavLink
@@ -160,7 +160,7 @@ const superUser = store.state.auth.superUser
:item="{
title: '设定',
icon: 'mdi-cog',
to: '/setting',
to: '/setting/account',
}"
/>
</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) {
sortDashboardConfigs()
@@ -179,7 +180,7 @@ function sortDashboardConfigs() {
}
// 设置项目
function saveDashboardConfig() {
async function saveDashboardConfig() {
// 启用配置
const data = JSON.stringify(enableConfig.value)
localStorage.setItem('MP_DASHBOARD', data)
@@ -190,12 +191,12 @@ function saveDashboardConfig() {
localStorage.setItem('MP_DASHBOARD_ELEVATED', isElevated.value.toString())
// 保存到服务端
try {
api.post('/user/config/Dashboard', data, {
await api.post('/user/config/Dashboard', data, {
headers: {
'Content-Type': 'application/json',
},
})
api.post('/user/config/DashboardOrder', order, {
await api.post('/user/config/DashboardOrder', order, {
headers: {
'Content-Type': 'application/json',
},
@@ -339,7 +340,7 @@ onBeforeMount(async () => {
</VRow>
<VRow>
<VCol cols="12" md="6">
<VSwitch v-model="isElevated" label="高度拉升" />
<VSwitch v-model="isElevated" label="自适应组件高度" />
</VCol>
</VRow>
</VCardText>

View File

@@ -73,7 +73,7 @@ const tabs = [
<template>
<div>
<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" />
{{ item.title }}
</VTab>

View File

@@ -23,7 +23,7 @@ const activeTab = ref(route.params.tab)
<template>
<div>
<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>
</VTab>
</VTabs>

View File

@@ -23,7 +23,7 @@ const activeTab = ref(route.params.tab)
<template>
<div>
<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>
</VTab>
</VTabs>

View File

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

View File

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