From 315f5ae32d2e9ecbfdf6848fcc5cad73206bd7fc Mon Sep 17 00:00:00 2001 From: "Steve L. Nyemba" Date: Sun, 12 Feb 2017 12:21:37 -0600 Subject: [PATCH] UI changes and hiding sandbox in case no configuration is found --- src/api/index.py | 11 +++++------ src/api/static/js/dashboard.js | 32 ++++++++++++++++++++++++++++++-- src/api/templates/dashboard.html | 13 +++++++++++-- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/api/index.py b/src/api/index.py index f703a02..8db1b12 100644 --- a/src/api/index.py +++ b/src/api/index.py @@ -83,11 +83,6 @@ def procs(id): # @TODO: # Compile a report here that will be sent to the mailing list # - if row['status'] == 'crash' : - print row['label'],' *** ',row['status'] - #for row in r[label] : - #yo = ML.Extract(['status'],row) - #xo = ML.Extract(['cpu_usage','memory_usage'],row) except Exception, e: print e @@ -156,7 +151,11 @@ def requirements(): @app.route('/dashboard') def dashboard(): context = PARAMS['context'] - return render_template('dashboard.html',context=context) + if 'title' in PARAMS : + title = PARAMS['title'] + else: + title = 'Zulu Watch Tower' + return render_template('dashboard.html',context=context,title=title) """ This function is designed to trigger learning for anomaly detection diff --git a/src/api/static/js/dashboard.js b/src/api/static/js/dashboard.js index eaa75d6..7ae7494 100644 --- a/src/api/static/js/dashboard.js +++ b/src/api/static/js/dashboard.js @@ -286,8 +286,11 @@ monitor.sandbox.init = function () { var r = JSON.parse(x.responseText) - if (r.length > 0){ + if (r.length > 0) { + jx.dom.show('sandbox') monitor.sandbox.render(r); + } else { + jx.dom.hide('sandbox') } }) } @@ -367,8 +370,33 @@ monitor.folders.init = function () { monitor.folders.render.init(data) }) } +monitor.folders.search = {} +monitor.folders.search.reset = function () { + jx.dom.set.value('folder_search', '') + var data = jx.dom.get.attribute('folder_search', 'data') + monitor.folders.render.summary(data) + +} +monitor.folders.search.init = function(){ + var term = jx.dom.get.value('folder_search') + var data = jx.dom.get.attribute('folder_search', 'data') + + term = term.replace(/\x32/g,'') + if (term.length == 0) { + monitor.folders.render.summary(data) + } else if (term.length > 3) { + + data = jx.utils.patterns.visitor(data, function (row) { + if (row.id.match(term)) { + return row + } + }) + monitor.folders.render.summary(data) + } +} monitor.folders.render = {} monitor.folders.render.init = function (data) { + jx.dom.set.attribute('folder_search','data',data) monitor.folders.render.summary(data) } monitor.folders.show = {} @@ -493,7 +521,7 @@ monitor.folders.render.summary = function (data) { // @TODO Add the units in days just in case options.autoload = true options.fields = [ - { name: 'id', type: 'text', title: "Context", headercss: "small bold", css: "small"}, + { name: 'name', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"}, { name: "summary.size", type: "number", title: "Folder Size", type: "number", headercss: "small bold" }, diff --git a/src/api/templates/dashboard.html b/src/api/templates/dashboard.html index c3641f2..1478cc6 100644 --- a/src/api/templates/dashboard.html +++ b/src/api/templates/dashboard.html @@ -25,6 +25,10 @@ }) +
+
{{title}}
+
The Phi Technology LLC
+
@@ -67,7 +71,7 @@
-
+
Python Virtual Environment Analysis @@ -82,9 +86,14 @@
+
Smart Folder Analysis/Monitoring
Powered By Machine Learning
- +
+
+ + +