Merge pull request 'v2.2' (#16) from v2.2 into master

Reviewed-on: cloud/cms#16
master
Steve L. Nyemba 6 days ago
commit f1bb0646e7

@ -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

@ -12,8 +12,19 @@
background-image: linear-gradient(to bottom, #ffffff, #f3f3f3); background-image: linear-gradient(to bottom, #ffffff, #f3f3f3);
} }
.dashboard .basic-board {
display:grid;
grid-template-rows: 60px calc(100% - 60px);
grid-template-columns: 100%;
gap: 10px;
padding:8px;
align-content: center;
}
.dashboard .scalar { .dashboard .scalar {
display:grid; grid-template-rows:auto auto; gap:4px; align-items: center; align-content: center;} display:grid; grid-template-rows:auto auto; gap: 10px; align-items: center; align-content: center;}
.dashboard .scalar .value {font-size:40px; font-family: courier; font-weight: bold;} .dashboard .scalar .value {font-size:40px; font-family: courier; font-weight: bold;}
.dashboard .scalar .label {font-size:10px; text-transform: uppercase;} .dashboard .scalar .label {font-size:10px; text-transform: uppercase;}
@ -21,16 +32,16 @@
.apexcharts-title-text { .apexcharts-title-text {
text-transform: capitalize; text-transform: capitalize;
} }
.dashboard .title {grid-column:1 / span 4; text-transform:capitalize; padding:4px;} .dashboard .board-title {grid-column:1 / span 4; text-transform:capitalize; padding:4px;}
.scalar-pane { text-align: center; .scalar-pane { text-align: center;
;} ;}
.board-10{ .board-10{
display:grid; display:grid;
grid-template-columns: calc(100% - 150px) 150px; gap:4px; grid-template-columns: calc(100% - 125px) 125px; gap: 10px;
} }
.board-10 .scalar-pane { display:grid; gap:4px; .board-10 .scalar-pane { display:grid; gap: 10px;
} }
.board-10 .scalar-pane .scalar {border-top:1px solid #d3d3d3} .board-10 .scalar-pane .scalar {border-top:1px solid #d3d3d3}
@ -44,32 +55,32 @@
.board-110 { .board-110 {
display:grid; display:grid;
grid-template-columns: 2fr 2fr 150px; grid-template-columns: 2fr 2fr 150px;
gap:4px; gap: 10px;
} }
.board-110 .scalar-pane{display:grid;} .board-110 .scalar-pane{display:grid;}
.board-110-2 { .board-110-2 {
display:grid; display:grid;
grid-template-columns: 2fr 2fr; grid-template-columns: 2fr 2fr;
gap:4px; gap: 10px;
} }
.board-110-2 .scalar-pane {grid-row:3; grid-column: 2; .board-110-2 .scalar-pane {grid-row:3; grid-column: 2;
display: grid; display: grid;
grid-template-columns: 50% 50%; gap:4px;} grid-template-columns: 50% 50%; gap: 10px;}
.board-110-2 .scalar-pane > :nth-child(even){ border-left:1px solid #d3d3d3;} .board-110-2 .scalar-pane > :nth-child(even){ border-left:1px solid #d3d3d3;}
.board-100 { .board-100 {
display:grid; display:grid;
grid-template-columns: 2fr 1fr 1fr; gap:4px; grid-template-columns: 2fr 1fr 1fr; gap: 10px;
} }
.board-100-2 { .board-100-2 {
display:grid; display:grid;
grid-template-columns: 2fr 1fr ; gap:4px; grid-template-columns: 2fr 1fr ; gap: 10px;
} }
.board-100,.board-100-2 .scalar-pane {display:grid; gap:4px;} .board-100,.board-100-2 .scalar-pane {display:grid; gap: 10px;}
.board-100-2 > :nth-child(2){grid-row:2 / span 3} .board-100-2 > :nth-child(1){grid-row:1 / span 2}
/* .board-100-2 :nth-child(3){grid-row:2; grid-column:2} */ .board-100-2 > :nth-child(2){grid-row:1; grid-column:2}
.board-100-2 .scalar-pane {grid-row:3; grid-column: 2 ; display:grid; grid-template-columns: repeat(2, 1fr); } .board-100-2 .scalar-pane {grid-row:2; grid-column: 2 ; display:grid; grid-template-columns: repeat(2, 1fr); }
.board-100-2 .scalar-pane > :nth-child(even){ border-left:1px solid #d3d3d3;} .board-100-2 .scalar-pane > :nth-child(even){ border-left:1px solid #d3d3d3;}

@ -5,7 +5,8 @@
var bootup = {} var bootup = {}
// //
// We implement this function using an observer design pattern // We implement this function using an observer design pattern
bootup.CMSObserver = function(_sysId,_domId,_fileURI){ bootup.CMSObserver = function(_context,_domId,_fileURI){
this._context = _context
this._domId = _domId this._domId = _domId
this._fileURI = _fileURI this._fileURI = _fileURI
this.apply = function (_caller){ this.apply = function (_caller){
@ -14,8 +15,8 @@ bootup.CMSObserver = function(_sysId,_domId,_fileURI){
uri = '/page' uri = '/page'
if (_sysId != '' && sysId != null) { if (this._context != '' && this._context != null) {
uri = sysId + uri uri = this._context + uri
} }
if (window.location.pathname != '/'){ if (window.location.pathname != '/'){
uri = ([window.location.pathname,'page']).join('/') uri = ([window.location.pathname,'page']).join('/')

@ -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){}
}) })
} }
} }

@ -54,7 +54,7 @@ Vanderbilt University Medical Center
<meta property="og:description" content="{{layout.header.title}}; {{layout.header.subtitle}}, version {{system.version}}" /> <meta property="og:description" content="{{layout.header.title}}; {{layout.header.subtitle}}, version {{system.version}}" />
<meta property="og:site_name" content="{{layout.header.title}}" /> <meta property="og:site_name" content="{{layout.header.title}}" />
<script src="{{system.parentContext}}/static/js/dashboard.js"></script>
<script src="{{system.parentContext}}/static/js/jx/dom.js"></script> <script src="{{system.parentContext}}/static/js/jx/dom.js"></script>
<script src="{{system.parentContext}}/static/js/jx/utils.js"></script> <script src="{{system.parentContext}}/static/js/jx/utils.js"></script>
<script src="{{system.parentContext}}/static/js/jx/rpc.js"></script> <script src="{{system.parentContext}}/static/js/jx/rpc.js"></script>

Loading…
Cancel
Save