bug fixes & optimizations

pull/12/head
Steve Nyemba 1 month ago
parent 763787ea02
commit 8884b8e02d

@ -280,7 +280,7 @@ def reload (
Reload a site/portal given the manifest ...
"""
_config = config.get( get_manifest(path))
if 'key' in _config['system']['source'] :
if 'source' in _config['system'] and 'key' in _config['system']['source'] :
f = open(_config['system']['source']['key'])
key = f.read()
f.close()
@ -293,7 +293,7 @@ def reload (
_msg = f"""{FAILED} failed to reload, status code {resp.status_code}\n{url}
"""
else:
_msg = f"""{FAILED} no secure key found in manifest"""
_msg = f"""{FAILED} no secure key found in manifest to request reload"""
print (_msg)
@cli.command(name="bootup")
def bootup (

@ -102,7 +102,10 @@ class Plugin :
except Exception as e:
_data = _pointer(request=_request,config=_config)
if type(_data) == pd.DataFrame :
_data = _data.to_json(orient='records')
elif type(_data) in [dict,list] :
_data = json.dumps(_data)
pass
else:
_code = 404

@ -46,8 +46,10 @@ def _getHandler (app_id,resource=None) :
_id = _getId(app_id,resource)
return _route._apps[_id]
def _getId(app_id,resource):
return '/'.join([app_id,resource]) if resource else app_id
def _getId(app_id,app_x):
if app_x not in [None,''] :
return '/'.join([app_id,app_x])
return app_id
def _setHandler (app_id,resource) :
session['app_id'] = _getId(app_id,resource)
@ -96,33 +98,14 @@ def _getIndex (app_id ,resource=None):
@_app.route("/")
def _index ():
return _getIndex('main')
# def _xindex ():
# _handler = _getHandler()
# _config = _handler.config()
# global _route
# # print ([' serving ',session.get('app_id','NA'),_handler.layout()['root']])
# _args={'system':_handler.system(skip=['source','app','data']),'layout':_handler.layout()}
# try:
# uri = os.sep.join([_config['layout']['root'], _config['layout']['index']])
# _index_page = "index.html"
# _args = _route.render(uri,'index',session.get('app_id','main'))
# # _setHandler('main')
# except Exception as e:
# # print ()
# print (e)
# _index_page = "404.html"
# return render_template(_index_page,**_args),200 if _index_page != "404.html" else 200
@_app.route("/<app>/<resource>")
@_app.route("/<app>",defaults={'resource':None})
def _aindex (app,resource=None):
_handler = _getHandler(app,resource)
_setHandler(app,resource)
_html,_code = _getIndex(app,resource)
return _html,_code
# @_app.route('/id/<uid>')
# def people(uid):
@ -147,7 +130,7 @@ def _dialog (app):
@_app.route("/api/<module>/<name>",defaults={'app':'main','key':None},methods=['GET','POST','DELETE','PUT'])
@_app.route("/<app>/api/<module>/<name>",defaults={'key':None},methods=['GET','POST','DELETE','PUT'])
@_app.route("/<app>/<key>/<module>/<name>",defaults={'key':None},methods=['GET','POST','DELETE','PUT'])
@_app.route("/<app>/<key>/api/<module>/<name>",methods=['GET','POST','DELETE','PUT'])
def _delegate_call(app,key,module,name):
_handler = _getHandler(app,key)

@ -313,9 +313,13 @@ var QCMSTabs = function(_layout,_context,_clickEvent){
// _button._uri = _label._uri
// if(this._layout.icons[text] != null) {
var _icon = jx.dom.get.instance('I')
_icon.className = this._layout.icons[text]
$(_label).append(_icon)
if (this._layout.icon){
var _icon = jx.dom.get.instance('I')
_icon.className = this._layout.icons[text]
$(_label).append(_icon)
}
text = ' ' + text
// }

@ -6,4 +6,4 @@
<div>
<div class="title">{{layout.header.title}}</div>
<div class="subtitle">{{layout.header.subtitle}}</div>
</div>
</div>

@ -62,7 +62,7 @@ Vanderbilt University Medical Center
var _layout = {{layout|tojson}}
sessionStorage.setItem('{{system.id}}','{{system.context|safe}}')
//sessionStorage.setItem('{{system.id}}','{{system.context|safe}}')
$(document).ready( function(){
bootup.init('{{system.id}}',_layout)

Loading…
Cancel
Save