feat(desktop-client): queue account probes and report health to server
Replace serial probe-on-lock with a bounded probe queue (concurrency 3) that adds a "queued" probe state, manual cooldown, and retry backoff. After each probe the runtime debounces a batched POST to the new /desktop/accounts/health-reports endpoint so the server learns about live, expired, and risk transitions without waiting for a re-bind. Adds an account-scoped IPC (probeRuntimeAccount + runtimeAccountSnapshot) so the renderer can refresh a single row instead of replaying the full snapshot, and exposes the resulting "重新校验" action in AccountsView/AiPlatformsView. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -64,7 +64,11 @@ function authLabel(account: AccountRow | null) {
|
||||
case "revoked":
|
||||
return "已停用";
|
||||
default:
|
||||
return account.probeState === "probing" ? "校验中" : "待校验";
|
||||
return account.probeState === "queued"
|
||||
? "等待校验"
|
||||
: account.probeState === "probing"
|
||||
? "校验中"
|
||||
: "待校验";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +88,9 @@ function authColor(account: AccountRow | null) {
|
||||
case "expiring_soon":
|
||||
return account.probeState === "network_error" ? "warning" : "default";
|
||||
default:
|
||||
return "default";
|
||||
return account.probeState === "queued" || account.probeState === "probing"
|
||||
? "processing"
|
||||
: "default";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +114,9 @@ function verificationLabel(account: AccountRow): string {
|
||||
if (account.lastVerifiedAt) {
|
||||
return formatVerifiedAtLabel(account.lastVerifiedAt);
|
||||
}
|
||||
if (account.probeState === "queued") {
|
||||
return "等待首轮校验";
|
||||
}
|
||||
if (account.probeState === "probing") {
|
||||
return "正在执行首轮校验";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user