feat(mannschaften): update team information display and add data update timestamps
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 2m39s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-05-20 17:57:02 +02:00
parent f2f76dec56
commit cfd9365d07

View File

@@ -315,7 +315,10 @@
<!-- Letzte Aktualisierung -->
<div class="bg-white rounded-xl shadow-lg p-6">
<p class="text-sm text-gray-500 text-center">
Zuletzt aktualisiert am: {{ formatDate(mannschaft.letzte_aktualisierung) }}
Mannschaftsinformationen aktualisiert am: {{ formatDate(mannschaft.letzte_aktualisierung) }}
</p>
<p class="text-sm text-gray-500 text-center mt-1">
Daten aktualisiert am: {{ dataUpdatedLabel }}
</p>
</div>
@@ -365,6 +368,8 @@ const activePanelTab = ref('matches')
const isTableLoading = ref(false)
const tableError = ref('')
const teamTableRows = ref([])
const spielplanDataUpdatedAt = ref('')
const tableDataUpdatedAt = ref('')
const hasTableLink = computed(() => {
const link = String(mannschaft.value?.weitere_informationen_link || '').trim()
@@ -385,6 +390,11 @@ const mannschaftSeasonLabel = computed(() => {
return `${start}/${String(start + 1).slice(-2)}`
})
const dataUpdatedLabel = computed(() => {
const dateValue = tableDataUpdatedAt.value || spielplanDataUpdatedAt.value || mannschaft.value?.letzte_aktualisierung || ''
return formatDate(dateValue)
})
async function fetchCsvText(url) {
const attempt = async () => {
const withBuster = `${url}${url.includes('?') ? '&' : '?'}_t=${Date.now()}`
@@ -491,6 +501,7 @@ const loadTeamTable = async () => {
teamTableRows.value = Array.isArray(result?.table?.table?.leagueTable)
? result.table.table.leagueTable
: []
tableDataUpdatedAt.value = result?.importedAt || ''
} catch (error) {
console.error('Fehler beim Laden der Tabelle:', error)
tableError.value = 'Tabelle konnte nicht geladen werden.'
@@ -593,6 +604,7 @@ const loadSpielplan = async () => {
}
spielplanSeason.value = result.season || ''
spielplanDataUpdatedAt.value = result?.source?.updatedAt || result?.source?.importedAt || ''
mannschaftSpielplan.value = result.data
.filter(row => isSpielForMannschaft(row, mannschaft.value.mannschaft))
.sort((a, b) => parseTerminTimestamp(a) - parseTerminTimestamp(b))