diff --git a/bin/qcms b/bin/qcms index f274c5c..333ae4b 100755 --- a/bin/qcms +++ b/bin/qcms @@ -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 ( diff --git a/cms/__init__.py b/cms/__init__.py index 1f00a43..42ce092 100644 --- a/cms/__init__.py +++ b/cms/__init__.py @@ -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 diff --git a/cms/index.py b/cms/index.py index 7d4f4cd..bdecc31 100644 --- a/cms/index.py +++ b/cms/index.py @@ -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.route("/",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/') # def people(uid): @@ -147,7 +130,7 @@ def _dialog (app): @_app.route("/api//",defaults={'app':'main','key':None},methods=['GET','POST','DELETE','PUT']) @_app.route("//api//",defaults={'key':None},methods=['GET','POST','DELETE','PUT']) -@_app.route("////",defaults={'key':None},methods=['GET','POST','DELETE','PUT']) +@_app.route("///api//",methods=['GET','POST','DELETE','PUT']) def _delegate_call(app,key,module,name): _handler = _getHandler(app,key) diff --git a/cms/static/js/menu.js b/cms/static/js/menu.js index 1e7517d..ddeb441 100644 --- a/cms/static/js/menu.js +++ b/cms/static/js/menu.js @@ -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 // } diff --git a/cms/templates/header.html b/cms/templates/header.html index ee0bde5..4b86142 100644 --- a/cms/templates/header.html +++ b/cms/templates/header.html @@ -6,4 +6,4 @@
{{layout.header.title}}
{{layout.header.subtitle}}
-
\ No newline at end of file + diff --git a/cms/templates/index.html b/cms/templates/index.html index 9503e7f..6888011 100644 --- a/cms/templates/index.html +++ b/cms/templates/index.html @@ -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)