diff --git a/.init.sh.un~ b/.init.sh.un~ new file mode 100644 index 0000000..07c1ff0 Binary files /dev/null and b/.init.sh.un~ differ diff --git a/.install.sh.un~ b/.install.sh.un~ new file mode 100644 index 0000000..fcff924 Binary files /dev/null and b/.install.sh.un~ differ diff --git a/src/api/index.py b/src/api/index.py index dd3c1e3..6e19647 100644 --- a/src/api/index.py +++ b/src/api/index.py @@ -82,7 +82,7 @@ def get_nodes(): def get_apps(): """ This function returns the applications for a given node - @param node identifier e.g: apps@zulu.org <--------------------no it doesnt + @param node identifier e.g: apps@zulu.org """ r = [] try: @@ -96,7 +96,6 @@ def get_apps(): return json.dumps(r) - @app.route('/1/get/summary/') def get_summary(id): """ @@ -119,6 +118,8 @@ def get_summary(id): except Exception,e: print (e) return json.dumps(r) + + @app.route("/1/sys/usage/trend") def get_usage_trend(): """ @@ -135,6 +136,7 @@ def get_usage_trend(): print (e) return json.dumps(r) + @app.route("/1/app/usage/trend") def get_usage_detail(): """ @@ -153,6 +155,8 @@ def get_usage_detail(): except Exception,e: print (e) return json.dumps(r) + + @app.route('/1/app/status') def app_status() : """ @@ -178,6 +182,8 @@ def app_status() : print e return json.dumps(r) + + #@app.route('/get/') #def procs(id): #try: @@ -282,7 +288,7 @@ def sandbox(): #headers = {"content-disposition":"attachment; filename=requirements.txt"} #return Response(stream,mimetype='text/plain',headers=headers) -@app.route('/dashboard') +@app.route('/dashboard/') def dashboard(): context = PARAMS['context'] if 'title' in PARAMS : diff --git a/src/api/static/js/dashboard.js b/src/api/static/js/dashboard.js index a3338d1..2859b86 100755 --- a/src/api/static/js/dashboard.js +++ b/src/api/static/js/dashboard.js @@ -1,5 +1,12 @@ 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(){ @@ -15,12 +22,19 @@ dashboard = { }); }, - initChartist: function(){ + initChartist: function(nodeName){ var getData = $.get('/1/app/usage/trend'); - getData.done(function(results) { var data = JSON.parse(results) - var node = data['apps@michaels-MBP']; + 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']; @@ -34,7 +48,7 @@ dashboard = { // 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, [1,2,3,5], ] // TODO: Check the order, the graph is by index not name. + 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. }; dataChartArray = dataChart.series diff --git a/src/api/templates/dashboard.html b/src/api/templates/dashboard.html index edaefe1..61e187a 100644 --- a/src/api/templates/dashboard.html +++ b/src/api/templates/dashboard.html @@ -155,18 +155,9 @@