diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index 94abfbcd..2cd57db5 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -468,13 +468,27 @@ def sentiment_analysis_getplotdata(): - - @app.route("/sentiment_analysis_plot_tool/") def sentiment_analysis_plot_tool(): return render_template("sentiment_analysis_plot_tool.html") + +@app.route("/sentiment_analysis_plot_tool_getdata/") +def sentiment_analysis_plot_tool_getdata(): + getProviders = request.args.get('getProviders') + + if getProviders: + providers = [] + for cur_provider in r_serv_charts.smembers('providers_set'): + providers.append(cur_provider) + return jsonify(providers) + + else: + return 0 + + + @app.route("/showsavedpaste/") #completely shows the paste in a new tab def showsavedpaste(): return showpaste(0) diff --git a/var/www/templates/sentiment_analysis_plot_tool.html b/var/www/templates/sentiment_analysis_plot_tool.html index 5c9c630f..9309f459 100644 --- a/var/www/templates/sentiment_analysis_plot_tool.html +++ b/var/www/templates/sentiment_analysis_plot_tool.html @@ -75,21 +75,13 @@
-
-
@@ -147,6 +139,17 @@ $(document).ready(function(){ activePage = $('h1.page-header').attr('data-page'); $("#"+activePage).addClass("active"); + var li_text = "
  • " + + $.getJSON('/sentiment_analysis_plot_tool_getdata/?getProviders=True', function(data){ + console.log(data); + for(i=0; i