From 2a7127485d0f1db3a542c53b1444d941aa5063d3 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Wed, 26 Oct 2022 09:03:13 -0500 Subject: [PATCH] bug fixes --- index.py | 30 ++++++++++++++++++++---------- requirements.txt | 2 ++ static/css/default.css | 2 ++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/index.py b/index.py index ed26196..49cdfca 100644 --- a/index.py +++ b/index.py @@ -63,14 +63,19 @@ def _dialog (): global _config _uri = os.sep.join([_config['layout']['root'],request.headers['uri']]) _id = request.headers['dom'] - _html = cms.components.html(_uri,_id) - e = Environment(loader=BaseLoader()).from_string(_html) # _data = cms.components.data(_config) _args = {'system':_config['system']} + _args['title'] = _id + if 'plugins' in _config : + _args['routes'] = _config['plugins'] + _html = cms.components.html(_uri,_id,_args) + e = Environment(loader=BaseLoader()).from_string(_html) + + _args['html'] = _html _html = ''.join(["
",str( e.render(**_args)),'
']) - return render_template('dialog.html',title=_id,html=_html) + return render_template('dialog.html',**_args) #title=_id,html=_html) # return _html # e = Environment(loader=BaseLoader()).from_string(_html) # _data = cms.components.data(_config) @@ -111,10 +116,12 @@ def _post (module,name): _info = _pointer(_args) if _info: code = 200 + else: + _info = "" + + # _info =io.BytesIO(_info) - _info =io.BytesIO(_info) - - _info = base64.encodebytes(_info.getvalue()).decode('ascii') + # _info = base64.encodebytes(_info.getvalue()).decode('ascii') return _info,code @_app.route('/version') def _version (): @@ -128,13 +135,16 @@ def cms_page(): global _config _uri = os.sep.join([_config['layout']['root'],request.headers['uri']]) _id = request.headers['dom'] - - _html = cms.components.html(_uri,_id) + _args = {'system':_config['system']} + if 'plugins' in _config: + _args['routes'] = _config['plugins'] + + _html = cms.components.html(_uri,_id,_args) e = Environment(loader=BaseLoader()).from_string(_html) # _data = {} #cms.components.data(_config) - _args = {'system':_config['system'],'routes':_config['plugins']} - _html = ( e.render(**_args)) + + _html = e.render(**_args) return _html,200 diff --git a/requirements.txt b/requirements.txt index 95bea42..6ae4967 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ git+https://github.com/lnyemba/data-transport flask flask-session requests +numpy +pandas \ No newline at end of file diff --git a/static/css/default.css b/static/css/default.css index 0a84264..f980585 100644 --- a/static/css/default.css +++ b/static/css/default.css @@ -172,6 +172,8 @@ body { background-color:#d3d3d3; color:#4682b4; font-weight:bold; + cursor:pointer; + padding:15px; } .button-1:hover { color:#FFFFFF;