Bring Back Realtime Table Stats
Release rolling / release (push) Successful in 7m55s

This commit is contained in:
Raven Scott
2026-08-04 22:37:41 -04:00
parent c5015a66e8
commit 637c386e33
12 changed files with 689 additions and 636 deletions
+16
View File
@@ -18,6 +18,7 @@ import {
import {
getStatsConfig,
updateStatsConfig,
setPeerStatsInterest,
getStatsFilePath,
STATS_LIMITS,
} from '../services/stats.js'
@@ -210,6 +211,21 @@ export function registerSystemHandlers(session) {
return { success: true, config }
})
/**
* Client declares whether it needs live fleet stats for the current UI view.
* Server only opens Docker stats streams while ≥1 peer has active interest.
*/
session.respond(
'setStatsInterest',
async (args = {}) => {
const active = args.active === true || args.active === 1 || args.active === '1'
const view = args.view != null ? String(args.view) : undefined
const config = setPeerStatsInterest(session.id, active, { view })
return { success: true, active, config }
},
{ hot: true }
)
session.respond('listSchedules', async () => {
return { success: true, schedules: listSchedules() }
})