get graphs back up

master
michael mead 7 years ago
parent ad8e0f011e
commit 591dd5f48f

@ -20,19 +20,27 @@ dashboard = {
getData.done(function(results) { getData.done(function(results) {
var data = JSON.parse(results) var data = JSON.parse(results)
var app = data['Chrome']; var node = data['apps@michaels-MBP'];
var app = node['chrome'];
var cpu = app['cpu'];
var memory_used = app['memory_used'];
console.log('data...',data) console.log('data...',data)
console.log('node...',node)
console.log('app...',app)
console.log('cpu...',cpu)
console.log('memory_used...', memory_used)
// monitoring apps chart // monitoring apps chart
var dataChart = { var dataChart = {
labels: ['9:00AM', '12:00AM', '3:00PM', '6:00PM', '9:00PM', '12:00PM', '3:00AM', '6:00AM'], labels: ['24','23','22','21','20','19','18','17','16','15','14','13','12','11','10','9','8','7','6','5','4','3','2','1' ],
series: [app.memory_used, app.cpu, ] // TODO: Check the order, the graph is by index not name. series: [cpu, memory_used, [1,2,3,50], ] // TODO: Check the order, the graph is by index not name.
}; };
var optionsChart = { var optionsChart = {
lineSmooth: false, lineSmooth: false,
low: 0, low: 0,
high: 100, high: 10,
showArea: true, showArea: true,
height: "245px", height: "245px",
axisX: { axisX: {
@ -60,7 +68,7 @@ dashboard = {
// cpu and memory -------------------------- // cpu and memory --------------------------
var data = { var data = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
series: [app.cpu, app.memory_used] series: [cpu, memory_used]
}; };

@ -79,7 +79,7 @@
] ]
jx.utils.patterns.observer(lobservers,"init") jx.utils.patterns.observer(lobservers,"init")
//dashboard.initChartist(); dashboard.initChartist();
}); });
</script> </script>
@ -303,8 +303,8 @@
<div class="chart-legend"> <div class="chart-legend">
<!-- confirm these three are right with new API. --> <!-- confirm these three are right with new API. -->
<i class="fa fa-circle text-info"></i> cpu usage <i class="fa fa-circle text-info"></i> cpu usage
<i class="fa fa-circle text-danger"></i> memory usage <i class="fa fa-circle text-warning"></i> memory used
<i class="fa fa-circle text-warning"></i> memory available <i class="fa fa-circle text-danger"></i> available line
</div> </div>
<hr> <hr>
<div class="stats"> <div class="stats">

Loading…
Cancel
Save