mirror of
https://github.com/hansjone/netx.git
synced 2026-10-16 01:50:45 +08:00
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:
parent
4d60601050
commit
046029aa16
11 changed files with 417 additions and 286 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue