diff --git a/qcms-manifest.json b/qcms-manifest.json index 59f7e26..4d6fdbb 100644 --- a/qcms-manifest.json +++ b/qcms-manifest.json @@ -7,7 +7,7 @@ "host": "0.0.0.0" }, "context": "", - "logo": "www/html/_assets/images/logo.png", + "logo": "_assets/images/logo.png", "source": { "id": "disk", "key": "/home/steve/dev/data/qcms/data-transport.key", @@ -35,9 +35,9 @@ "on": { "load": { "studio-menu": [ - "www/html/menu.html" + "menu.html" ], - "studio-intro":["www/html/about.html"] + "studio-intro":["about.html"] } }, diff --git a/www/html/_assets/images/banner.jpg b/www/html/_assets/images/banner.jpg new file mode 100644 index 0000000..47cffbb Binary files /dev/null and b/www/html/_assets/images/banner.jpg differ diff --git a/www/html/_assets/images/ferretdb.jpeg b/www/html/_assets/images/ferretdb.jpeg new file mode 100644 index 0000000..2bc5923 Binary files /dev/null and b/www/html/_assets/images/ferretdb.jpeg differ diff --git a/www/html/_assets/images/ferretdb.png b/www/html/_assets/images/ferretdb.png new file mode 100644 index 0000000..5b91f30 Binary files /dev/null and b/www/html/_assets/images/ferretdb.png differ diff --git a/www/html/_assets/js/studio.js b/www/html/_assets/js/studio.js index ee7d79b..faed3e8 100644 --- a/www/html/_assets/js/studio.js +++ b/www/html/_assets/js/studio.js @@ -11,7 +11,7 @@ studio.defaults = { 'postgresql':'SELECT *\nFROM INFORMATION_SCHEMA.COLUMNS LIMIT 10', 'iceberg':'SHOW TABLES', 'mysql':'SELECT * \nFROM INFORMATION_SCHEMA.COLUMNS LIMIT 10', - 'mariadb':'SHOW TABLES' + 'mariadb':'SHOW TABLES','files':'{"query":"index > -1"}' } studio.init = function (_context){ studio._context = _context @@ -241,6 +241,10 @@ studio.frame = function (_args){ http.setData (JSON.stringify(_data)) http.post(uri,function(x){ + var _id = `.${_args.label} .control .apply` + + $(_id).empty() + $(_id).append($('')) if(x.status == 200 && x.readyState == 4){ _r = JSON.parse(x.responseText) // sessionStorage._data = x.responseText @@ -417,6 +421,7 @@ studio.frame = function (_args){ }); } + this.render = function (){ var _args = this._args @@ -435,17 +440,37 @@ studio.frame = function (_args){ read = this.read _compute = this.compute _xbutton = $('
').on('click',function (){ - var _id = '.code.'+_args.label.trim() - _query = $(_id).val() + // var _id = '.code.'+_args.label.trim() + // _query = $(_id).val() - if (_query.length != ''){ - var _data = read(_args,_query,_compute) + // if (_query.length != ''){ + // var _data = read(_args,_query,_compute) + // } + + var _child = $(`.${_args.label} .control .apply`).children()[0] + if ($(_child).attr('class').match(/play/)){ + $(`.${_args.label} .control .apply`).empty() + $(`.${_args.label} .control .apply`).append($('')) + + // + // + var _id = '.code.'+_args.label.trim() + _query = $(_id).val() + + if (_query.length != ''){ + var _data = read(_args,_query,_compute) + + + } + + }else{ + } }) - _pythonCode = $('
') + _pythonCode = $('
') _pythonCode.on('click',()=>{ diff --git a/www/html/_plugins/agent.py b/www/html/_plugins/agent.py index 61c8f7e..836f501 100644 --- a/www/html/_plugins/agent.py +++ b/www/html/_plugins/agent.py @@ -17,7 +17,7 @@ import pandas as pd from langchain_openai import AzureOpenAI, AzureChatOpenAI from langchain_ollama import OllamaEmbeddings, OllamaLLM from langchain_core.messages import HumanMessage, AIMessage -from langchain.chains import LLMChain +from langchain_classic.chains import LLMChain from langchain_core.prompts import PromptTemplate from langchain_core.runnables import RunnablePassthrough from langchain_core.output_parsers import StrOutputParser diff --git a/www/html/_plugins/register.py b/www/html/_plugins/register.py index 541887c..ed4d83b 100644 --- a/www/html/_plugins/register.py +++ b/www/html/_plugins/register.py @@ -31,6 +31,7 @@ def get (**_args) : _table = 'NA' if not _name else _data[_key][_name] _plugins = [] if 'plugins' not in _data[_key]else _data[_key]['plugins'] _icon = f'{_context}/api/disk/read?uri=www/html/_assets/images/{_provider}.png' + _icon = f'_assets/images/{_provider}.png' _labels.append({"label":_key,"provider":_provider,'table':_table,'icon':_icon,'AI': (_provider in _CATALOGS and _HAS_LLM)}) else: continue diff --git a/www/html/_plugins/transport.py b/www/html/_plugins/transport.py index 7c68664..3b3feb5 100644 --- a/www/html/_plugins/transport.py +++ b/www/html/_plugins/transport.py @@ -47,7 +47,8 @@ def apply (**_args): _query = _request.json['query'] _qreader = transport.get.reader(label=_label) try: - if not _query.startswith("{") : + if _query.strip()[0] not in ['{','[']: + _query = _query.replace('%%','%').replace('%','%%') _data = _qreader.apply(_query) #.astype(str).to_dict(orient='split') else: _data = _qreader.read( **json.loads(_query)) diff --git a/www/html/features.html b/www/html/features.html index b8e7e73..b834046 100644 --- a/www/html/features.html +++ b/www/html/features.html @@ -1,11 +1,11 @@ - - - - - - - + + + + + + +