Mercurial > code > home > repos > homeauto
annotate lib/homeauto_anynode/static/index.html @ 618:ab762d49cd38
output-widgets.html path
Ignore-this: 3e3625215c69ee5600c20d42d3afaabc
author | drewp@bigasterisk.com |
---|---|
date | Sun, 04 Aug 2019 13:03:04 -0700 |
parents | ef9b9c48463d |
children | e3af8cc7235d |
rev | line source |
---|---|
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
1 <!doctype html> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
2 <html> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
3 <head> |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
4 <title>ha - </title> |
616
ef9b9c48463d
partial style redo. standardize ns setup
drewp@bigasterisk.com
parents:
614
diff
changeset
|
5 <meta charset="utf-8"> |
193 | 6 <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script> |
319
d4a602576170
requirejs config for streamed-graph to use
drewp@bigasterisk.com
parents:
233
diff
changeset
|
7 <script src="/lib/require/require-2.3.3.js"></script> |
616
ef9b9c48463d
partial style redo. standardize ns setup
drewp@bigasterisk.com
parents:
614
diff
changeset
|
8 <script src="/rdf/common_paths_and_ns.js"></script> |
ef9b9c48463d
partial style redo. standardize ns setup
drewp@bigasterisk.com
parents:
614
diff
changeset
|
9 |
ef9b9c48463d
partial style redo. standardize ns setup
drewp@bigasterisk.com
parents:
614
diff
changeset
|
10 <link rel="stylesheet" href="/rdf/browse/style.css"> |
319
d4a602576170
requirejs config for streamed-graph to use
drewp@bigasterisk.com
parents:
233
diff
changeset
|
11 |
193 | 12 <link rel="import" href="/lib/polymer/1.0.9/polymer/polymer.html"> |
13 <link rel="import" href="/lib/polymer/1.0.9/iron-ajax/iron-ajax.html"> | |
14 <link rel="import" href="/lib/polymer/1.0.9/iron-flex-layout/iron-flex-layout.html"> | |
198 | 15 <link rel="import" href="/lib/polymer/1.0.9/paper-button/paper-button.html"> |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
16 <link rel="import" href="/rdf/rdf-oneshot.html"> |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
17 <link rel="import" href="/rdf/rdf-uri.html"> |
228
f609e1eee4db
add synced graph-view to the bottom of arduinoNode/piNode tester page
drewp@bigasterisk.com
parents:
222
diff
changeset
|
18 <link rel="import" href="/rdf/streamed-graph.html"> |
618 | 19 <link rel="import" href="output-widgets.html"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
20 </head> |
616
ef9b9c48463d
partial style redo. standardize ns setup
drewp@bigasterisk.com
parents:
614
diff
changeset
|
21 <body class="rdfBrowsePage"> |
193 | 22 <dom-module id="linked-uri"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
23 <template> |
193 | 24 <a href$="{{href}}">{{compactUri(href)}}</a> |
173
0daa8cbbd8f6
handle compact/full uris better, but still not always right
drewp@bigasterisk.com
parents:
171
diff
changeset
|
25 </template> |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
26 <script> |
194 | 27 HTMLImports.whenReady(function () { |
28 Polymer({ | |
29 is: 'linked-uri', | |
30 properties: { href: { notify: true } }, | |
31 behaviors: [BigastUri] | |
32 }); | |
193 | 33 }); |
34 </script> | |
35 </dom-module> | |
36 | |
37 <dom-module id="watched-subgraph"> | |
38 <style> | |
39 .read { font-weight: bold; } | |
40 </style> | |
41 <template> | |
42 <div><span>{{compactUri(subj)}}</span>, <span>{{compactUri(pred)}}</span>, | |
43 <span class="read">{{formatted(out)}}</span> | |
44 </div> | |
45 | |
46 </template> | |
47 <script> | |
194 | 48 HTMLImports.whenReady(function () { |
49 Polymer({ | |
50 is: 'watched-subgraph', | |
51 properties: { | |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
52 streamedGraph: { notify: true, observer: 'onGraphChange' }, // streamed-graph output |
194 | 53 out: { notify: true }, |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
54 pred: { notify: true }, // uri |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
55 subj: { notify: true } // uri |
194 | 56 }, |
57 behaviors: [BigastUri], | |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
58 onGraphChange: function(streamedGraph) { |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
59 if (!streamedGraph.graph) { |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
60 return; |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
61 } |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
62 var env = streamedGraph.graph.store.rdf; |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
63 streamedGraph.graph.quadStore.quads({subject: env.createNamedNode(this.subj), |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
64 predicate: env.createNamedNode(this.pred)}, |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
65 function(quad) { |
613 | 66 this.out = quad.object.valueOf(); |
67 }.bind(this)); | |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
68 }, |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
69 formatted: function (obj) { |
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
70 if (typeof(obj) == 'string') { |
194 | 71 return this.compactUri(obj); |
72 } else { | |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
73 return obj; |
194 | 74 } |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
75 } |
194 | 76 }); |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
77 }); |
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
78 </script> |
193 | 79 </dom-module> |
80 | |
81 <dom-module id="arduinonode-boards"> | |
82 <style> | |
83 h1 { | |
613 | 84 margin: 0; |
85 font-size: 130%; | |
193 | 86 } |
87 ul { | |
613 | 88 padding-left: 5px; |
193 | 89 } |
90 .board, .device { | |
613 | 91 border: 1px solid gray; |
92 border-radius: 10px; | |
93 margin: 13px; | |
94 padding: 7px; | |
95 box-shadow: 2px 5px 5px rgba(0, 0, 0, 0.14); | |
193 | 96 } |
616
ef9b9c48463d
partial style redo. standardize ns setup
drewp@bigasterisk.com
parents:
614
diff
changeset
|
97 |
193 | 98 </style> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
99 <template> |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
100 <streamed-graph url="graph/events" graph="{{graph}}"></streamed-graph> |
193 | 101 <iron-ajax url="boards" auto="true" handle-as="json" |
102 last-response="{{ret}}"></iron-ajax> | |
103 <template is="dom-repeat" items="{{ret.boards}}" as="board"> | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
104 <div class="board"> |
193 | 105 <h1>Board <linked-uri href$="{{board.uri}}"></linked-uri></h1> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
106 <h2>Devices</h2> |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
107 <ul class="devs"> |
193 | 108 <template is="dom-repeat" items="{{board.devices}}" as="dev"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
109 <div class="device"> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
110 <h1> |
193 | 111 <span>{{dev.className}}</span> |
112 <linked-uri href$="{{dev.uri}}"></linked-uri> | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
113 </h1> |
193 | 114 <template is="dom-if" if="{{dev.watchPrefixes.length}}"> |
171 | 115 <div>watching:</div> |
116 <ul> | |
193 | 117 <template is="dom-repeat" items="{{dev.watchPrefixes}}" as="prefix"> |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
118 <watched-subgraph streamed-graph="{{graph}}" subj="{{prefix.0}}" pred="{{prefix.1}}"></watched-subgraph> |
171 | 119 </template> |
120 </ul> | |
121 </template> | |
122 | |
193 | 123 <template is="dom-if" if="{{dev.outputWidgets.length}}"> |
171 | 124 <div>send output:</div> |
125 <ul> | |
193 | 126 <template is="dom-repeat" items="{{dev.outputWidgets}}" as="out"> |
171 | 127 <div> |
233
4ebb5cc30002
server/browser graph sync. cut dependency on the WS version. merge some changes between arduino/pi code.
drewp@bigasterisk.com
parents:
228
diff
changeset
|
128 <output-widget-any streamed-graph="{{graph}}" desc="{{out}}"></output-widget-any> |
171 | 129 </div> |
130 </template> | |
131 </ul> | |
132 </template> | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
133 </div> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
134 </template> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
135 </ul> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
136 </div> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
137 </template> |
614 | 138 |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
139 </template> |
193 | 140 <script> |
194 | 141 HTMLImports.whenReady(function () { |
142 Polymer({ | |
143 is: 'arduinonode-boards', | |
222 | 144 properties: { |
145 ret: { type: Object, notify: true, observer: 'onBoards' } | |
146 }, | |
147 onBoards: function() { | |
148 document.title = document.title + ' ' + this.ret.host; | |
149 }, | |
194 | 150 behaviors: [BigastUri] |
151 }); | |
193 | 152 }); |
153 </script> | |
154 </dom-module> | |
194 | 155 <arduinonode-boards></arduinonode-boards> |
614 | 156 |
157 <div id="out"></div> | |
158 <script type="module" src="/rdf/streamed_graph_view.js"></script> | |
159 | |
160 | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
161 </body> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
162 </html> |