bug fixes, optimizations

v2.0
Steve Nyemba 5 months ago
parent 6c92bedefb
commit af694a3dd3

@ -315,7 +315,7 @@ class Accessor (Initializer):
self._config = json.loads(_stream)
elif type(_stream) == io.StringIO :
self._config = json.loads( _stream.read())
self._ISCLOUD = 'source' in self._config['system'] and self._config['system']['source']['id'] == 'cloud'
self._ISCLOUD = 'source' in self._config['system'] and self._config['system']['source'] and self._config['system']['source']['id'] == 'cloud'
#
#
# self._name = self._config['system']['name'] if 'name' in self._config['system'] else _args['name']

@ -15,6 +15,10 @@ import io
import base64
from jinja2 import Environment, BaseLoader
import typer
from typing_extensions import Annotated
from typing import Optional
import pandas as pd
import uuid
import datetime
@ -274,30 +278,12 @@ def _open(id):
_setHandler(id)
# _route.set(id)
return _index()
#
# Let us bootup the application
# SYS_ARGS = {}
# if len(sys.argv) > 1:
# N = len(sys.argv)
# for i in range(1,N):
# value = None
# if sys.argv[i].startswith('--'):
# key = sys.argv[i][2:] #.replace('-','')
# SYS_ARGS[key] = 1
# if i + 1 < N:
# value = sys.argv[i + 1] = sys.argv[i+1].strip()
# if key and value and not value.startswith('--'):
# SYS_ARGS[key] = value
# i += 2
@cli.command()
def start (path:str='config.json',shared:bool=False) :
def start (
path:Annotated[str,typer.Argument(help="path of the manifest file")]='qcms-manifest.json',
shared:bool=False) :
"""
This function is designed to start the application with its associated manifest (configuration) location
:path path to the the manifest
@ -307,7 +293,9 @@ def start (path:str='config.json',shared:bool=False) :
if os.path.exists(path) and os.path.isfile(path):
_args = {'path':path}
if shared :
# if shared :
# _args['location'] = path
# _args['shared'] = shared
_args['location'] = path
_args['shared'] = shared
@ -318,7 +306,7 @@ def start (path:str='config.json',shared:bool=False) :
# _args = _route.get().get_app()
_args = _route.get().app()
_app.secret_key = str(uuid.uuid4())
_app.config['PERMANENT_SESSION_LIFETIME'] = datetime.timedelta(minutes=30)
_app.config['PERMANENT_SESSION_LIFETIME'] = datetime.timedelta(hours=24)
_app.run(**_args)
_status = 'found'
else:

@ -0,0 +1,31 @@
var dialog = {}
dialog.context = ''
dialog.show = function(_title,_internalURI,_message,_pointer){
var http = HttpClient.instance()
// http.setData({title:_title,html:_message},'application/json')
var uri = dialog.context+'/dialog'
http.setHeader('dom',_title)
http.setHeader('uri',_internalURI)
http.get(uri,function(x){
$('.jxmodal').remove()
jx.modal.show({html:x.responseText,id:'body'})
if(jx.dom.exists('dialog-message') && _message != null){
jx.dom.set.value('dialog-message',_message)
}
//
// In order to perhaps execute any js script that should have been executed on load ...
//
var scripts = $('.jxmodal script')
jx.utils.patterns.visitor(scripts,function(_item){
if(_item.text.trim().length > 0){
var _routine = eval(_item.text)
//
//@TODO:
// Find a way to add the running function into the page to enable scripts to work
//
}
})
})
}
Loading…
Cancel
Save