From c3ba24e939c3320b2f252b17a158d88af664c6bb Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Mon, 4 May 2026 03:03:30 +0200 Subject: [PATCH] dsadas --- modules/fx-rates/assets/fx-rates.css | 141 ++++++------ modules/fx-rates/design.json | 2 +- modules/fx-rates/pages/currencies.php | 310 ++++++++++++++------------ modules/fx-rates/pages/index.php | 163 ++++++++------ 4 files changed, 318 insertions(+), 298 deletions(-) diff --git a/modules/fx-rates/assets/fx-rates.css b/modules/fx-rates/assets/fx-rates.css index f6b4828..663266a 100644 --- a/modules/fx-rates/assets/fx-rates.css +++ b/modules/fx-rates/assets/fx-rates.css @@ -1,27 +1,36 @@ -#fx-rates-app { - padding: 1rem 0 2rem; -} - -.fx-stack { +#fx-rates-app, +#fx-rates-currencies { display: grid; - gap: 1rem; + gap: 16px; } -.fx-card { - background: var(--panel-bg, #fff); - border: 1px solid rgba(15, 23, 42, 0.12); - border-radius: 8px; - padding: 1rem; +.fx-submenu-row { + display: flex; + gap: 14px; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; } -.fx-card h1, -.fx-card h2 { +.fx-section-head { + display: flex; + justify-content: space-between; + gap: 16px; + align-items: flex-start; + flex-wrap: wrap; +} + +.fx-section-head h2, +.section-box h2, +.card-box h2 { margin: 0 0 0.5rem; } -.fx-card p { +.fx-section-head p, +.section-box p, +.card-box p { margin: 0 0 0.75rem; - color: #5b6573; + color: var(--muted); } .fx-card-head { @@ -38,40 +47,6 @@ flex-wrap: wrap; } -.fx-button { - appearance: none; - border: 1px solid #d0d7e2; - background: #fff; - color: #1c2734; - border-radius: 8px; - padding: 0.7rem 1rem; - cursor: pointer; -} - -.fx-button--primary { - background: #1c2734; - color: #fff; - border-color: #1c2734; -} - -.fx-button--ghost { - background: #fff4fb; - border-color: #f5b7d7; - color: #ff8a00; -} - -.fx-button--accent { - background: linear-gradient(90deg, #ff006a 0%, #ff9e00 100%); - color: #111827; - border-color: transparent; - font-weight: 700; -} - -.fx-button[disabled] { - opacity: 0.6; - cursor: wait; -} - .fx-form-grid { display: grid; gap: 0.75rem; @@ -90,29 +65,30 @@ .fx-form-grid span, .fx-block span { font-size: 0.9rem; - color: #5b6573; + color: var(--muted); } .fx-form-grid input, .fx-form-grid select, .fx-block input { width: 100%; - border: 1px solid #d0d7e2; - border-radius: 8px; + border: 1px solid var(--line); + border-radius: 12px; padding: 0.7rem 0.8rem; + background: var(--surface-strong); + color: var(--text); } .fx-message { - margin-bottom: 0.9rem; - color: #1c2734; + color: var(--text); } .fx-message.is-error { - color: #b42318; + color: #d92d20; } .fx-message.is-success { - color: #027a48; + color: color-mix(in srgb, var(--accent-green) 78%, var(--text)); } .fx-table-wrap { @@ -127,7 +103,7 @@ .fx-table th, .fx-table td { text-align: left; - border-bottom: 1px solid #eef2f6; + border-bottom: 1px solid var(--line); padding: 0.65rem 0.4rem; } @@ -141,13 +117,13 @@ min-height: 1.5rem; font-size: 1rem; font-weight: 700; - color: #1c2734; + color: var(--text); } .fx-card-meta { display: grid; gap: 0.35rem; - color: #5b6573; + color: var(--muted); font-size: 0.95rem; text-align: right; } @@ -156,7 +132,6 @@ display: flex; gap: 0.75rem; flex-wrap: wrap; - margin-bottom: 1rem; } .fx-action-row form { @@ -175,22 +150,27 @@ display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); - margin: 1rem 0 1.25rem; } -.fx-mini-card { +.fx-card-grid { display: grid; - gap: 0.2rem; + gap: 16px; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .fx-mini-label, .fx-field-label { font-size: 0.9rem; - color: #6a7383; + color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; } +.fx-card-value { + font-size: 1.2rem; + font-weight: 700; +} + .fx-currency-selection-row { display: flex; flex-wrap: wrap; @@ -216,11 +196,11 @@ .fx-input, .fx-select { width: 100%; - border: 1px solid #d0d7e2; + border: 1px solid var(--line); border-radius: 18px; padding: 0.8rem 1rem; - background: #fff; - color: #1c2734; + background: var(--surface-strong); + color: var(--text); } .fx-field { @@ -234,11 +214,11 @@ display: inline-flex; align-items: center; gap: 0.6rem; - border: 1px solid #d0d7e2; + border: 1px solid var(--line); border-radius: 999px; padding: 0.7rem 1rem; - background: #fff; - color: #1c2734; + background: var(--surface-strong); + color: var(--text); } .fx-token { @@ -247,12 +227,12 @@ .fx-token:hover, .fx-suggestion:hover { - border-color: rgba(255, 158, 0, 0.45); - background: rgba(255, 244, 251, 0.9); + border-color: color-mix(in srgb, var(--brand-accent-3) 45%, transparent); + background: color-mix(in srgb, var(--brand-accent) 6%, var(--surface-strong)); } .fx-token-close { - color: #ff9e00; + color: var(--brand-accent-3); font-weight: 700; text-transform: uppercase; } @@ -269,11 +249,11 @@ } .fx-suggestion strong { - color: #111827; + color: var(--text); } .fx-text { - color: #5b6573; + color: var(--muted); } .fx-history-date { @@ -285,10 +265,10 @@ .fx-info-button { width: 1.4rem; height: 1.4rem; - border: 1px solid #d0d7e2; + border: 1px solid var(--line); border-radius: 999px; - background: #fff; - color: #5b6573; + background: var(--surface-strong); + color: var(--muted); font-size: 0.78rem; font-weight: 700; line-height: 1; @@ -304,6 +284,11 @@ flex-direction: column; } + .fx-submenu-row, + .fx-card-head { + align-items: flex-start; + } + .fx-currency-search { flex: 1 1 auto; width: 100%; diff --git a/modules/fx-rates/design.json b/modules/fx-rates/design.json index 23c3963..06ddc24 100644 --- a/modules/fx-rates/design.json +++ b/modules/fx-rates/design.json @@ -1,6 +1,6 @@ { "eyebrow": "Modul", - "title": "FX-Rates", + "title": "Waehrungskurse", "description": "Zentrale Verwaltung fuer Waehrungskurse, Snapshots und FX-API-Abrufe.", "actions": [ { "label": "Setup", "href": "/modules/setup/fx-rates", "variant": "secondary" } diff --git a/modules/fx-rates/pages/currencies.php b/modules/fx-rates/pages/currencies.php index 05f83c3..d6e1967 100644 --- a/modules/fx-rates/pages/currencies.php +++ b/modules/fx-rates/pages/currencies.php @@ -117,155 +117,171 @@ $tabs = [ ['label' => 'Waehrungen', 'href' => '/module/fx-rates/currencies', 'active' => true], ]; ?> - 'Waehrungskurse', - 'tabs' => $tabs, - 'actions' => [ - ['label' => 'Setup', 'href' => '/modules/setup/fx-rates', 'variant' => 'secondary', 'size' => 'sm'], - ], -]) ?>
'> -
-
- -
- -
- - -

Waehrungs-Update

-

Auswahl wird in den FX-Rates-Einstellungen gespeichert und steht damit auf Handy und Desktop gleich zur Verfuegung.

- -
-
- - -
-
- - -
-
- -
-
-
Fiat
-
Waehrungen
-
-
-
Krypto
-
Waehrungen
-
-
- -
Bevorzugte Waehrungen fuer Anzeige
-
-
- -
-
- - - -
-
- - -
- -
-
-
- -
-
-
-

Letzte 15 Kurs-Uploads

-

Zeigt die zuletzt gespeicherten Wechselkurse aus der Datenbank.

-
-
-
Anzeige-Basis:
-
Letzter Abruf:
-
-
-
- - - - - - - - - - - - - - - snapshotByFetchId((int) ($fetch['id'] ?? 0), $fetchBaseCurrency, $tableCurrencies); - $originalRates = is_array($snapshot['rates'] ?? null) ? $snapshot['rates'] : []; - $displayBaseRate = $displayBaseCurrency === $fetchBaseCurrency - ? 1.0 - : (is_numeric($originalRates[$displayBaseCurrency] ?? null) ? (float) $originalRates[$displayBaseCurrency] : null); - $tableRates = []; - foreach ($tableCurrencies as $currency) { - $currency = strtoupper(trim((string) $currency)); - if ($currency === '') { - continue; - } - if ($currency === $displayBaseCurrency) { - $tableRates[$currency] = 1.0; - continue; - } - if ($displayBaseRate === null || $displayBaseRate <= 0) { - $tableRates[$currency] = null; - continue; - } - if ($currency === $fetchBaseCurrency) { - $tableRates[$currency] = 1 / $displayBaseRate; - continue; - } - $rawRate = $originalRates[$currency] ?? null; - $tableRates[$currency] = is_numeric($rawRate) ? ((float) $rawRate / $displayBaseRate) : null; - } - $infoTitle = sprintf( - 'Basis: %s | Provider: %s | Ausloeser: %s', - (string) ($fetch['base_currency'] ?? '-'), - (string) ($fetch['provider'] ?? '-'), - (string) ($fetch['trigger_source_label'] ?? $fetch['trigger_source'] ?? '-') - ); - ?> - - - - - - - - - - -
Zeit
Noch keine Abrufe vorhanden.
-
- - -
-
+ + + +
+
+
+ +
+
+
+ + +
+
+
+

