From: saksham115 Date: Tue, 25 Jul 2017 17:39:16 +0000 (+0530) Subject: Fixing URL for static files X-Git-Tag: opnfv-5.0.RC1~58^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F38097%2F3;p=storperf.git Fixing URL for static files Earlier the static files were being served on /static/ now it has been fixed and are being served on /reporting/js/ and /reporting/css/ for js and css files respectively. JIRA: STORPERF-192 Change-Id: Ibcce2210de88f2359d011752513fdab9f930ab5b Signed-off-by: saksham115 --- diff --git a/docker/storperf-reporting/src/app.py b/docker/storperf-reporting/src/app.py index 25edf48..fadda66 100644 --- a/docker/storperf-reporting/src/app.py +++ b/docker/storperf-reporting/src/app.py @@ -8,6 +8,7 @@ ############################################################################## from flask import Flask, redirect, url_for, request, render_template, session +from flask import send_from_directory import urllib import json app = Flask(__name__) @@ -29,6 +30,16 @@ def url(): return redirect(url_for('success')) +@app.route('/reporting/js/') +def js(path): + return send_from_directory('static/js/', path) + + +@app.route('/reporting/css/') +def css(path): + return send_from_directory('static/css/', path) + + @app.route('/reporting/') def index(): return render_template('index.html') diff --git a/docker/storperf-reporting/src/templates/index.html b/docker/storperf-reporting/src/templates/index.html index c302299..70e33bd 100644 --- a/docker/storperf-reporting/src/templates/index.html +++ b/docker/storperf-reporting/src/templates/index.html @@ -3,10 +3,10 @@ Graphing Module | Storperf - - - - + + + + diff --git a/docker/storperf-reporting/src/templates/plot_tables.html b/docker/storperf-reporting/src/templates/plot_tables.html index 4d6c887..a8c508d 100644 --- a/docker/storperf-reporting/src/templates/plot_tables.html +++ b/docker/storperf-reporting/src/templates/plot_tables.html @@ -4,12 +4,12 @@ Chart | Storperf - - - - - - + + + + + +