diff --git a/console/frontend/src/api.ts b/console/frontend/src/api.ts index d372a02..d2071e5 100644 --- a/console/frontend/src/api.ts +++ b/console/frontend/src/api.ts @@ -157,6 +157,10 @@ export const rotateAccount = (id: string) => export const getAccountWorkerSecret = (id: string) => api<{ worker_id: string; secret: string }>(`/api/accounts/${id}/worker-secret`); +/** 重新安装 Worker 脚本:不轮换凭据,用当前模板(Console 地址 + 凭据 token + secret)重渲染上传 */ +export const reinstallAccountWorker = (id: string) => + api<{ ok: boolean; worker_id: string }>(`/api/accounts/${id}/reinstall-worker`, "POST"); + /* ---- OAuth ---- */ /** OAuth 是否已配置(cloudflare = 可用;unconfigured = 缺少 client id/secret) */ diff --git a/console/frontend/src/pages/Accounts.tsx b/console/frontend/src/pages/Accounts.tsx index 235d132..349b683 100644 --- a/console/frontend/src/pages/Accounts.tsx +++ b/console/frontend/src/pages/Accounts.tsx @@ -24,6 +24,7 @@ import { getAccount, listAccounts, oauthStart, + reinstallAccountWorker, rotateAccount, updateAccount, type AccountDetail, @@ -428,6 +429,23 @@ function AccountDetailDrawer({ Email Worker 以该凭据直连 Console(/internal/email/authorize 与 /ingest);轮换后已配置的域名会自动重新部署。 +