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
@@ -545,6 +545,7 @@ const settings: TranslationStrings = {
'settings.apiScopes.hint':
'모든 것을 볼 수 있어야 하는 키라면 전부 켜 두세요. 끈 항목은 이 키에 대해 응답에서 빠지는 정도가 아니라 아예 거부됩니다.',
'settings.apiScopes.all': '전체',
'settings.apiScopes.noneSelected': '항목을 하나 이상 선택하세요. 그렇지 않으면 키가 아무것도 읽을 수 없습니다.',
'settings.apiScopes.limited': '{total}개 중 {count}개',
'settings.apiScopes.trips': '여행',
'settings.apiScopes.days': '일자',
@@ -568,6 +569,11 @@ const settings: TranslationStrings = {
'settings.apiKeys.createFailed': '키를 만들지 못했습니다',
'settings.apiKeys.copy': '복사',
'settings.apiKeys.docsHint': '키를 "Authorization: Bearer ..." 또는 "X-API-Key: ..." 로 /api/v1 에 보내세요.',
'settings.apiKeys.endpoint': '엔드포인트',
'settings.apiKeys.neverUsed': '사용한 적 없음',
'settings.apiKeys.loadFailed': '키를 불러오지 못했습니다. 페이지를 새로 고친 뒤 다시 시도하세요.',
'settings.apiKeys.limitReached': '키가 {max}개로 계정당 최대 개수입니다. 새 키를 만들려면 더 이상 쓰지 않는 키를 삭제하세요.',
'settings.apiKeys.copyFailed': '복사하지 못했습니다. 텍스트를 선택해 직접 복사하세요.',
'settings.apiKeys.modal.createTitle': 'API 키 만들기',
'settings.apiKeys.modal.name': '이름',
'settings.apiKeys.modal.namePlaceholder': '예: Dawarich',