Unify NetX UI to compact ops chrome and add API key purge.

Align network/list shells and audit header with industrial panels; allow permanently deleting revoked API keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-10-11 16:20:31 +08:00
parent 4d60601050
commit 046029aa16
11 changed files with 417 additions and 286 deletions

View file

@ -173,6 +173,16 @@ export function ApiTokensPage() {
onError: (e) => showError(String(e instanceof Error ? e.message : e)),
});
const deleteMut = useMutation({
mutationFn: (id: string) => apiDelete(`/v1/api-tokens/${encodeURIComponent(id)}/purge`),
onSuccess: async () => {
showOk(t("auth.tokenDeleted"));
setEditingRow(null);
await qc.invalidateQueries({ queryKey: ["apiTokens"] });
},
onError: (e) => showError(String(e instanceof Error ? e.message : e)),
});
const onCreate = (e: FormEvent) => {
e.preventDefault();
setCreatedPlain("");
@ -367,6 +377,16 @@ export function ApiTokensPage() {
>
{t("auth.revokeToken")}
</Button>
<Button
size="sm"
variant="danger"
isDisabled={deleteMut.isPending}
onPress={() => {
if (window.confirm(t("auth.deleteConfirm"))) deleteMut.mutate(row.id);
}}
>
{t("auth.deleteToken")}
</Button>
</div>
</td>
</tr>