feat(desktop): report current user online clients

This commit is contained in:
2026-05-06 18:25:05 +08:00
parent 930f095c64
commit 47681ab1f5
12 changed files with 297 additions and 12 deletions
@@ -144,6 +144,10 @@ function createLiveRuntimeSnapshot(controller: RuntimeControllerSnapshot) {
channel: controller.client?.channel ?? 'dev',
},
] as const
const onlineClientCount =
typeof controller.onlineClientCount === 'number'
? Math.max(0, controller.onlineClientCount)
: clients.filter((item) => item.status === 'online').length
const accounts = controller.accounts.map((account) =>
createRuntimeAccountView(controller, account, {
@@ -185,7 +189,7 @@ function createLiveRuntimeSnapshot(controller: RuntimeControllerSnapshot) {
lastFullSyncAt: controller.lastAccountsSyncAt || now,
},
summary: {
onlineClients: clients.filter((item) => item.status === 'online').length,
onlineClients: onlineClientCount,
accountsBound: accounts.length,
queuedTasks: tasks.filter((item) => item.status === 'queued').length,
issuesOpen: