From 11aaab210f6ae96f64d7d3a892842265acd29a95 Mon Sep 17 00:00:00 2001 From: michael mead Date: Tue, 8 Aug 2017 22:47:25 -0500 Subject: [PATCH] start getting nodename passed to init function --- src/api/index.py | 2 +- src/api/static/js/dashboard.js | 16 +++++++++++++--- src/api/templates/dashboard.html | 19 +++---------------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/api/index.py b/src/api/index.py index dd3c1e3..39b86e7 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: diff --git a/src/api/static/js/dashboard.js b/src/api/static/js/dashboard.js index f1131b3..49b4120 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(){ @@ -17,11 +24,14 @@ dashboard = { initChartist: function(){ var getData = $.get('/1/app/usage/trend'); - function loadDashboard(name){ - console.log('loadDashboard...', name); - } getData.done(function(results) { var data = JSON.parse(results) + // if (typeof nodeName === 'undefined'){ + // console.log("undefined nodename.........") + // } else { + // var node = data[nodeName.name] + // console.log('data.name..', data[name]) + // } var node = data['apps@michaels-MBP']; var app = node['chrome']; var cpu = app['cpu']; diff --git a/src/api/templates/dashboard.html b/src/api/templates/dashboard.html index 402d725..61e187a 100644 --- a/src/api/templates/dashboard.html +++ b/src/api/templates/dashboard.html @@ -155,22 +155,9 @@