bug fix: dashboard handling

v2.2
Steve Nyemba 1 week ago
parent c176e412a9
commit b932ff8ba8

@ -267,7 +267,6 @@ def _POST_CMSPage(app_id,key):
# _html = e.render(**_args) # _html = e.render(**_args)
if 'read?uri=' in _uri or 'download?doc=' in _uri : if 'read?uri=' in _uri or 'download?doc=' in _uri :
_uri = _uri.split('=')[1] _uri = _uri.split('=')[1]
print ([' ## ',_uri,'\n',request.headers['uri']])
_args = _route.render(_uri,_id,_getId(app_id,key)) #session.get(app_id,'main')) _args = _route.render(_uri,_id,_getId(app_id,key)) #session.get(app_id,'main'))
return _args[_id],200 return _args[_id],200
# return _html,200 # return _html,200

@ -19,12 +19,14 @@ monitor.render.table_list = function (_data){
jx.dom.set.value('table.info',_data.about) jx.dom.set.value('table.info',_data.about)
jx.dom.set.value('tables','') jx.dom.set.value('tables','')
jx.dom.append('tables',nodes) jx.dom.append('tables',nodes)
nodes.childNodes[0].click()
} }
monitor.render.data = function(_data){ monitor.render.data = function(_data){
jx.dom.set.value('dashboard','' ) jx.dom.set.value('dashboard','' )
_apex = [] _apex = []
Object.keys(_data).forEach(_key=>{ Object.keys(_data).forEach(_key=>{
_board = jx.dom.get.instance('DIV') _board = jx.dom.get.instance('DIV')
@ -37,14 +39,16 @@ monitor.render.data = function(_data){
var _id = Object.keys(_entry)[0] var _id = Object.keys(_entry)[0]
_itemPane = jx.dom.get.instance('DIV') _itemPane = jx.dom.get.instance('DIV')
_frame = jx.dom.get.instance('DIV')
// _itemPane.innerHTML = '<h3>'+_id+'</h3>',_entry[_id] // _itemPane.innerHTML = '<h3>'+_id+'</h3>',_entry[_id]
// //
// Making title .... // Making title ....
var _titleDiv = $('<div class="title"><div class="large-text">:title</div><div class="small">:about</div></div>'.replace(/:title/,_id).replace(/:about/,_entry[_id].about)) var _titleDiv = $('<div class="board-title"><div class="large-text">:title</div><div class="small">:about</div></div>'.replace(/:title/,_id).replace(/:about/,_entry[_id].about))
console.log(_titleDiv)
$(_itemPane).append(_titleDiv) // $(_itemPane).append(_titleDiv)
$(_frame).append(_titleDiv)
_itemPane.className = _entry[_id].css _itemPane.className = _entry[_id].css
_entry[_id].charts.forEach(_chartItem=>{ _entry[_id].charts.forEach(_chartItem=>{
if (_chartItem.type == 'scalar') { if (_chartItem.type == 'scalar') {
_chart = jx.dom.get.instance('DIV') _chart = jx.dom.get.instance('DIV')
@ -62,9 +66,11 @@ monitor.render.data = function(_data){
_itemPane.appendChild(_chart) _itemPane.appendChild(_chart)
}) })
_frame.appendChild(_itemPane)
_frame.className = 'basic-board'
// _itemPane.className = 'board-' + _itemPane.childNodes.length // _itemPane.className = 'board-' + _itemPane.childNodes.length
// _itemPane.className = 'board-' + _itemPane.childNodes.length // _itemPane.className = 'board-' + _itemPane.childNodes.length
jx.dom.append('dashboard',_itemPane) jx.dom.append('dashboard',_frame)
// var _options = _item[_id] // var _options = _item[_id]
}) })
@ -170,7 +176,7 @@ monitor.get = function(table){
} }
if(!qcms){ if(!qcms){
qcms = {} var qcms = {}
} }
var _dashboard = function(_context,_uri){ var _dashboard = function(_context,_uri){
@ -186,7 +192,7 @@ var _dashboard = function(_context,_uri){
http.setHeader('Content-Type','application/json') http.setHeader('Content-Type','application/json')
http.setData(JSON.stringify(_args)) http.setData(JSON.stringify(_args))
http.post(_uri,function(x){ http.post(_uri,function(x){
if(x.readyState == 4 && x.status == 200) if(x.readyState == 4 && x.status == 200){}
}) })
} }
} }

Loading…
Cancel
Save