diff --git a/apps/desktop-client/src/renderer/components/DesktopShell.vue b/apps/desktop-client/src/renderer/components/DesktopShell.vue index 0ac61e3..2d2e00a 100644 --- a/apps/desktop-client/src/renderer/components/DesktopShell.vue +++ b/apps/desktop-client/src/renderer/components/DesktopShell.vue @@ -30,7 +30,9 @@ const navItems = computed(() => { const data = snapshot.value const accounts = data?.accounts ?? [] const publishIDs = new Set(desktopPublishMediaCatalog.map((item) => item.id)) - const monitoringIDs = new Set(desktopMonitoringMediaCatalog.map((item) => item.id)) + const authorizedMonitoringCount = desktopMonitoringMediaCatalog.filter((platform) => + accounts.find((account) => account.platform === platform.id)?.authState === 'active', + ).length return [ { @@ -57,8 +59,8 @@ const navItems = computed(() => { { to: '/ai-platforms', title: 'AI 平台', - description: 'AI 平台一平台一绑定,按卡片查看状态与归属', - count: accounts.filter((item) => monitoringIDs.has(item.platform)).length, + description: 'AI 平台一平台一授权,按卡片查看状态与归属', + count: authorizedMonitoringCount, icon: RobotOutlined, }, ] diff --git a/apps/desktop-client/src/renderer/views/AiPlatformsView.vue b/apps/desktop-client/src/renderer/views/AiPlatformsView.vue index f63b84a..89521a8 100644 --- a/apps/desktop-client/src/renderer/views/AiPlatformsView.vue +++ b/apps/desktop-client/src/renderer/views/AiPlatformsView.vue @@ -29,13 +29,6 @@ const aiAccounts = computed(() => ), ) -const overview = computed(() => ({ - configuredPlatforms: desktopMonitoringMediaCatalog.length, - bound: aiAccounts.value.length, - live: aiAccounts.value.filter((item) => item.health === 'live').length, - onlineClients: snapshot.value?.summary.onlineClients ?? 0, -})) - const platformCards = computed(() => desktopMonitoringMediaCatalog.map((platform) => { const matched = aiAccounts.value.filter((account) => account.platform === platform.id) @@ -47,6 +40,17 @@ const platformCards = computed(() => }), ) +function isLocallyAuthorized(account: AccountRow | null): boolean { + return account?.authState === 'active' +} + +const overview = computed(() => ({ + configuredPlatforms: desktopMonitoringMediaCatalog.length, + authorized: platformCards.value.filter((platform) => isLocallyAuthorized(platform.account)) + .length, + onlineClients: snapshot.value?.summary.onlineClients ?? 0, +})) + function authLabel(account: AccountRow | null) { if (!account) { return '未绑定' @@ -258,13 +262,9 @@ async function unbindPlatform(account: AccountRow) {