# HG changeset patch # User drewp@bigasterisk.com # Date 2024-05-17 23:56:32 # Node ID 1d3594ffd14bce11a2ac407a3b9f3fec1dfff653 # Parent 561fad2a2859402af188c40eedb7ba7cbd0fe9c6 new home-status elt diff --git a/web/TiledHome.ts b/web/TiledHome.ts --- a/web/TiledHome.ts +++ b/web/TiledHome.ts @@ -1,11 +1,25 @@ +import debug from "debug"; +import * as FlexLayout from "flexlayout-react"; +import { LitElement, html } from "lit"; +import { customElement } from "lit/decorators.js"; import * as React from "react"; import { createRoot } from "react-dom/client"; -import * as FlexLayout from "flexlayout-react"; +import { getTopGraph } from "./RdfdbSyncedGraph"; +import { SyncedGraph } from "./SyncedGraph"; +import { Patch } from "./patch"; +import { NamedNode } from "n3"; +export { RdfdbSyncedGraph } from "./RdfdbSyncedGraph"; +export { Light9CollectorUi } from "./collector/Light9CollectorUi"; +export { Light9FadeUi } from "./fade/Light9FadeUi"; export { Light9DeviceSettings } from "./live/Light9DeviceSettings"; -export { Light9CollectorUi } from "./collector/Light9CollectorUi"; +import { showRoot } from "./show_specific"; +import { HandlerFunc } from "./AutoDependencies"; +const log = debug("home"); const config: FlexLayout.IJsonModel = { - global: {}, + global: { + tabEnableRename: false, + }, borders: [], layout: { type: "row", @@ -25,8 +39,6 @@ const config: FlexLayout.IJsonModel = { }, }; -const e = React.createElement; - // see https://github.com/lit/lit/tree/main/packages/labs/react class Main extends React.Component { @@ -38,11 +50,30 @@ class Main extends React.Component { factory = (node: any) => { var component = node.getComponent(); - return e(component, null, ""); + return React.createElement(component, null, ""); }; render() { - return e(FlexLayout.Layout, { model: this.state.model, factory: this.factory }); + return React.createElement(FlexLayout.Layout, { + model: this.state.model, + realtimeResize: true, + factory: this.factory, + }); + } +} + +@customElement("light9-home-status") +export class Light9HomeStatus extends LitElement { + graph!: SyncedGraph; + render() { + return html` + metrics `; + } + constructor() { + super(); + getTopGraph().then((g) => { + this.graph = g; + }); } } diff --git a/web/index.html b/web/index.html --- a/web/index.html +++ b/web/index.html @@ -5,7 +5,7 @@ - + -
hello
- +
loading layout...
+