mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-09-16 06:05:27 +02:00
Expose AISHub as an optional ships-layer backup when AISStream is silent.
Wire AISHUB_USERNAME into API Keys and onboarding, and surface backup status on the AIS outage banner so operators can keep vessel coverage without changing the AISStream proxy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
* banner can explain "AIS upstream is offline" instead of letting users
|
||||
* wonder.
|
||||
*
|
||||
* When AISStream is silent, the backend can still fill ships via AISHub REST
|
||||
* (`AISHUB_USERNAME`) on a slow cadence. ``aishubConfigured`` tells the banner
|
||||
* whether to nudge the operator to add that backup or confirm it is active.
|
||||
*
|
||||
* The poll interval is intentionally relaxed (30s) — this is a low-urgency UX
|
||||
* signal, not a real-time data feed. Backend already escalates top_status to
|
||||
* "degraded" when AIS is configured-but-disconnected.
|
||||
@@ -35,6 +39,8 @@ export interface AisUpstreamHealth {
|
||||
* seen — we approximate it by requiring at least one spawn before
|
||||
* declaring an outage. */
|
||||
aisEnabled: boolean;
|
||||
/** True when ``AISHUB_USERNAME`` is set so the REST backup can run. */
|
||||
aishubConfigured: boolean;
|
||||
}
|
||||
|
||||
const POLL_INTERVAL_MS = 30_000;
|
||||
@@ -67,6 +73,7 @@ export function useAisUpstreamHealth(): AisUpstreamHealth | null {
|
||||
degradedTls: Boolean(proxy.degraded_tls),
|
||||
proxySpawnCount: spawns,
|
||||
aisEnabled: spawns > 0,
|
||||
aishubConfigured: Boolean(proxy.aishub_configured),
|
||||
});
|
||||
} catch {
|
||||
// Backend unreachable — separate problem. Banner not relevant.
|
||||
|
||||
Reference in New Issue
Block a user