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 <[email protected]>
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

+5
View File
@@ -1,4 +1,5 @@
import { urlApi } from '../app/base'
import { setHubWarnings } from './hub-warnings'
/*
The console's HTTP client. A replica of the old console's `HTTPRequest` helper
(upstream/master:DnsServerCore/www/js/common.js:28).
@@ -66,6 +67,8 @@ export interface ApiOptions {
interface Envelope {
status?: string
errorMessage?: string
/** Only from the hub: servers that did not answer an aggregate call. */
hubWarnings?: unknown
}
/*
@@ -101,6 +104,8 @@ cannot go through it because their good answer is not JSON (`allowed/export`,
export function envelopeOutcome<T>(payload: Envelope, token?: string | null): ApiOutcome<T> {
switch (payload.status) {
case 'ok':
// Only an aggregate answer carries the field; a per-node call must not clear it.
if (payload.hubWarnings !== undefined) setHubWarnings(payload.hubWarnings)
return { kind: 'ok', data: payload as T }
case 'invalid-token':
onExpired?.(token)