fix(admin-ui): repair Keys tab + console UX

- Keys tab crashed on render: api.keys() expected an array but the
  backend returns {keys:[...]}; unwrap it (KeysTab maps over the array).
- Config save now sends only CHANGED fields, not the whole section, so
  the backend stops spuriously flagging restarts and pinning env-sourced
  values into the DB overlay.
- Config edit state survives a reload (saving one section no longer
  discards unsaved edits in others); numeric inputs ignore empty/NaN
  instead of silently coercing to 0.
- Mint and Revoke now surface errors instead of swallowing them.
Rebuilt admin-ui/dist.
This commit is contained in:
jwinterm
2026-07-19 05:30:33 -04:00
parent ea2230164e
commit fe2fc91cdd
5 changed files with 55 additions and 16 deletions
+3 -1
View File
@@ -64,7 +64,9 @@ export const api = {
logout: () => req('POST', '/admin/auth/logout', {}),
me: () => req('GET', '/admin/me'),
features: () => req('GET', '/admin/features'),
keys: () => req('GET', '/admin/keys') as Promise<KeyRow[]>,
// The backend wraps the list as {keys:[...]} (KeysListResponse); unwrap here so
// callers get the array they expect (KeysTab maps over it directly).
keys: () => req('GET', '/admin/keys').then((r) => (r as { keys: KeyRow[] }).keys),
addKey: (pubkey: string, label?: string) =>
req('POST', '/admin/keys', label ? { pubkey, label } : { pubkey }),
revokeKey: (id: string) => req('DELETE', `/admin/keys/${id}`),