This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
256 lines (219 loc) · 12.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html lang="en">
<head>
<title>Thingweb Client</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<!-- build:css assets/css/vendor.min.css -->
<link rel="stylesheet" href="bower_components/angular-material/angular-material.css">
<!-- endbuild -->
<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,400italic'>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<style type="text/css">
/**
* Hide when Angular is not yet loaded and initialized
*/
[ng\:cloak],
[ng-cloak],
[data-ng-cloak],
[x-ng-cloak],
.ng-cloak,
.x-ng-cloak {
display: none !important;
}
</style>
</head>
<body ng-app="thingclient" layout="row" ng-controller="ThingClientCtrl as tcc" ng-cloak>
<md-sidenav class="site-sidenav md-sidenav-left md-whiteframe-z2" md-component-id="left" ng-click="tcc.toggleList()" aria-label="Show Things List"
md-is-locked-open="$mdMedia('gt-sm')" flex>
<md-toolbar layout="row" class="md-whiteframe-z1">
<h3>Things</h3>
</md-toolbar>
<md-list>
<md-list-item ng-repeat="it in things">
<md-button ng-click="tcc.selectThing(it)" ng-class="{'selected' : it === tcc.selected }">
<md-icon>bug_report</md-icon>
{{it.name}}
</md-button>
</md-list-item>
</md-list>
<md-fab-speed-dial md-open="isOpen" md-direction="right" class="md-scale" md-hover-full="true" ng-mouseenter="isOpen=true"
ng-mouseleave="isOpen=false">
<md-fab-trigger>
<md-button aria-label="Add Thing" class="md-fab md-primary">
<md-icon>add</md-icon>
<md-tooltip>add thing</md-tooltip>
</md-button> Add...
</md-fab-trigger>
<md-fab-actions>
<md-button aria-label="add from uri" class="md-fab md-raised md-mini" ng-click="tcc.openUriDialog($event,'uri')">
<md-icon>cloud_download</md-icon>
<md-tooltip>add from uri</md-tooltip>
</md-button>
<md-button aria-label="add from file" class="md-fab md-raised md-mini" ng-click="tcc.addFileFromPicker('tdFilePicker')">
<md-icon>attachment</md-icon>
<md-tooltip>add from file</md-tooltip>
</md-button>
<md-button aria-label="add from repo" class="md-fab md-raised md-mini" ng-click="tcc.addCatalog($event)">
<md-icon>local_library</md-icon>
<md-tooltip>add from repo</md-tooltip>
</md-button>
</md-fab-actions>
</md-fab-speed-dial>
<input id="tdFilePicker" type="file" file-loader ng-model="pickedFile" file-loaded="tcc.addThingFromJson(pickedFile)" ng-show="false"
/>
</md-sidenav>
<div layout="column" tabIndex="-1" role="main" class="md-whiteframe-z2" flex>
<md-toolbar layout="row" class="md-whiteframe-z1">
<md-button id="main" class="menu" hide-gt-sm ng-click="tcc.toggleList()" aria-label="Show Things List">
<md-icon>menu</md-icon>
</md-button>
<h3>
Web of Things Client
<span ng-show="tcc.selected.name">: {{tcc.selected.name}}</span>
</h3>
<span flex></span>
<md-button ng-click="tcc.openEditor()">Script editor</md-button>
</md-toolbar>
<md-content id="content" ng-show="tcc.selected.name" layout-margin layout="column">
<section class="md-whiteframe-2dp">
<md-toolbar class="md-primary">
<div class="md-toolbar-tools">
<h2>{{tcc.selected.name}}</h2>
</div>
</md-toolbar>
<span class="md-subhead">{{tcc.selected.uri}}</span>
</section>
<br/>
<!-- actions and properties -->
<section class="md-whiteframe-2dp">
<md-toolbar class="md-primary">
<div class="md-toolbar-tools">
<h2>Actions</h2>
</div>
</md-toolbar>
<ul ng-repeat="action in tcc.selected.actions">
<li>{{action.name}}
<md-input-container name="myForm" ng-show="action.xsdParamType== 'String' ">
<label>Parameter ({{action.xsdParamType}})</label>
<input type="text" name="myField" ng-model="param" />
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-message="type">This field must be a valid type.</div>
</div>
</md-input-container>
<md-input-container name="myForm" ng-show="action.xsdParamType== 'javascript' ">
<md-button class="md-raised md-primary" ng-click="tcc.openEditor($event, action)">Script-Editor
<md-tooltip>click to specify/modify script</md-tooltip>
</md-button>
</md-input-container>
<md-input-container name="myForm" ng-show="action.xsdParamType=='number'||action.xsdParamType=='integer' ">
<label>Parameter ({{action.xsdParamType}})</label>
<input type="number" name="myField" ng-model="param" />
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-message="type">This field must be a valid type.</div>
</div>
</md-input-container>
<ul ng-show="action.xsdParamType=='object'" ng-repeat="(key, val) in action.inputProperties track by $index">
<li>
<span>{{key}}</span>
<md-input-container name="myForm">
<label>{{val.type }} {{tcc.minMax(val.minimum,val.maximum)}}</label>
<input type="{{tcc.setType(val.type)}}" name="myField" min="{{val.minimum}}" max="{{val.maximum}}" ng-model="param[key]"
required/>
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-message="required">Please enter a value for this field.</div>
<div ng-message="type">This field must be a valid type.</div>
<div ng-message="max">This field can not exceed the max value </div>
<div ng-message="min">This field can not exceed the min value </div>
</div>
</md-input-container>
</li>
</ul>
<md-checkbox ng-show="action.xsdParamType === 'boolean'" ng-model="param">
</md-checkbox>
<md-button class="md-raised" ng-click="tcc.callAction(action, param)" aria-label="Execute action">
<md-tooltip>execute action</md-tooltip>
call</md-button>
</li>
</ul>
</section>
<br/>
<section class="md-whiteframe-2dp" flex>
<md-toolbar class="md-primary">
<div class="md-toolbar-tools">
<h2>Properties</h2>
<span flex></span>
<md-button class="md-icon-button" aria-label="update state" ng-click="tcc.updateState()">
<md-icon>autorenew</md-icon>
<md-tooltip>update all</md-tooltip>
</md-button>
</div>
</md-toolbar>
<ul ng-repeat="property in tcc.selected.properties">
<li>{{property.name}}:
<md-input-container ng-show="property.type === 'string'" name="myForm">
<label>{{property.type }}{{tcc.minMax(val.minimum,val.maximum)}}</label>
<input type="text" name="myField" ng-model="property.value" ng-readonly="!property.writable" />
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-message="type">This field must be a valid type.</div>
</div>
</md-input-container>
<md-input-container ng-show="property.type=='number' || property.type=='integer'" name="myForm">
<label>{{property.type}}</label>
<input type="number" name="myField" ng-model="property.value" ng-readonly="!property.writable" />
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-message="type">This field must be a valid type.</div>
</div>
</md-input-container>
<ul ng-show="property.type=='object'" ng-repeat="(key, val) in property.properties track by $index">
<li>
<span>{{key}}</span>
<md-input-container name="myForm">
<label>{{val.type }} {{tcc.minMax(val.minimum,val.maximum)}}</label>
<input type="{{tcc.setType(val.type)}}" name="myField" min="{{val.minimum}}" max="{{val.maximum}}" ng-model="property.value[key]"
ng-readonly="!property.writable" required/>
<div ng-messages="myForm.myField.$error" role="alert">
<div ng-message="required">Please enter a value for this field.</div>
<div ng-message="type">This field must be a valid type.</div>
<div ng-message="max">This field can not exceed the max value </div>
<div ng-message="min">This field can not exceed the min value </div>
</div>
</md-input-container>
</li>
</ul>
<md-checkbox type="checkbox" ng-model="property.value" ng-readonly="!property.writable" ng-show="property.type === 'boolean'">
</md-checkbox>
<md-button class="md-raised" ng-click="tcc.toggleAuto(property)">auto-</md-button>
<md-button class="md-raised" ng-click="tcc.readProperty(property)" ng-disabled="property.autoUpdate">update</md-button>
<md-button class="md-raised" ng-click="tcc.writeProperty(property)" ng-show="property.writable">set</md-button>
<div ng-show="property.autoUpdate" class="md-whiteframe-2dp" layout flex="50">
<chart value="property.history" type="Bar" height="120" width="360" />
</div>
</li>
</ul>
</section>
</md-content>
</div>
<!-- build:js assets/js/vendor.min.js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-aria/angular-aria.js"></script>
<script src="bower_components/angular-messages/angular-messages.js"></script>
<script src="bower_components/angular-material/angular-material.js"></script>
<script src="bower_components/angular-coap/angular-coap.js"></script>
<script src="bower_components/angular-wot/dist/angular-wot.js"></script>
<!-- endbuild -->
<!-- build:js assets/js/app.min.js -->
<script src="js/chart.js"></script>
<script src="js/script-editor.directive.js"></script>
<script src="js/chartjs-directive.js"></script>
<script src="js/file-loader.directive.js"></script>
<script src="js/thingclient.module.js"></script>
<script src="js/thingclient-ctrl.controller.js"></script>
<!-- endbuild -->
<script src="node_modules/monaco-editor/min/vs/loader.js"></script>
<script src="editor-setup.js"></script>
</body>
</html>