Mercurial > code > home > repos > homeauto
annotate service/arduinoNode/static/index.html @ 198:06795f84fe29
arduinoNode config. missing import
Ignore-this: d2fb9c1c35ff9b30f0b7b0ee67342821
author | drewp@bigasterisk.com |
---|---|
date | Sun, 04 Oct 2015 04:15:57 -0700 |
parents | 35e07a9f3287 |
children | f8ffb9d8d982 |
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> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
4 <title>arduinoNode</title> |
194 | 5 <meta name=viewport content="width=device-width, initial-scale=1"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
6 <meta charset="utf-8" /> |
193 | 7 <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script> |
8 <link rel="import" href="/lib/polymer/1.0.9/polymer/polymer.html"> | |
9 <link rel="import" href="/lib/polymer/1.0.9/iron-ajax/iron-ajax.html"> | |
10 <link rel="import" href="/lib/polymer/1.0.9/iron-flex-layout/iron-flex-layout.html"> | |
198 | 11 <link rel="import" href="/lib/polymer/1.0.9/paper-button/paper-button.html"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
12 <link rel="import" href="/room/ari/static/rdf-observe.html"> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
13 <link rel="import" href="/room/ari/static/rdf-oneshot.html"> |
193 | 14 <link rel="import" href="/room/ari/static/rdf-uri.html"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
15 <link rel="import" href="static/output-widgets.html"> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
16 <style> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
17 body { |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
18 font-family: monospace; |
193 | 19 display: flex; |
20 flex-direction: column; | |
21 margin: 0; | |
22 height: 100vh; | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
23 } |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
24 </style> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
25 </head> |
193 | 26 <body> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
27 <script> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
28 window.NS = { |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
29 dev: 'http://projects.bigasterisk.com/device/', |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
30 room: 'http://projects.bigasterisk.com/room/', |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
31 rdfs: 'http://www.w3.org/2000/01/rdf-schema#', |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
32 sensor: 'http://bigasterisk.com/homeauto/sensor/' |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
33 }; |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
34 </script> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
35 |
193 | 36 <dom-module id="linked-uri"> |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
37 <template> |
193 | 38 <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
|
39 </template> |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
40 <script> |
194 | 41 HTMLImports.whenReady(function () { |
42 Polymer({ | |
43 is: 'linked-uri', | |
44 properties: { href: { notify: true } }, | |
45 behaviors: [BigastUri] | |
46 }); | |
193 | 47 }); |
48 </script> | |
49 </dom-module> | |
50 | |
51 <!-- subj/pred are compact uris --> | |
52 <dom-module id="watched-subgraph"> | |
53 <style> | |
54 .read { font-weight: bold; } | |
55 </style> | |
56 <template> | |
57 <rdf-observe graph="{{graph}}" subject="{{subj}}" predicate="{{pred}}" out="{{out}}"> | |
58 </rdf-observe> | |
59 | |
60 <div><span>{{compactUri(subj)}}</span>, <span>{{compactUri(pred)}}</span>, | |
61 <span class="read">{{formatted(out)}}</span> | |
62 </div> | |
63 | |
64 </template> | |
65 <script> | |
194 | 66 HTMLImports.whenReady(function () { |
67 Polymer({ | |
68 is: 'watched-subgraph', | |
69 properties: { | |
70 graph: { notify: true }, | |
71 out: { notify: true }, | |
72 pred: { notify: true }, | |
73 subj: { notify: true } | |
74 }, | |
75 behaviors: [BigastUri], | |
76 formatted: function (out) { | |
77 var obj = out[this.compactUri(this.pred)]; | |
78 if (typeof obj == 'string') { | |
79 return this.compactUri(obj); | |
80 } else { | |
81 return obj['@value']; | |
82 } | |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
83 } |
194 | 84 }); |
187
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
85 }); |
fc5fdcc3ed4a
board control ui: output-rgb, fix ajax protocol, display output uris
drewp@bigasterisk.com
parents:
173
diff
changeset
|
86 </script> |
193 | 87 </dom-module> |
88 | |
89 <dom-module id="arduinonode-boards"> | |
90 <style> | |
91 h1 { | |
92 margin: 0; | |
93 font-size: 130%; | |
94 } | |
95 ul { | |
96 padding-left: 5px; | |
97 } | |
98 .board, .device { | |
99 border: 1px solid gray; | |
100 border-radius: 10px; | |
101 margin: 13px; | |
102 padding: 7px; | |
103 box-shadow: 2px 5px 5px rgba(0, 0, 0, 0.14); | |
104 } | |
105 .board { | |
106 background: rgb(244, 244, 244); | |
107 } | |
108 .device { | |
109 background: #fff; | |
110 } | |
111 </style> | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
112 <template> |
193 | 113 <iron-ajax url="boards" auto="true" handle-as="json" |
114 last-response="{{ret}}"></iron-ajax> | |
115 <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
|
116 <div class="board"> |
193 | 117 <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
|
118 <h2>Devices</h2> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
119 <ul> |
193 | 120 <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
|
121 <div class="device"> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
122 <h1> |
193 | 123 <span>{{dev.className}}</span> |
124 <linked-uri href$="{{dev.uri}}"></linked-uri> | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
125 </h1> |
193 | 126 <template is="dom-if" if="{{dev.watchPrefixes.length}}"> |
171 | 127 <div>watching:</div> |
128 <ul> | |
193 | 129 <template is="dom-repeat" items="{{dev.watchPrefixes}}" as="prefix"> |
130 <watched-subgraph graph="{{board.graph}}" subj="{{prefix.0}}" pred="{{prefix.1}}"></watched-subgraph> | |
171 | 131 </template> |
132 </ul> | |
133 </template> | |
134 | |
193 | 135 <template is="dom-if" if="{{dev.outputWidgets.length}}"> |
171 | 136 <div>send output:</div> |
137 <ul> | |
193 | 138 <template is="dom-repeat" items="{{dev.outputWidgets}}" as="out"> |
171 | 139 <div> |
140 <output-widget-any desc="{{out}}"></output-widget-any> | |
141 </div> | |
142 </template> | |
143 </ul> | |
144 </template> | |
170
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
145 </div> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
146 </template> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
147 </ul> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
148 </div> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
149 </template> |
376599552a4c
polymer board debug page with working output widgets
drewp@bigasterisk.com
parents:
diff
changeset
|
150 </template> |
193 | 151 <script> |
194 | 152 HTMLImports.whenReady(function () { |
153 Polymer({ | |
154 is: 'arduinonode-boards', | |
155 behaviors: [BigastUri] | |
156 }); | |
193 | 157 }); |
158 </script> | |
159 </dom-module> | |
194 | 160 <arduinonode-boards></arduinonode-boards> |
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> |