-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·623 lines (577 loc) · 20.9 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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Antonio Di Cello" >
<link rel="shortcut icon" href="images/favicon.png">
<title>OSNF Admin Console</title>
<!--Core CSS -->
<link href="bs3/css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-reset.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet" />
<script type="text/javascript"
src="http://bernii.github.io/gauge.js/dist/gauge.min.js"></script>
<style type="text/css">
.indicator {
float:left;
width:330px;
}
.value {
width:330px;
}
</style>
</head>
<body>
<section id="container" >
<!--header start-->
<header class="header fixed-top clearfix">
<!--logo start-->
<div class="brand">
<a href="index.html" class="logo">
<img src="images/logo.png" alt="">
</a>
<div class="sidebar-toggle-box">
<div class="fa fa-bars"></div>
</div>
</div>
<!--logo end-->
<div class="nav notify-row" id="top_menu">
<!-- notification start -->
<ul class="nav top-menu">
<!-- settings start -->
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<i class="fa fa-tasks"></i>
<span class="badge bg-success">8</span>
</a>
<ul class="dropdown-menu extended tasks-bar">
<li>
<p class="">You have 8 pending tasks</p>
</li>
<li>
<a href="#">
<div class="task-info clearfix">
<div class="desc pull-left">
<h5>Target Sell</h5>
<p>25% , Deadline 14 Set 14</p>
</div>
<span class="notification-pie-chart pull-right" data-percent="45">
<span class="percent"></span>
</span>
</div>
</a>
</li>
<li>
<a href="#">
<div class="task-info clearfix">
<div class="desc pull-left">
<h5>Product Delivery</h5>
<p>45% , Deadline 12 Oct 14</p>
</div>
<span class="notification-pie-chart pull-right" data-percent="78">
<span class="percent"></span>
</span>
</div>
</a>
</li>
<li>
<a href="#">
<div class="task-info clearfix">
<div class="desc pull-left">
<h5>Payment collection</h5>
<p>87% , Deadline 12 Nov 14</p>
</div>
<span class="notification-pie-chart pull-right" data-percent="60">
<span class="percent"></span>
</span>
</div>
</a>
</li>
<li>
<a href="#">
<div class="task-info clearfix">
<div class="desc pull-left">
<h5>Target Sell</h5>
<p>33% , Deadline 12 June 15</p>
</div>
<span class="notification-pie-chart pull-right" data-percent="90">
<span class="percent"></span>
</span>
</div>
</a>
</li>
<li class="external">
<a href="#">See All Tasks</a>
</li>
</ul>
</li>
<!-- settings end -->
<!-- inbox dropdown start-->
<li id="header_inbox_bar" class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<i class="fa fa-envelope-o"></i>
<span class="badge bg-important">4</span>
</a>
<ul class="dropdown-menu extended inbox">
<li>
<p class="red">You have 4 Mails</p>
</li>
<li>
<a href="#">
<span class="photo"><img alt="avatar" src="images/avatar-mini.jpg"></span>
<span class="subject">
<span class="from">Antonio Di Cello</span>
<span class="time">Just now</span>
</span>
<span class="message">
Hello, this is an example msg.
</span>
</a>
</li>
<li>
<a href="#">
<span class="photo"><img alt="avatar" src="images/avatar-mini-2.jpg"></span>
<span class="subject">
<span class="from">Immacolata Conforti</span>
<span class="time">2 min ago</span>
</span>
<span class="message">
Hello, this is an example msg.
</span>
</a>
</li>
<li>
<a href="#">
<span class="photo"><img alt="avatar" src="images/avatar-mini-3.jpg"></span>
<span class="subject">
<span class="from">Alessandro Galasso</span>
<span class="time">2 days ago</span>
</span>
<span class="message">
Hello, this is an example msg.
</span>
</a>
</li>
<li>
<a href="#">See all messages</a>
</li>
</ul>
</li>
<!-- inbox dropdown end -->
<!-- notification dropdown start-->
<li id="header_notification_bar" class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<i class="fa fa-bell-o"></i>
<span class="badge bg-warning">3</span>
</a>
<ul class="dropdown-menu extended notification">
<li>
<p>Notifications</p>
</li>
<li>
<div class="alert alert-info clearfix">
<span class="alert-icon"><i class="fa fa-bolt"></i></span>
<div class="noti-info">
<a href="#"> Node #1 overloaded.</a>
</div>
</div>
</li>
<li>
<div class="alert alert-danger clearfix">
<span class="alert-icon"><i class="fa fa-bolt"></i></span>
<div class="noti-info">
<a href="#"> Node #2 overloaded.</a>
</div>
</div>
</li>
<li>
<div class="alert alert-success clearfix">
<span class="alert-icon"><i class="fa fa-bolt"></i></span>
<div class="noti-info">
<a href="#"> Node #3 overloaded.</a>
</div>
</div>
</li>
</ul>
</li>
<!-- notification dropdown end -->
</ul>
<!-- notification end -->
</div>
<div class="top-nav clearfix">
<!--search & user info start-->
<ul class="nav pull-right top-menu">
<li>
<input type="text" class="form-control search" placeholder=" Search">
</li>
<!-- user login dropdown start-->
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<img alt="" src="images/avatar1_small.jpg">
<span class="username">Vincenzo Pirrone</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu extended logout">
<li><a href="#"><i class=" fa fa-suitcase"></i>Profile</a></li>
<li><a href="#"><i class="fa fa-cog"></i> Settings</a></li>
<li><a href="login.html"><i class="fa fa-key"></i> Log Out</a></li>
</ul>
</li>
<!-- user login dropdown end -->
<li>
<div class="toggle-right-box">
<div class="fa fa-bars"></div>
</div>
</li>
</ul>
<!--search & user info end-->
</div>
</header>
<!--header end-->
<aside>
<div id="sidebar" class="nav-collapse">
<!-- sidebar menu start-->
<div class="leftside-navigation">
<ul class="sidebar-menu" id="nav-accordion">
<li>
<a href="javascript:;">
<i class="fa fa-dashboard"></i>
<span>Dashboard</span>
</a>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-laptop"></i>
<span>Station</span>
</a>
<ul class="sub">
</ul>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-book"></i>
<span>Documentation</span>
</a>
<ul class="sub">
</ul>
</li>
<li>
<a href="javascript:;">
<i class="fa fa-bullhorn"></i>
<span>Alert</span>
</a>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-th"></i>
<span>Data</span>
</a>
<ul class="sub">
</ul>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class="fa fa-envelope"></i>
<span>Mail </span>
</a>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class=" fa fa-bar-chart-o"></i>
<span>Charts</span>
</a>
</li>
<li class="sub-menu">
<a href="javascript:;">
<i class=" fa fa-bar-chart-o"></i>
<span>Maps</span>
</a>
</li>
</ul></div>
<!-- sidebar menu end-->
</div>
</aside>
<!--sidebar end-->
<!--main content start-->
<section id="main-content">
<section class="wrapper">
<div>
<div><p>STATION: 1</p><p>SENSOR: OSA 1</p><p><img src="images/geo.png"> POSITION: RENDE lat: 39.343495 lon: 16.194757</p></div>
</div>
<!-- page start-->
<div class="row">
<div class="col-sm-12">
<section class="panel">
<header class="panel-heading">
Sensors Data: Brightness
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
<a href="javascript:;" class="fa fa-cog"></a>
<a href="javascript:;" class="fa fa-times"></a>
</span>
</header>
<div class="panel-body" align="center">
<div class="indicator">
<table class="table table-bordered">
<tr>
<td><canvas id="brightness"></canvas></td>
<td><table>
<tr>
<td><img src="images/bulb.png"></td>
<td style="width:200px">Brightness Val</td>
<td><div class="value" id="brightness_val">0</div></td>
</tr>
<tr>
<td> </td>
<td style="width:200px">Avg</td>
<td><div class="value" id="brightness_avg">0</div></td>
</tr>
<tr>
<td> </td>
<td style="width:200px">Min</td>
<td><div class="value" id="brightness_min">0</div></td>
</tr>
<tr>
<td> </td>
<td style="width:200px">Max</td>
<td><div class="value" id="brightness_max">0</div></td>
</tr>
</table></td>
</tr>
</table>
</div>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<section class="panel">
<header class="panel-heading">
Sensors Data: Temperature
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
<a href="javascript:;" class="fa fa-cog"></a>
<a href="javascript:;" class="fa fa-times"></a>
</span>
</header>
<div class="panel-body" align="center">
<div style="float:left;width:330px;">
<!-- <canvas id="temperature"></canvas>
<div class="value" id="temperature_val">0</div>
<div class="value" id="temperature_avg">0</div>
<div class="value" id="temperature_min">0</div>
<div class="value" id="temperature_max">0</div> -->
<table class="table table-bordered">
<tr>
<td><canvas id="temperature"></canvas></td>
<td><table>
<tr>
<td><img src="images/temp.png"></td>
<td style="width:200px">Temperature Val</td>
<td><div class="value" id="temperature_val">0</div></td>
</tr>
<tr>
<td></td>
<td style="width:200px" >Avg</td>
<td> <div class="value" id="temperature_avg">0</div></td>
</tr>
<tr>
<td></td>
<td style="width:200px">Min</td>
<td><div class="value" id="temperature_min">0</div></td>
</tr>
<tr>
<td></td>
<td style="width:200px">Max</td>
<td><div class="value" id="temperature_max">0</div></td>
</tr>
</table></td>
</tr>
</table>
</div>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<section class="panel">
<header class="panel-heading">
Sensors Data: Humidity
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
<a href="javascript:;" class="fa fa-cog"></a>
<a href="javascript:;" class="fa fa-times"></a>
</span>
</header>
<div class="panel-body" align="center">
<div style="float:left;width:330px;">
<!-- <canvas id="humidity"></canvas>
<div class="value" id="humidity_val">0</div>
<div class="value" id="humidity_avg">0</div>
<div class="value" id="humidity_min">0</div>
<div class="value" id="humidity_max">0</div>
</div>
-->
<table class="table table-bordered">
<tr>
<td> <canvas id="humidity"></canvas></td>
<td><table>
<tr>
<td><img src="images/hum.png"></td>
<td>Humidity Val</td>
<td><div class="value" id="humidity_val">0</div></td>
</tr>
<tr>
<td></td>
<td>Avg</td>
<td> <div class="value" id="humidity_avg">0</div></td>
</tr>
<tr>
<td></td>
<td>Min</td>
<td> <div class="value" id="humidity_min">0</div></td>
</tr>
<tr>
<td></td>
<td>Max</td>
<td><div class="value" id="humidity_max">0</div></td>
</tr>
</table></td>
</tr>
</table>
</div>
</section>
</div>
</div>
<!-- page end-->
</section>
</section>
<!--main content end-->
<!--right sidebar start-->
<div class="right-sidebar">
<div class="search-row">
<input type="text" placeholder="Search" class="form-control">
</div>
<div class="right-stat-bar">
<ul class="right-side-accordion">
<li class="widget-collapsible">
<a href="#" class="head widget-head terques-bg active clearfix">
<span class="pull-left">contact online (5)</span>
<span class="pull-right widget-collapse"><i class="ico-minus"></i></span>
</a>
</div>
</div>
<!--right sidebar end-->
</section>
<!-- Placed js at the end of the document so the pages load faster -->
<!--Core js-->
<script src="js/jquery.js"></script>
<script src="bs3/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="js/jquery.dcjqaccordion.2.7.js"></script>
<script src="js/jquery.scrollTo.min.js"></script>
<script src="js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
<script src="js/jquery.nicescroll.js"></script>
<!--Easy Pie Chart-->
<script src="js/easypiechart/jquery.easypiechart.js"></script>
<!--Sparkline Chart-->
<script src="js/sparkline/jquery.sparkline.js"></script>
<!--jQuery Flot Chart-->
<script src="js/flot-chart/jquery.flot.js"></script>
<script src="js/flot-chart/jquery.flot.tooltip.min.js"></script>
<script src="js/flot-chart/jquery.flot.resize.js"></script>
<script src="js/flot-chart/jquery.flot.pie.resize.js"></script>
<!--common script init for all pages-->
<script src="js/scripts.js"></script>
<script type="text/javascript">
var opts = {
lines : 12, // The number of lines to draw
angle : 0.15, // The length of each line
lineWidth : 0.44, // The line thickness
pointer : {
length : 0.5, // The radius of the inner circle
strokeWidth : 0.035, // The rotation offset
color : '#000000' // Fill color
},
limitMax : 'false', // If true, the pointer will not go past the end of the gauge
colorStart : '#6FADCF', // Colors
colorStop : '#FF8000', // just experiment with them
strokeColor : '#E0E0E0', // to see which ones work best for you
generateGradient : true
};
var lightCanvas = document.getElementById('brightness');
var tempCanvas = document.getElementById('temperature');
var humCanvas = document.getElementById('humidity');
var lightGauge = new Gauge(lightCanvas).setOptions(opts);
var tempGauge = new Gauge(tempCanvas).setOptions(opts);
var humGauge = new Gauge(humCanvas).setOptions(opts);
var indicators = [lightGauge, tempGauge, humGauge];
indicators.forEach(function(gauge) {
gauge.maxValue = 3000; // set max gauge value
gauge.animationSpeed = 32; // set animation speed (32 is default value)
gauge.set(0); // set actual value
});
update_gauge = function(gauge, span, value){
gauge.set(value*10);
span.text(value);
};
update = function(values){
var brightness_new ;
if (values.brightness > 300) {
brightness_new = 0;
}
else {
brightness_new = (300-values.brightness);
}
update_gauge(lightGauge, $('#brightness_val'), brightness_new);
update_gauge(tempGauge, $('#temperature_val'), values.temperature);
update_gauge(humGauge, $('#humidity_val'), values.humidity);
};
get_values = function(){
$.ajax({
url: "http://10.186.64.209:5000/v2/nodo1/OSA1",
type: "GET",
dataType: "json",
success: function (response) {
values = response;
update(values);
},
error: function (xhr, status) {
alert('errore');
}
});
}
get_values();
query_mongo = function(){
$.ajax({
url: "http://sensornet.apphb.com/api/values/1",
type: "GET",
dataType: "json",
success: function (response) {
mongo = JSON.parse(response);
mongo.values.forEach(function(elem){
var avg = "#" + elem.type + "_avg";
var min = "#" + elem.type + "_min";
var max = "#" + elem.type + "_max";
$(avg).text(elem.Avg);
$(min).text(elem.Min);
$(max).text(elem.Max);
});
},
error: function (xhr, status) {
alert('errore');
}
});
}
query_mongo();
setInterval(get_values, 3000);
setInterval(query_mongo, 60000);
</script>
</body>
</html>