ui for forlder monitoring

master
Steve L. Nyemba 8 years ago
parent e60bfae295
commit b3f3d38ef9

@ -423,6 +423,8 @@ monitor.folders.render.summary = function (data) {
} }
options.rowClick = function(args){ options.rowClick = function(args){
var item = args.item var item = args.item
var yu = jx.math.mean(jx.utils.vector('0', item.details.age))
var yr = jx.math.sd(jx.utils.vector('0', item.details.age))
age = jx.utils.patterns.visitor(item.details.age, function (row) { age = jx.utils.patterns.visitor(item.details.age, function (row) {
return {y:row[0],x:row[1]} return {y:row[0],x:row[1]}
}) })
@ -436,7 +438,7 @@ monitor.folders.render.summary = function (data) {
options.autoload = true options.autoload = true
options.fields = [ options.fields = [
{ name: 'label', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"}, { name: 'label', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"},
{ name: "summary.age", type: "number", title: "Oldest File (Days)", headercss: "small bold" , width:'64px'}, { name: "summary.age", type: "number", title: "Age (Days)", headercss: "small bold" , width:'64px'},
{ name: "summary.size", type: "number", title: "Size (MB)", type: "number", headercss: "small bold" }, { name: "summary.size", type: "number", title: "Size (MB)", type: "number", headercss: "small bold" },
{ name: "summary.count", type: "number", title: "File Count", type: "number", headercss: "small bold" } { name: "summary.count", type: "number", title: "File Count", type: "number", headercss: "small bold" }
] ]

@ -19,7 +19,7 @@
<title>iMonitor</title> <title>iMonitor</title>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
// monitor.processes.fetch() monitor.processes.fetch()
monitor.folders.init() monitor.folders.init()
}) })
</script> </script>

@ -285,7 +285,8 @@ class FileWatch(Analysis):
if os.path.exists(folder): if os.path.exists(folder):
xo_raw = self.evaluate(folder) xo_raw = self.evaluate(folder)
xo = np.array(ML.Extract(['size','age'],xo_raw)) xo = np.array(ML.Extract(['size','age'],xo_raw))
xo = {"label":folder,"details":xo_raw,"summary":{"size":round(np.sum(xo[:,0]),2),"age":np.max(xo[:,1]),"count":len(xo[:,1])}}
xo = {"label":folder,"details":xo_raw,"summary":{"size":round(np.mean(xo[:,0]),2),"age":round(np.mean(xo[:,1]),2),"count":len(xo[:,1])}}
xo['day'] = now.day xo['day'] = now.day
xo['month'] = now.month xo['month'] = now.month
xo['year'] = now.year xo['year'] = now.year

@ -47,12 +47,17 @@ class ML:
def CleanupName(value) : def CleanupName(value) :
return value.replace('$','').replace('.+','') return value.replace('$','').replace('.+','')
@staticmethod @staticmethod
def distribution(xo,lock) : def distribution(xo,lock,scale=False) :
lock.acquire() lock.acquire()
d = [] d = []
m = {} m = {}
if scale :
xu = np.mean(xo)
sd = np.sqrt(np.var(xo))
for xi in xo : for xi in xo :
value = round(xi,2) value = round(xi,2)
if scale :
value = round((value - xu)/sd,2)
id = str(value) id = str(value)
if id in m : if id in m :
index = m[id] index = m[id]

Loading…
Cancel
Save