feat(mannschaften): update team information display and add data update timestamps
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user