refactor(desktop): show authorized AI platforms count on shell
The shell badge and the AI Platforms overview now report platforms whose binding is locally authorized (authState=active) instead of the total bound platforms, so the number reflects how many monitoring sources are actually usable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user