UI changes and hiding sandbox in case no configuration is found

master
Steve L. Nyemba 8 years ago
parent 00c19c2dd7
commit 315f5ae32d

@ -83,11 +83,6 @@ def procs(id):
# @TODO: # @TODO:
# Compile a report here that will be sent to the mailing list # 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: except Exception, e:
print e print e
@ -156,7 +151,11 @@ def requirements():
@app.route('/dashboard') @app.route('/dashboard')
def dashboard(): def dashboard():
context = PARAMS['context'] 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 This function is designed to trigger learning for anomaly detection

@ -287,7 +287,10 @@ monitor.sandbox.init = function () {
var r = JSON.parse(x.responseText) var r = JSON.parse(x.responseText)
if (r.length > 0) { if (r.length > 0) {
jx.dom.show('sandbox')
monitor.sandbox.render(r); monitor.sandbox.render(r);
} else {
jx.dom.hide('sandbox')
} }
}) })
} }
@ -367,8 +370,33 @@ monitor.folders.init = function () {
monitor.folders.render.init(data) 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 = {}
monitor.folders.render.init = function (data) { monitor.folders.render.init = function (data) {
jx.dom.set.attribute('folder_search','data',data)
monitor.folders.render.summary(data) monitor.folders.render.summary(data)
} }
monitor.folders.show = {} monitor.folders.show = {}
@ -493,7 +521,7 @@ monitor.folders.render.summary = function (data) {
// @TODO Add the units in days just in case // @TODO Add the units in days just in case
options.autoload = true options.autoload = true
options.fields = [ 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: 'name', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"},
{ name: "summary.size", type: "number", title: "Folder Size", type: "number", headercss: "small bold" }, { name: "summary.size", type: "number", title: "Folder Size", type: "number", headercss: "small bold" },

@ -25,6 +25,10 @@
}) })
</script> </script>
<body> <body>
<div class="border-bottom caption" style="height:42px">
<div class="">{{title}}</div>
<div class="small" style="margin:4px">The Phi Technology LLC</div>
</div>
<div class="left small border-right" style="width:12%; height:60%"> <div class="left small border-right" style="width:12%; height:60%">
<div id="menu" class="menu"></div> <div id="menu" class="menu"></div>
</div> </div>
@ -67,7 +71,7 @@
<div style="height:270px; margin-top:10px"> <div style="height:270px; margin-top:10px">
<div id="trends_chart" class="small grid" style="height:250px"></div> <div id="trends_chart" class="small grid" style="height:250px"></div>
</div> </div>
<div class="border-top" style="padding:4px;"> <div id="sandbox" class="border-top" style="padding:4px;">
<div style="height:48px"> <div style="height:48px">
<b>Python Virtual Environment Analysis</b> <b>Python Virtual Environment Analysis</b>
<div id="inspect_sandbox" class="right button border" style="display:none" onclick="monitor.sandbox.init()">Inspect</div> <div id="inspect_sandbox" class="right button border" style="display:none" onclick="monitor.sandbox.init()">Inspect</div>
@ -82,9 +86,14 @@
<div style="margin-top:10px"> <div style="margin-top:10px">
<div id="folder_summary"> <div id="folder_summary">
<div class=""> <div class="">
<div class="bold">Smart Folder Analysis/Monitoring</div> <div class="bold">Smart Folder Analysis/Monitoring</div>
<div class="small">Powered By Machine Learning</div> <div class="small">Powered By Machine Learning</div>
</div>
<div class=" border" style="margin-top:4px; padding:2px; height:34px">
<i class="fa fa-search left" style="margin:4px; padding:4px; position:absolute; color:gray"></i>
<input id="folder_search" type="text" class="small left" placeholder="hostname" style="width:92%; padding-left:22px" onkeyup="monitor.folders.search.init()"/>
<i class="fa fa-trash right action" style="margin:4px; padding:4px; color:maroon" onclick="monitor.folders.search.reset()"></i>
</div> </div>
<div style="margin-top:10px; height:150px"> <div style="margin-top:10px; height:150px">
<div id="gridfolders"></div> <div id="gridfolders"></div>

Loading…
Cancel
Save