feat(frontend): handle UnitRuntimeChanged WebSocket message

This commit is contained in:
caoqianming 2026-03-24 14:58:29 +08:00
parent 21f6008cba
commit 0c2ce48d23
1 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import { dom } from "./dom.js";
import { prependEvent } from "./events.js"; import { prependEvent } from "./events.js";
import { formatValue } from "./points.js"; import { formatValue } from "./points.js";
import { state } from "./state.js"; import { state } from "./state.js";
import { renderUnits } from "./units.js";
function escapeHtml(text) { function escapeHtml(text) {
return text return text
@ -94,6 +95,13 @@ export function startPointSocket() {
if (payload.type === "EventCreated" || payload.type === "event_created") { if (payload.type === "EventCreated" || payload.type === "event_created") {
prependEvent(payload.data); prependEvent(payload.data);
} }
if (payload.type === "UnitRuntimeChanged") {
const runtime = payload.data;
state.runtimes.set(runtime.unit_id, runtime);
renderUnits();
return;
}
} catch { } catch {
// ignore malformed messages // ignore malformed messages
} }