fix(settings): bring the API keys section and its dialog in line with the rest of TREK

The section stacked a lonely button, a centred line and a small print hint
on top of each other, and the create dialog used bare browser checkboxes
that ignore the accent. The dialog now runs on the shared Modal with
selectable scope tiles, keys render as cards with their scopes as chips,
deletion goes through ConfirmDialog, and the endpoint sits in its own row
with a copy button.

Pressing Enter in the name field with every scope switched off used to
create a key: the empty list was dropped from the request and the server
stored it as a key that reads everything. Creation is now refused until at
least one scope is picked.

A failed list load no longer reads as "no keys yet", the create button
stops at the server's limit of ten keys, a refused clipboard says so, and
SQLite timestamps are parsed so Safari does not show Invalid Date.
This commit is contained in:
Maurice
2026-09-14 21:59:27 +02:00
parent da679e6266
commit 25282ea1c5
25 changed files with 648 additions and 220 deletions
+6
View File
@@ -555,6 +555,7 @@ const settings: TranslationStrings = {
'settings.apiScopes.hint':
'Her şeyi görmesi gereken bir anahtar için hepsini açık bırakın. Kapattığınız her şey bu anahtar için reddedilir, yalnızca yanıttan çıkarılmakla kalmaz.',
'settings.apiScopes.all': 'Her şey',
'settings.apiScopes.noneSelected': 'En az bir alan seç, yoksa anahtar hiçbir şey okuyamaz.',
'settings.apiScopes.limited': '{total} içinden {count}',
'settings.apiScopes.trips': 'Geziler',
'settings.apiScopes.days': 'Günler',
@@ -578,6 +579,11 @@ const settings: TranslationStrings = {
'settings.apiKeys.createFailed': 'Anahtar oluşturulamadı',
'settings.apiKeys.copy': 'Kopyala',
'settings.apiKeys.docsHint': 'Anahtarı "Authorization: Bearer ..." veya "X-API-Key: ..." olarak /api/v1 adresine gönder.',
'settings.apiKeys.endpoint': 'Uç nokta',
'settings.apiKeys.neverUsed': 'hiç kullanılmadı',
'settings.apiKeys.loadFailed': 'Anahtarların yüklenemedi. Tekrar denemek için sayfayı yenile.',
'settings.apiKeys.limitReached': '{max} anahtarın var, bir hesap için üst sınır bu. Yeni bir anahtar oluşturmak için artık kullanmadığın birini sil.',
'settings.apiKeys.copyFailed': 'Kopyalanamadı. Metni seçip elle kopyala.',
'settings.apiKeys.modal.createTitle': 'API anahtarı oluştur',
'settings.apiKeys.modal.name': 'Ad',
'settings.apiKeys.modal.namePlaceholder': 'örn. Dawarich',