Filter analytics according to device types

application-manager-new
charithag 10 years ago
parent 4bd39ed385
commit d04f8a22b7

@ -36,6 +36,7 @@
</div> </div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div id="div-temperatureData">
<div class="row margin-double"> <div class="row margin-double">
<div> <div>
<h2 class="grey ">Temperature</h2> <h2 class="grey ">Temperature</h2>
@ -44,6 +45,8 @@
</div> </div>
<hr> <hr>
</div> </div>
</div>
<div id="div-lightData">
<div class="row margin-double"> <div class="row margin-double">
<div> <div>
<h2 class="grey ">Light</h2> <h2 class="grey ">Light</h2>
@ -52,6 +55,8 @@
</div> </div>
<hr> <hr>
</div> </div>
</div>
<div id="div-motionData">
<div class="row margin-double"> <div class="row margin-double">
<div> <div>
<h2 class="grey ">Motion</h2> <h2 class="grey ">Motion</h2>
@ -60,6 +65,8 @@
</div> </div>
<hr> <hr>
</div> </div>
</div>
<div id="div-sonarData">
<div class="row margin-double"> <div class="row margin-double">
<div> <div>
<h2 class="grey ">Sonar</h2> <h2 class="grey ">Sonar</h2>
@ -68,6 +75,8 @@
</div> </div>
<hr> <hr>
</div> </div>
</div>
<div id="div-fanData">
<div class="row margin-double"> <div class="row margin-double">
<div> <div>
<h2 class="grey ">Fan Status</h2> <h2 class="grey ">Fan Status</h2>
@ -76,6 +85,8 @@
</div> </div>
<hr> <hr>
</div> </div>
</div>
<div id="div-bulbData">
<div class="row margin-double"> <div class="row margin-double">
<div> <div>
<h2 class="grey ">Bulb Status</h2> <h2 class="grey ">Bulb Status</h2>
@ -86,6 +97,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{{/zone}} {{/zone}}
{{#zone "bottomLibJs"}} {{#zone "bottomLibJs"}}
<script src="{{self.publicURL}}/js/d3.v3.js"></script> <script src="{{self.publicURL}}/js/d3.v3.js"></script>

@ -148,22 +148,52 @@ function updateGraphs(stats) {
console.log(stats); console.log(stats);
var temperatureData = stats['temperatureData']; var temperatureData = stats['temperatureData'];
if (typeof temperatureData != 'undefined'){
$('#div-temperatureData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Temperature</h2><hr><div id='canvas-wrapper1'></div></div><hr></div>");
updateTemperatureGraph(convertStatsToGraphData(temperatureData)); updateTemperatureGraph(convertStatsToGraphData(temperatureData));
}else{
$('#div-temperatureData').html("");
}
var lightData = stats['lightData']; var lightData = stats['lightData'];
if (typeof lightData != 'undefined'){
$('#div-lightData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Light</h2><hr><div id='canvas-wrapper2'></div></div><hr></div>");
updateLightGraph(convertStatsToGraphData(lightData)); updateLightGraph(convertStatsToGraphData(lightData));
}else{
$('#div-lightData').html("");
}
var motionData = stats['motionData']; var motionData = stats['motionData'];
if (typeof motionData != 'undefined'){
$('#div-motionData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Motion</h2><hr><div id='canvas-wrapper3'></div></div><hr></div>");
updateMotionGraph(convertStatsToGraphData(motionData)); updateMotionGraph(convertStatsToGraphData(motionData));
}else{
$('#div-motionData').html("");
}
var sonarData = stats['sonarData']; var sonarData = stats['sonarData'];
if (typeof sonarData != 'undefined'){
$('#div-sonarData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Sonar</h2><hr><div id='canvas-wrapper4'></div></div><hr></div>");
updateSonarGraph(convertStatsToGraphData(sonarData)); updateSonarGraph(convertStatsToGraphData(sonarData));
}else{
$('#div-sonarData').html("");
}
var fanData = stats['fanData']; var fanData = stats['fanData'];
if (typeof fanData != 'undefined'){
$('#div-fanData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Fan Status</h2><hr><div id='canvas-wrapper5'></div></div><hr></div>");
updateFanGraph(convertStateStatsToGraphData(fanData)); updateFanGraph(convertStateStatsToGraphData(fanData));
}else{
$('#div-fanData').html("");
}
var bulbData = stats['bulbData']; var bulbData = stats['bulbData'];
if (typeof bulbData != 'undefined'){
$('#div-bulbData').html("").html("<div class='row margin-double'><div><h2 class='grey'>Bulb Status</h2><hr><div id='canvas-wrapper6'></div></div><hr></div>");
updateBulbGraph(convertStateStatsToGraphData(bulbData)); updateBulbGraph(convertStateStatsToGraphData(bulbData));
}else{
$('#div-bulbData').html("");
}
scaleGraphs(); scaleGraphs();
} }

Loading…
Cancel
Save