Filter analytics according to device types

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

@ -36,53 +36,65 @@
</div> </div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div class="row margin-double"> <div id="div-temperatureData">
<div> <div class="row margin-double">
<h2 class="grey ">Temperature</h2> <div>
<h2 class="grey ">Temperature</h2>
<hr>
<div id="canvas-wrapper1">No data available...</div>
</div>
<hr> <hr>
<div id="canvas-wrapper1">No data available...</div>
</div> </div>
<hr>
</div> </div>
<div class="row margin-double"> <div id="div-lightData">
<div> <div class="row margin-double">
<h2 class="grey ">Light</h2> <div>
<h2 class="grey ">Light</h2>
<hr>
<div id="canvas-wrapper2">No data available...</div>
</div>
<hr> <hr>
<div id="canvas-wrapper2">No data available...</div>
</div> </div>
<hr>
</div> </div>
<div class="row margin-double"> <div id="div-motionData">
<div> <div class="row margin-double">
<h2 class="grey ">Motion</h2> <div>
<h2 class="grey ">Motion</h2>
<hr>
<div id="canvas-wrapper3">No data available...</div>
</div>
<hr> <hr>
<div id="canvas-wrapper3">No data available...</div>
</div> </div>
<hr>
</div> </div>
<div class="row margin-double"> <div id="div-sonarData">
<div> <div class="row margin-double">
<h2 class="grey ">Sonar</h2> <div>
<h2 class="grey ">Sonar</h2>
<hr>
<div id="canvas-wrapper4">No data available...</div>
</div>
<hr> <hr>
<div id="canvas-wrapper4">No data available...</div>
</div> </div>
<hr>
</div> </div>
<div class="row margin-double"> <div id="div-fanData">
<div> <div class="row margin-double">
<h2 class="grey ">Fan Status</h2> <div>
<h2 class="grey ">Fan Status</h2>
<hr>
<div id="canvas-wrapper5">No data available...</div>
</div>
<hr> <hr>
<div id="canvas-wrapper5">No data available...</div>
</div> </div>
<hr>
</div> </div>
<div class="row margin-double"> <div id="div-bulbData">
<div> <div class="row margin-double">
<h2 class="grey ">Bulb Status</h2> <div>
<h2 class="grey ">Bulb Status</h2>
<hr>
<div id="canvas-wrapper6">No data available...</div>
</div>
<hr> <hr>
<div id="canvas-wrapper6">No data available...</div>
</div> </div>
<hr>
</div> </div>
</div> </div>
</div> </div>

@ -148,22 +148,52 @@ function updateGraphs(stats) {
console.log(stats); console.log(stats);
var temperatureData = stats['temperatureData']; var temperatureData = stats['temperatureData'];
updateTemperatureGraph(convertStatsToGraphData(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));
}else{
$('#div-temperatureData').html("");
}
var lightData = stats['lightData']; var lightData = stats['lightData'];
updateLightGraph(convertStatsToGraphData(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));
}else{
$('#div-lightData').html("");
}
var motionData = stats['motionData']; var motionData = stats['motionData'];
updateMotionGraph(convertStatsToGraphData(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));
}else{
$('#div-motionData').html("");
}
var sonarData = stats['sonarData']; var sonarData = stats['sonarData'];
updateSonarGraph(convertStatsToGraphData(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));
}else{
$('#div-sonarData').html("");
}
var fanData = stats['fanData']; var fanData = stats['fanData'];
updateFanGraph(convertStateStatsToGraphData(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));
}else{
$('#div-fanData').html("");
}
var bulbData = stats['bulbData']; var bulbData = stats['bulbData'];
updateBulbGraph(convertStateStatsToGraphData(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));
}else{
$('#div-bulbData').html("");
}
scaleGraphs(); scaleGraphs();
} }

Loading…
Cancel
Save