🐛 修复历史文件过期状态显示
This commit is contained in:
@@ -114,6 +114,7 @@ export interface AnalyticsFileRow {
|
|||||||
upload_count?: number
|
upload_count?: number
|
||||||
upload_traffic?: number | string
|
upload_traffic?: number | string
|
||||||
current: boolean
|
current: boolean
|
||||||
|
expired?: boolean
|
||||||
deleted?: boolean
|
deleted?: boolean
|
||||||
created_at?: string
|
created_at?: string
|
||||||
uploaded_at?: string
|
uploaded_at?: string
|
||||||
|
|||||||
@@ -703,7 +703,7 @@
|
|||||||
{{ formatHistoryBytes(file.download_traffic) }}
|
{{ formatHistoryBytes(file.download_traffic) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 text-sm" :class="[mutedTextClass]">
|
<td class="px-4 py-3 text-sm" :class="[mutedTextClass]">
|
||||||
{{ file.deleted ? '已删除' : file.current ? '现存' : '历史' }}
|
{{ getHistoryStatusLabel(file) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
@@ -1613,6 +1613,12 @@ const handleHistoryPageSizeChange = (size: number) => {
|
|||||||
const formatHistoryBytes = (value: number | string | undefined) =>
|
const formatHistoryBytes = (value: number | string | undefined) =>
|
||||||
formatFileSize(Number(value || 0), 1)
|
formatFileSize(Number(value || 0), 1)
|
||||||
const formatHistoryDate = (value?: string) => (value ? formatTimestamp(value) : '-')
|
const formatHistoryDate = (value?: string) => (value ? formatTimestamp(value) : '-')
|
||||||
|
const getHistoryStatusLabel = (file: AnalyticsFileRow) => {
|
||||||
|
if (file.deleted) return '已删除'
|
||||||
|
if (file.expired) return '已过期'
|
||||||
|
if (file.current) return '现存'
|
||||||
|
return '历史'
|
||||||
|
}
|
||||||
|
|
||||||
const primaryTextClass = computed(() => (isDarkMode.value ? 'text-white' : 'text-gray-900'))
|
const primaryTextClass = computed(() => (isDarkMode.value ? 'text-white' : 'text-gray-900'))
|
||||||
const mutedTextClass = computed(() => (isDarkMode.value ? 'text-gray-400' : 'text-gray-500'))
|
const mutedTextClass = computed(() => (isDarkMode.value ? 'text-gray-400' : 'text-gray-500'))
|
||||||
|
|||||||
Reference in New Issue
Block a user