diff --git a/v2realbot/config.py b/v2realbot/config.py index 991a15b..39988a8 100644 --- a/v2realbot/config.py +++ b/v2realbot/config.py @@ -17,7 +17,7 @@ TEST_SERVER_HOSTNAMES = ['tradingtest'] #TODO vybrane dat do config db a managovat pres GUI -#AGGREGATOR filter trades +#DEFAULT AGGREGATOR filter trades #NOTE pridana F - Inter Market Sweep Order - obcas vytvarela spajky AGG_EXCLUDED_TRADES = ['C','O','4','B','7','V','P','W','U','Z','F'] diff --git a/v2realbot/main.py b/v2realbot/main.py index e1b39b3..ff8a444 100644 --- a/v2realbot/main.py +++ b/v2realbot/main.py @@ -791,7 +791,7 @@ def delete_item(item_id: int) -> dict: #model section #UPLOAD MODEL @app.post("/model/upload_model", dependencies=[Depends(api_key_auth)]) -async def upload_model(file: UploadFile = File(...)): +async def _upload_model(file: UploadFile = File(...)): # Specify the directory to save the file #save_directory = DATA_DIR+'/models/' save_directory = MODEL_DIR @@ -857,7 +857,8 @@ def download_model(model_name: str): @app.get("/model/metadata/{model_name}", dependencies=[Depends(api_key_auth)]) def get_metadata(model_name: str): try: - model_instance = ml.load_model(file=model_name, directory=MODEL_DIR) + #loadujeme pouze v modu cfg only + model_instance = ml.load_model(file=model_name, directory=MODEL_DIR, cfg_only = True) try: metadata = model_instance.metadata except AttributeError: diff --git a/v2realbot/static/index.html b/v2realbot/static/index.html index f0ee8b1..581cde7 100644 --- a/v2realbot/static/index.html +++ b/v2realbot/static/index.html @@ -810,6 +810,7 @@
cfg:' + JSON.stringify(response.cfg, null, 4) + ''; // formattedMetadata += '
arch_function:' + response.arch_function + ''; // $('#metadata-container').html(formattedMetadata); @@ -123,22 +124,25 @@ $(document).ready(function() { console.log(JSON.stringify(response,null,4)) $('#metadata_label').html(name); - require(["vs/editor/editor.main"], () => { - model_editor_json = monaco.editor.create(document.getElementById('toml-editor-container'), { - value: response.cfg_toml ? response.cfg_toml + ((response.history) ? "\nHISTORY:\n" + JSON.stringify(response.history,null,4) : "") : JSON.stringify(response,null,4), - language: 'toml', - theme: 'tomlTheme-dark', - automaticLayout: true, - readOnly: true - }); - model_editor_python = monaco.editor.create(document.getElementById('python-editor-container'), { - value: response.arch_function ? response.arch_function : '', - language: 'python', - theme: 'tomlTheme-dark', - automaticLayout: true, - readOnly: true - }); - }); + if (!error) { + console.log("init editoru", error) + require(["vs/editor/editor.main"], () => { + model_editor_json = monaco.editor.create(document.getElementById('toml-editor-container'), { + value: response.cfg_toml ? response.cfg_toml + ((response.history) ? "\nHISTORY:\n" + JSON.stringify(response.history,null,4) : "") : JSON.stringify(response,null,4), + language: 'toml', + theme: 'tomlTheme-dark', + automaticLayout: true, + readOnly: true + }); + model_editor_python = monaco.editor.create(document.getElementById('python-editor-container'), { + value: response.arch_function ? response.arch_function : '', + language: 'python', + theme: 'tomlTheme-dark', + automaticLayout: true, + readOnly: true + }); + }); + } } // Fetch models on page load