Hub stage 3: the console in hub mode

With info.hub the node selector reads Server / All servers, the default-credentials
password prompt and the account actions the hub cannot serve are gone, the header
status reports the servers an aggregate could not reach (hubWarnings, kept until the
next aggregate), and merged Query Logs show a Server column. Without the flag
nothing changes. The hub sends hubWarnings on every aggregate answer, empty when all
servers answered, and never on a single-node one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DenozordecandClaude Opus 5.5 committed 2026-10-30 19:18:58 +07:00
1 parent 5f29a438c9
commit 48b5d9fb15
12 files changed
+360 -23

No files matched your search

+2 -1
View File
@@ -209,6 +209,7 @@ describe('single node', () => {
expect(b.calls[0].query.get('token')).toBe('token-b')
expect(b.calls[0].query.has('node')).toBe(false)
expect(b.calls[0].query.get('type')).toBe('LastDay')
expect(body.hubWarnings).toBeUndefined()
})
it('reports an unreachable server by its id', async () => {
@@ -235,7 +236,7 @@ describe('aggregate', () => {
const { body } = await call('dashboard/stats/get', params, token)
expect(body.response.stats.totalQueries).toBe(400)
expect(body.response.mainChartData.datasets[0].data).toEqual([400, 400])
expect(body.hubWarnings).toBeUndefined()
expect(body.hubWarnings).toEqual([])
}
})
+4 -2
View File
@@ -118,8 +118,10 @@ export function createHub(config: HubConfig): http.Server {
})
}
function ok(response: unknown, warnings: string[] = []): Json {
return warnings.length > 0 ? { status: 'ok', response, hubWarnings: warnings } : { status: 'ok', response }
/* `warnings` is given only by the aggregate answers (empty when every server answered), so the
console can tell "all back" from "not an aggregate" and clear its warning only on the former. */
function ok(response: unknown, warnings?: string[]): Json {
return warnings === undefined ? { status: 'ok', response } : { status: 'ok', response, hubWarnings: warnings }
}
async function single(server: HubServer, apiPath: string, params: Params): Promise<Json> {