From 682e20ba9364552b26e04fcbd00e376061bead79 Mon Sep 17 00:00:00 2001 From: Michael Mead Date: Mon, 10 Jul 2017 22:49:51 -0500 Subject: [PATCH] start getting idle,crash,running --- config.json | 8 ++++---- src/api/static/js/dashboard.js | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index 860941b..02f1be0 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "id":"seeker-hacker", + "id":"michaels-MBP", "key":"4q-h8r5-247&!570p=[0v8]x360", "api":"dev.the-phi.com", "delay":10.0, @@ -7,12 +7,12 @@ "class":{"read":"CouchdbReader","write":"CouchdbWriter"}, "args":{"uri":"http://dev.the-phi.com:5984","dbname":"mike-db","uid":"logs"} }, - "procs":["kate","firefox"], + "procs":["mail","safari", "chrome", "terminal"], "folders":["/Users/michaelmead/Downloads"], "actions":{ "folders":{"threshold":"10mb","action":"archive","key":""}, "apps":{"mail":"","safari":"","chrome":"" } } - - + + } diff --git a/src/api/static/js/dashboard.js b/src/api/static/js/dashboard.js index 32d7e59..a037b65 100755 --- a/src/api/static/js/dashboard.js +++ b/src/api/static/js/dashboard.js @@ -20,8 +20,6 @@ dashboard = { var getData = $.get('/1/app/usage/trend'); var appStatus = $.get('/1/app/status?node=apps@seeker-hacker&app=terminal'); console.log('appstatus...', appStatus) - console.log('appstatus statusText...', appStatus.status) - console.log('appstatus responseText...', appStatus.responseText) console.log('getData...', getData); getData.done(function(results) { @@ -57,6 +55,10 @@ dashboard = { } return statusList } + + monitorStatus = function(idle, crash, running){ // TODO: make this async with g.summary at bottom + return idle, crash, running + } // monitoring apps chart var dataChart = { labels: ['9:00AM', '12:00AM', '3:00PM', '6:00PM', '9:00PM', '12:00PM', '3:00AM', '6:00AM'], @@ -201,7 +203,7 @@ dashboard = { for (i in percentage){ percentage[i] = percentage[i].toString()+'%'; } - + console.log("running", running) Chartist.Pie('#chartPreferences', { labels: percentage, series: [1,2,3] @@ -269,6 +271,7 @@ g.summary.factory = function (url,pointer) { r = JSON.parse(r.responseText) pointer(r) console.log(r) + monitorStatus(r.idle, r.crash, r.running) //observer.notify() @@ -285,7 +288,6 @@ g.summary.factory = function (url,pointer) { //observer.notify() } - return object }