Waehrungs-Update

+

Auswahl wird in den Waehrungskurs-Einstellungen gespeichert und steht damit auf Handy und Desktop gleich zur Verfuegung.

+
+
+ +
+
+ + +
+
+ + +
+
+
+ +
+
+
Fiat
+
Waehrungen
+
+
+
Krypto
+
Waehrungen
+
+
+ +
+
Bevorzugte Waehrungen fuer Anzeige
+
+
+ +
+
+ + + +
+
+ + +
+ +
+
+
+ +
+
+
+

Letzte 15 Kurs-Uploads

+

Zeigt die zuletzt gespeicherten Wechselkurse aus der Datenbank.

+
+
+
Anzeige-Basis:
+
Letzter Abruf:
+
+
+
+ + + + + + + + + + + + + + + snapshotByFetchId((int) ($fetch['id'] ?? 0), $fetchBaseCurrency, $tableCurrencies); + $originalRates = is_array($snapshot['rates'] ?? null) ? $snapshot['rates'] : []; + $displayBaseRate = $displayBaseCurrency === $fetchBaseCurrency + ? 1.0 + : (is_numeric($originalRates[$displayBaseCurrency] ?? null) ? (float) $originalRates[$displayBaseCurrency] : null); + $tableRates = []; + foreach ($tableCurrencies as $currency) { + $currency = strtoupper(trim((string) $currency)); + if ($currency === '') { + continue; + } + if ($currency === $displayBaseCurrency) { + $tableRates[$currency] = 1.0; + continue; + } + if ($displayBaseRate === null || $displayBaseRate <= 0) { + $tableRates[$currency] = null; + continue; + } + if ($currency === $fetchBaseCurrency) { + $tableRates[$currency] = 1 / $displayBaseRate; + continue; + } + $rawRate = $originalRates[$currency] ?? null; + $tableRates[$currency] = is_numeric($rawRate) ? ((float) $rawRate / $displayBaseRate) : null; + } + $infoTitle = sprintf( + 'Basis: %s | Provider: %s | Ausloeser: %s', + (string) ($fetch['base_currency'] ?? '-'), + (string) ($fetch['provider'] ?? '-'), + (string) ($fetch['trigger_source_label'] ?? $fetch['trigger_source'] ?? '-') + ); + ?> + + + + + + + + + + +
Zeit
Noch keine Abrufe vorhanden.
+
+ + +
+
+
+
- diff --git a/modules/fx-rates/pages/index.php b/modules/fx-rates/pages/index.php index 04a87e5..4b7e5f5 100644 --- a/modules/fx-rates/pages/index.php +++ b/modules/fx-rates/pages/index.php @@ -58,80 +58,99 @@ $pageData = json_encode([ 'preferred_currencies' => $preferredCurrencies, 'recent_fetches' => $recentFetches, ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + +$tabs = [ + ['label' => 'Ueberblick', 'href' => '/module/fx-rates', 'active' => true], + ['label' => 'Waehrungen', 'href' => '/module/fx-rates/currencies'], +]; ?> - 'Waehrungskurse', - 'actions' => [ - ['label' => 'Setup', 'href' => '/modules/setup/fx-rates', 'variant' => 'secondary', 'size' => 'sm'], - ['label' => 'Aktuelle Kurse abrufen', 'href' => '/module/fx-rates?refresh=1', 'variant' => 'secondary', 'size' => 'sm'], - ], -]) ?>
'> -
-
- -
- -
- - -

- API-Self-Describe-Endpoint: - -

- -

Umrechnung

-

Umrechnung auf Basis des letzten verfuegbaren Kurses zwischen den bevorzugten Waehrungen.

-
- - - -
-
Noch keine Umrechnung berechnet.
-
- -
-
-
-

Kursverlauf

-

Neueste Abrufe zuerst. Verlauf der bevorzugten Waehrungen relativ zur Anzeige-Basiswaehrung.

-
-
-
Anzeige-Basis:
-
Letzter Abruf:
-
-
-
- - - - - - - - - - -
DatumKurse
Noch keine Verlaufsdaten geladen.
+ -
- + + +
+
+
+ +
+
+
+ + +
+
+
+

Umrechnung

+

Umrechnung auf Basis des letzten verfuegbaren Kurses zwischen den bevorzugten Waehrungen.

+
+
+

+ API-Self-Describe-Endpoint: + +

+
+ + + +
+
Noch keine Umrechnung berechnet.
+
+ +
+
+
+

Kursverlauf

+

Neueste Abrufe zuerst. Verlauf der bevorzugten Waehrungen relativ zur Anzeige-Basiswaehrung.

+
+
+
Anzeige-Basis:
+
Letzter Abruf:
+
+
+
+ + + + + + + + + + +
DatumKurse
Noch keine Verlaufsdaten geladen.
+
+
+