Changeset - fddd07e694ab
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 3 years ago 2022-05-24 06:53:07
drewp@bigasterisk.com
cleanup nested class mess
2 files changed with 12 insertions and 18 deletions:
0 comments (0 inline, 0 general)
light9/collector/web/Light9CollectorUi.ts
Show inline comments
 
@@ -18,8 +18,6 @@ const log = debug("collector");
 

	
 
@customElement("light9-collector-ui")
 
export class Light9CollectorUi extends GraphAwarePage {
 
  graph?: SyncedGraph;
 
  static styles = [];
 
  render() {
 
    return html`${super.render()}
 
      <h1>Collector <a href="metrics">[metrics]</a></h1>
 
@@ -37,7 +35,6 @@ export class Light9CollectorDeviceList e
 
  render() {
 
    return html`
 
      <h2>Devices</h2>
 
      <light9-collector-device uri="http://light9.bigasterisk.com/theater/skyline/device/strip1"></light9-collector-device>
 
      <div style="column-width: 11em">${this.devices.map((d) => html`<light9-collector-device uri="${d.value}"></light9-collector-device>`)}</div>
 
    `;
 
  }
light9/web/RdfdbSyncedGraph.ts
Show inline comments
 
@@ -18,17 +18,19 @@ export class GraphChangedEvent extends C
 
  }
 
}
 

	
 
let RdfdbSyncedGraph
 
let setTopGraph: (sg: SyncedGraph) => void;
 
(window as any).topSyncedGraph = new Promise<SyncedGraph>((res, rej) => {
 
  setTopGraph = res;
 
});
 

	
 
(window as any).topSyncedGraph = new Promise((res, rej) => {
 
  // Contains a SyncedGraph,
 
  // displays a little status box,
 
  // and emits 'changed' events with the graph and latest patch when it changes
 
  
 
  RdfdbSyncedGraph=customElement("rdfdb-synced-graph")(class RdfdbSyncedGraph extends LitElement {
 
    /*@property()*/ graph: SyncedGraph;
 
    /*@property()*/ status: string;
 
    /*@property()*/ testGraph = false;
 
@customElement("rdfdb-synced-graph")
 
export class RdfdbSyncedGraph extends LitElement {
 
  @property() graph: SyncedGraph;
 
  @property() status: string;
 
  @property() testGraph = false;
 
    static styles = [
 
      css`
 
        :host {
 
@@ -66,8 +68,7 @@ let RdfdbSyncedGraph
 
        this.onClear.bind(this),
 
        this.onGraphChanged.bind(this)
 
      );
 
      // (window as any).topSyncedGraph = this.graph;
 
      res(this.graph);
 
    setTopGraph(this.graph);
 
    }
 

	
 
    private onGraphChanged(graph: SyncedGraph, patch: Patch) {
 
@@ -79,13 +80,9 @@ let RdfdbSyncedGraph
 
        })
 
      );
 
    }
 
  });
 
});
 
}
 

	
 

	
 
async function getTopGraph(): Promise<SyncedGraph> {
 
export async function getTopGraph(): Promise<SyncedGraph> {
 
  const s = (window as any).topSyncedGraph;
 
  return await s;
 
}
 

	
 
export { RdfdbSyncedGraph, getTopGraph };
 
\ No newline at end of file
0 comments (0 inline, 0 general)