fix: calculate total file size on backend instead of frontend

- Backend returns total_size for all matching versions
- Frontend uses backend's total_size instead of computing from current page

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 00:11:33 +08:00
parent 275698a32b
commit 0a20892f94
2 changed files with 24 additions and 3 deletions
+2 -3
View File
@@ -68,9 +68,7 @@ const methodOptions = computed(() => [
{ label: t('admin.versions.methods.manual'), value: 'manual' },
])
const totalSize = computed(() => {
return versions.value.reduce((sum, v) => sum + (v.file_size || 0), 0)
})
const totalSize = ref(0)
const serverPagination = computed(() => ({
page: currentPage.value,
@@ -131,6 +129,7 @@ async function fetchVersions() {
versions.value = data?.versions || []
total.value = data?.total || 0
forcedCount.value = data?.forced_count || 0
totalSize.value = data?.total_size || 0
}
catch (error) {
console.error('加载版本列表失败:', error)