ddfsdfdf
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-01 02:49:22 +02:00
parent d8f532ce0e
commit 6ce45f6d23
7 changed files with 180 additions and 31 deletions

View File

@@ -18,13 +18,31 @@ $error = trim((string) ($_GET['error'] ?? ''));
if ((string) ($_GET['refresh'] ?? '') === '1') {
try {
$result = $service->refreshLatestRates(null, (string) ($settings['default_base_currency'] ?? ''));
$params = [
'notice' => sprintf(
'Aktuelle Kurse gespeichert. %d Werte aktualisiert.',
(int) ($result['updated_count'] ?? 0)
),
];
$force = !empty($_GET['force']);
if ($force) {
$result = $service->refreshLatestRates(null, (string) ($settings['default_base_currency'] ?? ''), 'manual');
} else {
$result = $service->autoRefreshLatestRates(
(string) ($settings['default_base_currency'] ?? ''),
null,
(int) ($settings['refresh_max_age_minutes'] ?? 60),
'manual'
);
}
$params = !empty($result['reused'])
? [
'notice' => sprintf(
'Kein neuer API-Abruf. Der letzte gespeicherte Snapshot ist juenger als %d Minuten. Fuer einen erzwungenen Abruf bitte bestaetigen.',
(int) ($settings['refresh_max_age_minutes'] ?? 60)
),
]
: [
'notice' => sprintf(
'Aktuelle Kurse gespeichert. %d Werte aktualisiert.',
(int) ($result['updated_count'] ?? 0)
),
];
} catch (\Throwable $exception) {
$params = ['error' => $exception->getMessage() !== '' ? $exception->getMessage() : 'Kurse konnten nicht aktualisiert werden.'];
}
@@ -143,17 +161,19 @@ $pageData = json_encode([
<th>Datum</th>
<th>Basis</th>
<th>Provider</th>
<th>Ausloeser</th>
</tr>
</thead>
<tbody data-bind="fetches-body">
<?php if ($recentFetches === []): ?>
<tr><td colspan="3">Noch keine Abrufe vorhanden.</td></tr>
<tr><td colspan="4">Noch keine Abrufe vorhanden.</td></tr>
<?php else: ?>
<?php foreach ($recentFetches as $fetch): ?>
<tr>
<td><?= e((string) ($fetch['fetched_at_display'] ?? $fetch['fetched_at'] ?? '')) ?></td>
<td><?= e((string) ($fetch['base_currency'] ?? '')) ?></td>
<td><?= e((string) ($fetch['provider'] ?? '')) ?></td>
<td><?= e((string) ($fetch['trigger_source_label'] ?? $fetch['trigger_source'] ?? '')) ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>