feat(admin-web): prefer runtime account health when ranking and gating accounts
Surface the new runtime_health/runtime_checked_at fields through a tiny desktop-account-runtime helper so PublishArticleModal, MediaView, and TrackingView fall back to the desktop client's last live signal instead of the slower DB column. This keeps the publishable card and tracking breakdown in sync with the desktop probe loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import PageHero from "@/components/PageHero.vue";
|
||||
import { brandsApi, monitoringApi, tenantAccountsApi } from "@/lib/api";
|
||||
import { resolveAccountCheckedAt, resolveAccountHealth } from "@/lib/desktop-account-runtime";
|
||||
import { formatDateTime } from "@/lib/display";
|
||||
import { formatError } from "@/lib/errors";
|
||||
import { isMonitoringPlatformId, normalizeMonitoringPlatformFilter, normalizeMonitoringPlatformId } from "@/lib/monitoring-platforms";
|
||||
@@ -354,8 +355,8 @@ const aiPlatformStatusCards = computed<AIPlatformStatusCard[]>(() => {
|
||||
|
||||
return aiPlatformCatalog.map((platform) => {
|
||||
const matchedAccounts = [...(accountGroups.get(platform.id) ?? [])].sort((left, right) => {
|
||||
const leftAt = Date.parse(left.verified_at ?? "") || 0;
|
||||
const rightAt = Date.parse(right.verified_at ?? "") || 0;
|
||||
const leftAt = Date.parse(resolveAccountCheckedAt(left) ?? "") || 0;
|
||||
const rightAt = Date.parse(resolveAccountCheckedAt(right) ?? "") || 0;
|
||||
return rightAt - leftAt;
|
||||
});
|
||||
const breakdown = breakdownMap.get(platform.id);
|
||||
@@ -537,7 +538,7 @@ function accountAuthLabel(account: DesktopAccountInfo | null): string {
|
||||
return "未绑定";
|
||||
}
|
||||
|
||||
switch (account.health) {
|
||||
switch (resolveAccountHealth(account)) {
|
||||
case "live":
|
||||
return "授权正常";
|
||||
case "captcha":
|
||||
@@ -554,7 +555,7 @@ function accountAuthColor(account: DesktopAccountInfo | null): string {
|
||||
return "default";
|
||||
}
|
||||
|
||||
switch (account.health) {
|
||||
switch (resolveAccountHealth(account)) {
|
||||
case "live":
|
||||
return "green";
|
||||
case "captcha":
|
||||
|
||||
Reference in New Issue
Block a user