feat(frontend): handle UnitRuntimeChanged WebSocket message
This commit is contained in:
parent
21f6008cba
commit
0c2ce48d23
|
|
@ -3,6 +3,7 @@ import { dom } from "./dom.js";
|
|||
import { prependEvent } from "./events.js";
|
||||
import { formatValue } from "./points.js";
|
||||
import { state } from "./state.js";
|
||||
import { renderUnits } from "./units.js";
|
||||
|
||||
function escapeHtml(text) {
|
||||
return text
|
||||
|
|
@ -94,6 +95,13 @@ export function startPointSocket() {
|
|||
if (payload.type === "EventCreated" || payload.type === "event_created") {
|
||||
prependEvent(payload.data);
|
||||
}
|
||||
|
||||
if (payload.type === "UnitRuntimeChanged") {
|
||||
const runtime = payload.data;
|
||||
state.runtimes.set(runtime.unit_id, runtime);
|
||||
renderUnits();
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
// ignore malformed messages
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue