From 8a937a61f8417084d421d14c90af35a552f2bb57 Mon Sep 17 00:00:00 2001 From: "michael.mead" Date: Sun, 21 Jan 2018 20:34:48 -0600 Subject: [PATCH 1/4] start reset --- requirements.txt | 2 -- src/api/static/js/dashboard.js | 54 ++++++++--------------------- src/api/templates/dashboard.html | 59 ++++++++++++++++---------------- 3 files changed, 45 insertions(+), 70 deletions(-) diff --git a/requirements.txt b/requirements.txt index bf7be19..363ce68 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ aniso8601==1.2.0 -certifi==2017.11.5 chardet==3.0.4 click==6.6 couchdbkit==0.6.5 @@ -23,7 +22,6 @@ MarkupSafe==0.23 ngram==3.3.0 numpy==1.11.3 pika==0.10.0 -pkg-resources==0.0.0 pycparser==2.18 pyOpenSSL==17.3.0 python-dateutil==2.6.0 diff --git a/src/api/static/js/dashboard.js b/src/api/static/js/dashboard.js index 2859b86..d2b7f5d 100755 --- a/src/api/static/js/dashboard.js +++ b/src/api/static/js/dashboard.js @@ -1,12 +1,5 @@ type = ['','info','success','warning','danger']; -function getNode(name){ - var nodeName = {} - nodeName.name = name - console.log('nodename...', nodeName.name) - dashboard.initChartist(nodeName) -} - dashboard = { initPickColor: function(){ $('.pick-class-label').click(function(){ @@ -22,33 +15,16 @@ dashboard = { }); }, - initChartist: function(nodeName){ + initChartist: function(){ var getData = $.get('/1/app/usage/trend'); getData.done(function(results) { var data = JSON.parse(results) - if (typeof nodeName === 'undefined'){ - var node = data['apps@michaels-MBP']; - console.log("undefined nodename.........") - } else { - console.log('this is nodeName...', nodeName) - console.log('this is nodeName.name...', nodeName.name) - var node = data[nodeName.name] - console.log('data.name..', data[name]) - } - var app = node['chrome']; - var cpu = app['cpu']; - var memory_used = app['memory_used']; 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 var dataChart = { 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: [cpu, memory_used, [0,0.1,0.3,0.2,0.4,0.6,0.2], ] // TODO: Check the order, the graph is by index not name. + series: [[1,2,3], [4,5,6], [1,2,3,5], ] // TODO: Check the order, the graph is by index not name. }; dataChartArray = dataChart.series @@ -86,7 +62,7 @@ dashboard = { // cpu and memory -------------------------- var data = { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - series: [cpu, memory_used] + series: [[1,2,3,4], [5,6,7]] }; @@ -111,18 +87,18 @@ dashboard = { Chartist.Line('#chartActivity', data, options, responsiveOptions); - var getStatus = $.get('1/get/summary/app_status'); - getStatus.done(function(results) { - var data = JSON.parse(results) - let getStatusList = [] - getStatusList.push(data.idle) - getStatusList.push(data.crash) - getStatusList.push(data.running) - Chartist.Pie('#chartPreferences', { - labels: getStatusList, - series: getStatusList - },{donut:true}); - }) /// end getStatus + // var getStatus = $.get('1/get/summary/app_status'); + // getStatus.done(function(results) { + // var data = JSON.parse(results) + // let getStatusList = [] + // getStatusList.push(data.idle) + // getStatusList.push(data.crash) + // getStatusList.push(data.running) + // Chartist.Pie('#chartPreferences', { + // labels: getStatusList, + // series: getStatusList + // },{donut:true}); + // }) /// end getStatus }) }, // End chartist function diff --git a/src/api/templates/dashboard.html b/src/api/templates/dashboard.html index 93dc163..27d8ad1 100644 --- a/src/api/templates/dashboard.html +++ b/src/api/templates/dashboard.html @@ -46,39 +46,40 @@ - - - +{# #} +{# #} +{# #} #} {# #}