mirror of
https://github.com/ruvnet/RuView
synced 2026-08-03 19:21:42 +00:00
fix(homecore-server): separate HA and dashboard event routes
This commit is contained in:
@@ -115,7 +115,7 @@ pub fn gateway_router(state: GatewayState) -> Router {
|
|||||||
.route("/api/homecore/cogs/updates", get(empty_list))
|
.route("/api/homecore/cogs/updates", get(empty_list))
|
||||||
.route("/api/homecore/hailo", get(stub_503))
|
.route("/api/homecore/hailo", get(stub_503))
|
||||||
.route("/api/homecore/tokens", get(stub_503))
|
.route("/api/homecore/tokens", get(stub_503))
|
||||||
.route("/api/events", get(stub_503))
|
.route("/api/homecore/events", get(stub_503))
|
||||||
.with_state(state)
|
.with_state(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -728,7 +728,7 @@ mod tests {
|
|||||||
"/api/homecore/seeds",
|
"/api/homecore/seeds",
|
||||||
"/api/homecore/federation",
|
"/api/homecore/federation",
|
||||||
"/api/homecore/witness",
|
"/api/homecore/witness",
|
||||||
"/api/events",
|
"/api/homecore/events",
|
||||||
] {
|
] {
|
||||||
let (status, body) = send(gateway_router(gw()), "GET", p).await;
|
let (status, body) = send(gateway_router(gw()), "GET", p).await;
|
||||||
assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE, "{p} should be 503");
|
assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE, "{p} should be 503");
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export const api = {
|
|||||||
async callService(domain, service, data) { return this._post(`/api/services/${domain}/${service}`, data); },
|
async callService(domain, service, data) { return this._post(`/api/services/${domain}/${service}`, data); },
|
||||||
async setState(entityId, state, attributes) { return this._post(`/api/states/${entityId}`, { state, attributes: attributes || {} }); },
|
async setState(entityId, state, attributes) { return this._post(`/api/states/${entityId}`, { state, attributes: attributes || {} }); },
|
||||||
|
|
||||||
// ── gateway /api/homecore/* + /api/events (§11.2) ─────────────────
|
// ── gateway /api/homecore/* (§11.2) ───────────────────────────────
|
||||||
async appliance() { return this._data('appliance', '/api/homecore/appliance', (m) => m.applianceHealth()); },
|
async appliance() { return this._data('appliance', '/api/homecore/appliance', (m) => m.applianceHealth()); },
|
||||||
async seeds() { return this._data('fleet', '/api/homecore/seeds', (m) => m.seeds()); },
|
async seeds() { return this._data('fleet', '/api/homecore/seeds', (m) => m.seeds()); },
|
||||||
async seed(id) { return this._data('fleet', '/api/homecore/seeds/' + encodeURIComponent(id), (m) => m.seed(id)); },
|
async seed(id) { return this._data('fleet', '/api/homecore/seeds/' + encodeURIComponent(id), (m) => m.seed(id)); },
|
||||||
@@ -93,7 +93,7 @@ export const api = {
|
|||||||
async witnessLog(page = 0, size = 12) { return this._data('audit', `/api/homecore/witness?page=${page}&size=${size}`, (m) => m.witnessLog(page, size)); },
|
async witnessLog(page = 0, size = 12) { return this._data('audit', `/api/homecore/witness?page=${page}&size=${size}`, (m) => m.witnessLog(page, size)); },
|
||||||
async privacyModes() { return this._data('audit', '/api/homecore/privacy', (m) => m.privacyModes()); },
|
async privacyModes() { return this._data('audit', '/api/homecore/privacy', (m) => m.privacyModes()); },
|
||||||
async setPrivacy(seed, modeValue) { if (demoMode()) return { seed, mode: modeValue }; return this._post('/api/homecore/privacy', { seed, mode: modeValue }); },
|
async setPrivacy(seed, modeValue) { if (demoMode()) return { seed, mode: modeValue }; return this._post('/api/homecore/privacy', { seed, mode: modeValue }); },
|
||||||
async eventHistory(n = 40) { return this._data('events', `/api/events?limit=${n}`, (m) => m.recentEvents(n)); },
|
async eventHistory(n = 40) { return this._data('events', `/api/homecore/events?limit=${n}`, (m) => m.recentEvents(n)); },
|
||||||
recentEvents(n) { return this.eventHistory(n); }, // back-compat alias (async)
|
recentEvents(n) { return this.eventHistory(n); }, // back-compat alias (async)
|
||||||
async settings() { return this._data('settings', '/api/homecore/settings', (m) => m.settings()); },
|
async settings() { return this._data('settings', '/api/homecore/settings', (m) => m.settings()); },
|
||||||
async automations() { return this._data('automations', '/api/homecore/automations', () => []); },
|
async automations() { return this._data('automations', '/api/homecore/automations', () => []); },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// §4.8 Event Bus & Automation Feed — ADR-131 / ADR-129.
|
// §4.8 Event Bus & Automation Feed — ADR-131 / ADR-129.
|
||||||
//
|
//
|
||||||
// Live event stream (seeded from /api/events, then prepended live from
|
// Live event stream (seeded from /api/homecore/events, then prepended live from
|
||||||
// the shared WS bus — never polled, §2/§4.4), a context-causality
|
// the shared WS bus — never polled, §2/§4.4), a context-causality
|
||||||
// breadcrumb on row expand (Context.id → parent_id → grandparent_id),
|
// breadcrumb on row expand (Context.id → parent_id → grandparent_id),
|
||||||
// and a trigger→condition→action automation builder (ADR-129 scope:
|
// and a trigger→condition→action automation builder (ADR-129 scope:
|
||||||
@@ -50,7 +50,7 @@ export default {
|
|||||||
|
|
||||||
root.appendChild(sectionHeader('Event Bus & Automation', 'Live entity events + causality + automation builder (ADR-131 §4.8, ADR-129)'));
|
root.appendChild(sectionHeader('Event Bus & Automation', 'Live entity events + causality + automation builder (ADR-131 §4.8, ADR-129)'));
|
||||||
if (api.isDemo('events')) {
|
if (api.isDemo('events')) {
|
||||||
root.appendChild(banner('DEMO — event history is contract-conformant mock data until the live /api/events feed lands (§7.1). New rows still arrive over the WS bus.', 'amber'));
|
root.appendChild(banner('DEMO — event history is contract-conformant mock data until the live /api/homecore/events feed lands (§7.1). New rows still arrive over the WS bus.', 'amber'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── live lag indicator (top, fed by the shared WS bus) ──────────
|
// ── live lag indicator (top, fed by the shared WS bus) ──────────
|
||||||
|
|||||||
Reference in New Issue
Block a user