# HG changeset patch # User drewp # Date 1578297858 28800 # Node ID 2832e5c14c74d86d6a7f474d9fce93d6372b74fd # Parent 383e32841b3571f4d0855608cfa4845931706d28 some type notes and cleanups Ignore-this: 93fd167cf1951c6fb20aa45ff0a28f24 darcs-hash:316075a5a24f27aba681de758681bdb904ad24fc diff -r 383e32841b35 -r 2832e5c14c74 service/wifi/src/index.ts --- a/service/wifi/src/index.ts Sun Jan 05 23:52:26 2020 -0800 +++ b/service/wifi/src/index.ts Mon Jan 06 00:04:18 2020 -0800 @@ -18,7 +18,7 @@ } interface Dev { agoMin: number | undefined; - ipAddress: Literal; + ipAddress: Literal; // todo no one wants this literal. just make it string. dhcpHostname: string; macAddress: Literal; packetsPerSec: number; @@ -28,11 +28,12 @@ } const room = "http://projects.bigasterisk.com/room/"; +////////////////// funcs that could move out ////////////////////////////// // workaround for uris that don't have good labels in the graph function labelFromUri( uri: NamedNode, prefix: string, - tailsToLabels: any, + tailsToLabels: {[key: string]: string}, defaultLabel: string ) { let label = defaultLabel === undefined ? uri.value : defaultLabel; @@ -113,6 +114,7 @@ } throw new Error("found multiple matches for pred"); } +////////////////////////////////////////////////////////////////////////////////// @customElement("wifi-display") class WifiDisplay extends LitElement { @@ -120,10 +122,7 @@ return [style]; } - @property({ - type: Object, - // observer: WifiDisplay.prototype.onGraphChanged, - }) + @property({ type: Object }) graph!: VersionedGraph; connectedCallback() { @@ -173,10 +172,10 @@ const glow = ""; //todo return html`
- ${dev.macAddress && dev.macAddress.value} + ${dev.macAddress.value} ${dev.ipAddress && dev.ipAddress.value}${dev.ipAddress.value} ${dev.packetsPerSecDisplay} @@ -185,8 +184,7 @@ ${agoReport} [flows]