From f7cc91adaa240f5505d9179df7a81e53eeb445ce Mon Sep 17 00:00:00 2001 From: Nixevol Date: Mon, 25 May 2026 14:53:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20Token=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A4=8D=E5=88=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/project_context.md | 6 ++ frontend/src/components/ApiTokenManager.vue | 83 +++++++++++++++++++-- 2 files changed, 82 insertions(+), 7 deletions(-) diff --git a/docs/project_context.md b/docs/project_context.md index fc5b23e..4f05679 100644 --- a/docs/project_context.md +++ b/docs/project_context.md @@ -527,3 +527,9 @@ - `frontend/src/components/ApiTokenManager.vue` now shows selectable token rows, a batch delete button, a compact per-row action dropdown, copy-token action, and enable/disable action. New token creation defaults to a specified expiration date one month after the current browser date, while permanent tokens remain available via the radio option. - OpenAPI and README text were updated to describe repeatable token copying, token migration through config upload/download, and batch delete. - Verification performed: `api_tokens` service create/list/verify/enable/disable/export/import/batch-delete test passed, HTTP endpoints for create/list/update/config download/batch-delete passed on local port `9081`, `.venv\Scripts\python.exe -m compileall app` passed, and `npm run build` passed with only the existing Vite large chunk warning. + +## 2026-05-25: API Token row visibility controls + +- `frontend/src/components/ApiTokenManager.vue` renders Token values as a compact row with right-side icon buttons: an eye button toggles masked/full Token display, and a copy button copies the complete Token directly from the row. +- The per-row operation dropdown now keeps edit, enable/disable, regenerate, and delete actions; copying is surfaced beside the Token value for faster repeated use. +- Build verification: `npm run build` passed with only the existing Vite large chunk warning. diff --git a/frontend/src/components/ApiTokenManager.vue b/frontend/src/components/ApiTokenManager.vue index a2ef67e..45dd588 100644 --- a/frontend/src/components/ApiTokenManager.vue +++ b/frontend/src/components/ApiTokenManager.vue @@ -44,7 +44,36 @@ {{ tokenStatusText(token) }} -
{{ token.prefix }}...{{ token.suffix }}
+
+
{{ tokenDisplayValue(token) }}
+
+ + + + + + +
+
到期:{{ formatExpiration(token.expires_at) }} 最近使用:{{ formatDateTime(token.last_used_at) }} @@ -138,7 +167,7 @@