新增支持站点折叠功能,并更新相关国际化文本

This commit is contained in:
jxxghp
2025-07-21 11:53:29 +08:00
parent 23a48e07a2
commit 536793ab25
4 changed files with 60 additions and 12 deletions
+2
View File
@@ -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',
+2
View File
@@ -1102,6 +1102,8 @@ export default {
viewChangelog: '查看变更日志', viewChangelog: '查看变更日志',
changelog: '变更日志', changelog: '变更日志',
dataDirectory: '/moviepilot', dataDirectory: '/moviepilot',
expand: '展开',
collapse: '收起',
}, },
system: { system: {
custom: '自定义', custom: '自定义',
+2
View File
@@ -1101,6 +1101,8 @@ export default {
viewChangelog: '查看變更日誌', viewChangelog: '查看變更日誌',
changelog: '變更日誌', changelog: '變更日誌',
dataDirectory: '/moviepilot', dataDirectory: '/moviepilot',
expand: '展開',
collapse: '收起',
}, },
system: { system: {
custom: '自定義', custom: '自定義',
+54 -12
View File
@@ -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>