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

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',
changelog: 'Changelog',
dataDirectory: '/moviepilot',
expand: 'Expand',
collapse: 'Collapse',
},
system: {
custom: 'Custom',
+2
View File
@@ -1102,6 +1102,8 @@ export default {
viewChangelog: '查看变更日志',
changelog: '变更日志',
dataDirectory: '/moviepilot',
expand: '展开',
collapse: '收起',
},
system: {
custom: '自定义',
+2
View File
@@ -1101,6 +1101,8 @@ export default {
viewChangelog: '查看變更日誌',
changelog: '變更日誌',
dataDirectory: '/moviepilot',
expand: '展開',
collapse: '收起',
},
system: {
custom: '自定義',
+51 -9
View File
@@ -15,6 +15,35 @@ const allRelease = 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)
@@ -68,6 +97,11 @@ async function querySupportingSites() {
}
}
//
function toggleSitesExpanded() {
sitesExpanded.value = !sitesExpanded.value
}
//
function releaseTime(releaseDate: string) {
//
@@ -173,19 +207,27 @@ onMounted(() => {
<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>
<dd class="flex text-sm sm:col-span-2 sm:mt-0">
<div class="flex flex-col gap-2">
<div class="flex flex-wrap gap-2">
<VChip
v-for="(site, domain) in supportingSites"
:key="domain"
variant="outlined"
size="small"
:title="`${site.name} - ${site.url}`"
target="_blank"
rel="noreferrer"
>
<VChip v-for="site in displayedSites" :key="site.name" variant="outlined" size="small">
<span class="truncate max-w-32">{{ site.name }}</span>
</VChip>
</div>
<div v-if="uniqueSupportingSites.length > 5" class="flex justify-start">
<VBtn
variant="text"
size="small"
@click="toggleSitesExpanded"
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>
</dd>
</div>
</div>