mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
新增支持站点折叠功能,并更新相关国际化文本
This commit is contained in:
@@ -1106,6 +1106,8 @@ export default {
|
|||||||
viewChangelog: 'View Changelog',
|
viewChangelog: 'View Changelog',
|
||||||
changelog: 'Changelog',
|
changelog: 'Changelog',
|
||||||
dataDirectory: '/moviepilot',
|
dataDirectory: '/moviepilot',
|
||||||
|
expand: 'Expand',
|
||||||
|
collapse: 'Collapse',
|
||||||
},
|
},
|
||||||
system: {
|
system: {
|
||||||
custom: 'Custom',
|
custom: 'Custom',
|
||||||
|
|||||||
@@ -1102,6 +1102,8 @@ export default {
|
|||||||
viewChangelog: '查看变更日志',
|
viewChangelog: '查看变更日志',
|
||||||
changelog: '变更日志',
|
changelog: '变更日志',
|
||||||
dataDirectory: '/moviepilot',
|
dataDirectory: '/moviepilot',
|
||||||
|
expand: '展开',
|
||||||
|
collapse: '收起',
|
||||||
},
|
},
|
||||||
system: {
|
system: {
|
||||||
custom: '自定义',
|
custom: '自定义',
|
||||||
|
|||||||
@@ -1101,6 +1101,8 @@ export default {
|
|||||||
viewChangelog: '查看變更日誌',
|
viewChangelog: '查看變更日誌',
|
||||||
changelog: '變更日誌',
|
changelog: '變更日誌',
|
||||||
dataDirectory: '/moviepilot',
|
dataDirectory: '/moviepilot',
|
||||||
|
expand: '展開',
|
||||||
|
collapse: '收起',
|
||||||
},
|
},
|
||||||
system: {
|
system: {
|
||||||
custom: '自定義',
|
custom: '自定義',
|
||||||
|
|||||||
@@ -15,6 +15,35 @@ const allRelease = ref<any>([])
|
|||||||
// 支持站点
|
// 支持站点
|
||||||
const supportingSites = ref<any>({})
|
const supportingSites = ref<any>({})
|
||||||
|
|
||||||
|
// 支持站点折叠状态
|
||||||
|
const sitesExpanded = ref(false)
|
||||||
|
|
||||||
|
// 去重后的支持站点
|
||||||
|
const uniqueSupportingSites = computed(() => {
|
||||||
|
const sitesMap = new Map()
|
||||||
|
|
||||||
|
Object.entries(supportingSites.value).forEach(([domain, site]: [string, any]) => {
|
||||||
|
if (!sitesMap.has(site.name)) {
|
||||||
|
sitesMap.set(site.name, {
|
||||||
|
name: site.name,
|
||||||
|
urls: [{ domain, url: site.url }],
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
sitesMap.get(site.name).urls.push({ domain, url: site.url })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return Array.from(sitesMap.values())
|
||||||
|
})
|
||||||
|
|
||||||
|
// 显示的支持站点(折叠时只显示前5个)
|
||||||
|
const displayedSites = computed(() => {
|
||||||
|
if (sitesExpanded.value) {
|
||||||
|
return uniqueSupportingSites.value
|
||||||
|
}
|
||||||
|
return uniqueSupportingSites.value.slice(0, 5)
|
||||||
|
})
|
||||||
|
|
||||||
// 变更日志对话框
|
// 变更日志对话框
|
||||||
const releaseDialog = ref(false)
|
const releaseDialog = ref(false)
|
||||||
|
|
||||||
@@ -68,6 +97,11 @@ async function querySupportingSites() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 切换站点列表展开状态
|
||||||
|
function toggleSitesExpanded() {
|
||||||
|
sitesExpanded.value = !sitesExpanded.value
|
||||||
|
}
|
||||||
|
|
||||||
// 计算发布时间
|
// 计算发布时间
|
||||||
function releaseTime(releaseDate: string) {
|
function releaseTime(releaseDate: string) {
|
||||||
// 上一次更新时间
|
// 上一次更新时间
|
||||||
@@ -173,18 +207,26 @@ onMounted(() => {
|
|||||||
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
|
<div class="max-w-6xl py-4 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
<dt class="block text-sm font-bold">{{ t('setting.about.supportingSites') }}</dt>
|
<dt class="block text-sm font-bold">{{ t('setting.about.supportingSites') }}</dt>
|
||||||
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
|
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
|
||||||
<div class="flex flex-wrap gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<VChip
|
<div class="flex flex-wrap gap-2">
|
||||||
v-for="(site, domain) in supportingSites"
|
<VChip v-for="site in displayedSites" :key="site.name" variant="outlined" size="small">
|
||||||
:key="domain"
|
<span class="truncate max-w-32">{{ site.name }}</span>
|
||||||
variant="outlined"
|
</VChip>
|
||||||
size="small"
|
</div>
|
||||||
:title="`${site.name} - ${site.url}`"
|
<div v-if="uniqueSupportingSites.length > 5" class="flex justify-start">
|
||||||
target="_blank"
|
<VBtn
|
||||||
rel="noreferrer"
|
variant="text"
|
||||||
>
|
size="small"
|
||||||
<span class="truncate max-w-32">{{ site.name }}</span>
|
@click="toggleSitesExpanded"
|
||||||
</VChip>
|
class="text-indigo-500 hover:text-indigo-400"
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<VIcon :icon="sitesExpanded ? 'mdi-chevron-up' : 'mdi-chevron-down'" />
|
||||||
|
</template>
|
||||||
|
{{ sitesExpanded ? t('setting.about.collapse') : t('setting.about.expand') }}
|
||||||
|
({{ uniqueSupportingSites.length }})
|
||||||
|
</VBtn>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user