bug fixes around new data structures and transport data

master
Steve L. Nyemba 8 years ago
parent ce0c802776
commit e1d9b657d0

@ -155,7 +155,7 @@ def dashboard():
if 'title' in PARAMS :
title = PARAMS['title']
else:
title = 'Zulu Watch Tower'
title = 'Zulu OverWatch'
return render_template('dashboard.html',context=context,title=title)
"""
@ -253,20 +253,23 @@ def get_folders():
d = gReader.read()
if 'folders' in d:
d = d['folders']
r = []
m = {}
for row in d :
index = len(d) - 1
d = d[index]
# m = {}
# for row in d :
key = row.keys()[0]
# key = row.keys()[0]
row = row[key]
if key not in m:
r.append(row)
m[key] = len(r) -1
else:
index = m[key]
r[index] = row
d = r
# row = row[key]
# if key not in m:
# r.append(row)
# m[key] = len(r) -1
# else:
# index = m[key]
# r[index] = row
# d = r
else:
d = []

@ -36,7 +36,16 @@ monitor.processes.init = function (x) {
// Auto start the first item in the menu
// This is designed not to let the user wander or wonder what is going on
//
jx.dom.get.children('menu')[0].click()
var nodes = jx.dom.get.children('menu')
if (nodes.length > 0) {
nodes[0].click()
} else {
//
// We should hide the panes for this
//
jx.dom.hide('apps')
}
setTimeout(monitor.sandbox.init,3000)
}
@ -363,7 +372,7 @@ monitor.folders.init = function () {
var data = []
for (var id in r) {
var item = r[id]
item.id = id
// item.id = id
data = data.concat(item)
}
@ -506,26 +515,26 @@ monitor.folders.render.summary = function (data) {
return 'small'
}
options.rowClick = function(args){
var item = args.item
// var item = args.item
age = jx.utils.patterns.visitor(item.details.age, function (row) {
return {y:row[0],x:row[1]}
})
size = jx.utils.patterns.visitor(item.details.size, function (row) {
return {y:row[0],x:row[1]}
})
// age = jx.utils.patterns.visitor(item.details.age, function (row) {
// return {y:row[0],x:row[1]}
// })
// size = jx.utils.patterns.visitor(item.details.size, function (row) {
// return {y:row[0],x:row[1]}
// })
monitor.folders.render.details(item.name,{age:age,size:size})
// monitor.folders.render.details(item.name,{age:age,size:size})
}
//
// @TODO Add the units in days just in case
options.autoload = true
options.fields = [
{ name: 'id', type: 'text', title: "Host", headercss: "small bold", css: "small"},
{ name: 'label', 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.count", type: "number", title: "File Count", type: "number", headercss: "small bold" }
{ name: "size", type: "number", title: "Folder Size", type: "number", headercss: "small bold" },
{ name: "count", type: "number", title: "File Count", type: "number", headercss: "small bold" }
]
var grid = $('#gridfolders').jsGrid(options) ;

@ -562,23 +562,26 @@ class CouchdbWriter(Couchdb,Writer):
document[label] = []
document[label].append(row)
self.dbase.save_doc(document)
def flush(self,params) :
def flush(self,**params) :
size = params['size']
has_changed = False
document = self.dbase.get(self.uid)
for key in documment:
for key in document:
if key not in ['_id','_rev','_attachments'] :
content = document[key]
else:
content = []
continue
if isinstance(content,list):
index = len(content) - size
content = content[index:]
document[key] = content
else:
document[key] = {}
self.dbase.save_doc(document)
has_changed = True
if has_changed:
self.dbase.save_doc(document)
def archive(self,params=None):
document = self.dbase.get(self.uid)

Loading…
Cancel
Save