diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/templates/base.html | 4 | ||||
-rw-r--r-- | wqflask/wqflask/templates/gnqa_answer.html | 9 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index e8690184..1ed47db8 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -201,7 +201,7 @@ <form id="gnqna_search_home" style="display:none;width: 100%;"> <div > - <input id="gggma" style="width:45vw" type="text" autocomplete="off" + <input id="gnqna_search_home_input" style="width:45vw" type="text" autocomplete="off" required placeholder="Ask More Questions or Topics (E.g Genes) " value='' name="quedrygnqa"> </div> </form> @@ -388,6 +388,8 @@ required placeholder="Ask More Questions or Topics (E.g Genes) " value='' name=" let timeToLoad = document.createElement("p"); timeToLoad.innerHTML = "It took your browser " + ((Date.now() - pageLoadStart) / 1000) + " second(s) to render this page"; document.querySelector("footer .row .col-xs-6").appendChild(timeToLoad); + + }); </script> </body> diff --git a/wqflask/wqflask/templates/gnqa_answer.html b/wqflask/wqflask/templates/gnqa_answer.html index e3d010f0..4fb4b268 100644 --- a/wqflask/wqflask/templates/gnqa_answer.html +++ b/wqflask/wqflask/templates/gnqa_answer.html @@ -137,6 +137,15 @@ $('#globalsearchform').hide() $('#gnqna_search_home').show() $('footer').hide() + + $("#gnqna_search_home_input").keyup(function(event) { + + console.log("adding input") + if (event.keyCode === 13) { + console.log("clicked this button") + $('#gnqna_search_home').attr('action', "/gnqna").submit(); + } + }) }); </script> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index e7249b28..37be0e81 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -262,19 +262,19 @@ def gsearchtable(): return flask.jsonify(current_page) + @app.route("/gnqna",methods =["POST","GET"]) def gnqna(): if request.method == "POST": - results = dict(request.form) try: def __error__(resp): return resp.json() def __success__(resp): return render_template("gnqa_answer.html",**resp.json()) return monad_requests.post( - urljoin("http://localhost:5000", - "/gnqa"), - json=results, + urljoin(current_app.config["GN_SERVER_URL"], + "/api/llm/gnqna"), + json=dict(request.form), ).then( lambda resp: resp ).either( |