mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
sync main
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "1.9.10",
|
"version": "2.0.0-alpha",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ function openSearchDialog() {
|
|||||||
searchDialog.value = true
|
searchDialog.value = true
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测操作系统是否是Mac
|
||||||
|
function isMac() {
|
||||||
|
return navigator.platform.toUpperCase().indexOf('MAC') >= 0
|
||||||
|
}
|
||||||
|
// 计算属性:根据操作系统显示不同的按键提示
|
||||||
|
const metaKey = computed(() => (isMac() ? '⌘+K' : 'Ctrl+K'))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -25,7 +32,7 @@ function openSearchDialog() {
|
|||||||
</IconBtn>
|
</IconBtn>
|
||||||
<span v-if="display.lgAndUp.value" class="flex align-center text-disabled ms-2" @click="openSearchDialog">
|
<span v-if="display.lgAndUp.value" class="flex align-center text-disabled ms-2" @click="openSearchDialog">
|
||||||
<span class="me-3">搜索</span>
|
<span class="me-3">搜索</span>
|
||||||
<span class="meta-key">⌘K</span>
|
<span class="meta-key">{{ metaKey }}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索弹窗 -->
|
<!-- 搜索弹窗 -->
|
||||||
|
|||||||
+31
-11
@@ -32,8 +32,10 @@ function jumpTab(tab: string) {
|
|||||||
@click="jumpTab(item.tab)"
|
@click="jumpTab(item.tab)"
|
||||||
selected-class="v-slide-group-item--active v-tab--selected"
|
selected-class="v-slide-group-item--active v-tab--selected"
|
||||||
>
|
>
|
||||||
<VIcon size="20" start :icon="item.icon" />
|
<div>
|
||||||
{{ item.title }}
|
<VIcon size="20" start :icon="item.icon" />
|
||||||
|
{{ item.title }}
|
||||||
|
</div>
|
||||||
</VTab>
|
</VTab>
|
||||||
</VTabs>
|
</VTabs>
|
||||||
|
|
||||||
@@ -41,21 +43,27 @@ function jumpTab(tab: string) {
|
|||||||
<!-- 连接 -->
|
<!-- 连接 -->
|
||||||
<VWindowItem value="system">
|
<VWindowItem value="system">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingSystem />
|
<div>
|
||||||
|
<AccountSettingSystem />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 目录 -->
|
<!-- 目录 -->
|
||||||
<VWindowItem value="directory">
|
<VWindowItem value="directory">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingDirectory />
|
<div>
|
||||||
|
<AccountSettingDirectory />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 站点 -->
|
<!-- 站点 -->
|
||||||
<VWindowItem value="site">
|
<VWindowItem value="site">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingSite />
|
<div>
|
||||||
|
<AccountSettingSite />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
@@ -69,42 +77,54 @@ function jumpTab(tab: string) {
|
|||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<VWindowItem value="search">
|
<VWindowItem value="search">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingSearch />
|
<div>
|
||||||
|
<AccountSettingSearch />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 订阅 -->
|
<!-- 订阅 -->
|
||||||
<VWindowItem value="subscribe">
|
<VWindowItem value="subscribe">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingSubscribe />
|
<div>
|
||||||
|
<AccountSettingSubscribe />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 服务 -->
|
<!-- 服务 -->
|
||||||
<VWindowItem value="service">
|
<VWindowItem value="service">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingService />
|
<div>
|
||||||
|
<AccountSettingService />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 通知 -->
|
<!-- 通知 -->
|
||||||
<VWindowItem value="notification">
|
<VWindowItem value="notification">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingNotification />
|
<div>
|
||||||
|
<AccountSettingNotification />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 词表 -->
|
<!-- 词表 -->
|
||||||
<VWindowItem value="words">
|
<VWindowItem value="words">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingWords />
|
<div>
|
||||||
|
<AccountSettingWords />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
|
|
||||||
<!-- 关于 -->
|
<!-- 关于 -->
|
||||||
<VWindowItem value="about">
|
<VWindowItem value="about">
|
||||||
<transition name="fade-slide" appear>
|
<transition name="fade-slide" appear>
|
||||||
<AccountSettingAbout />
|
<div>
|
||||||
|
<AccountSettingAbout />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</VWindowItem>
|
</VWindowItem>
|
||||||
</VWindow>
|
</VWindow>
|
||||||
|
|||||||
@@ -80,7 +80,13 @@ const options = controlledComputed(
|
|||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
},
|
},
|
||||||
|
|
||||||
formatter: (value: number) => (value > 999 ? (value / 1000).toFixed(0) : value),
|
formatter: (value: number) => {
|
||||||
|
if (value > 999) {
|
||||||
|
return (value / 1000).toFixed(1) + 'k'
|
||||||
|
} else {
|
||||||
|
return value.toString()
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,12 +148,19 @@ const totalPage = computed(() => {
|
|||||||
|
|
||||||
// 切换页签和搜索词
|
// 切换页签和搜索词
|
||||||
watch(
|
watch(
|
||||||
[() => currentPage.value, () => itemsPerPage.value, () => search.value],
|
[() => currentPage.value, () => itemsPerPage.value],
|
||||||
debounce(async () => {
|
debounce(async () => {
|
||||||
reloadPage()
|
reloadPage()
|
||||||
}, 1000),
|
}, 1000),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
[() => search.value],
|
||||||
|
debounce(async () => {
|
||||||
|
reloadPage(true)
|
||||||
|
}, 1000),
|
||||||
|
)
|
||||||
|
|
||||||
// 获取订阅列表数据
|
// 获取订阅列表数据
|
||||||
async function fetchData(page = currentPage.value, count = itemsPerPage.value) {
|
async function fetchData(page = currentPage.value, count = itemsPerPage.value) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -266,19 +273,6 @@ async function removeHistoryBatch() {
|
|||||||
deleteConfirmDialog.value = true
|
deleteConfirmDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算根路径
|
|
||||||
function getRootPath(path: string, type: string, category: string) {
|
|
||||||
if (!path) return ''
|
|
||||||
|
|
||||||
let index = -2
|
|
||||||
if (type !== '电影') index = -3
|
|
||||||
|
|
||||||
if (category) index -= 1
|
|
||||||
|
|
||||||
if (path.includes('/')) return path.split('/').slice(0, index).join('/')
|
|
||||||
else return path.split('\\').slice(0, index).join('\\')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量重新整理
|
// 批量重新整理
|
||||||
async function retransferBatch() {
|
async function retransferBatch() {
|
||||||
if (selected.value.length === 0) return
|
if (selected.value.length === 0) return
|
||||||
@@ -335,7 +329,7 @@ function addUrlQuery(url: string, name: string, value: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 重载页面
|
// 重载页面
|
||||||
function reloadPage() {
|
function reloadPage(resetPage = false) {
|
||||||
let url = '/history'
|
let url = '/history'
|
||||||
if (search.value) {
|
if (search.value) {
|
||||||
url = addUrlQuery(url, 'search', search.value)
|
url = addUrlQuery(url, 'search', search.value)
|
||||||
@@ -344,7 +338,7 @@ function reloadPage() {
|
|||||||
url = addUrlQuery(url, 'itemsPerPage', itemsPerPage.value)
|
url = addUrlQuery(url, 'itemsPerPage', itemsPerPage.value)
|
||||||
}
|
}
|
||||||
if (currentPage.value) {
|
if (currentPage.value) {
|
||||||
url = addUrlQuery(url, 'currentPage', currentPage.value)
|
url = addUrlQuery(url, 'currentPage', resetPage ? 1 : currentPage.value)
|
||||||
}
|
}
|
||||||
router.push(url)
|
router.push(url)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user