From 9b1febca47789f85469faab8175c8928ede937ac Mon Sep 17 00:00:00 2001 From: saksham115 Date: Tue, 25 Jul 2017 23:09:16 +0530 Subject: 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 --- docker/storperf-reporting/src/app.py | 11 +++++++++++ docker/storperf-reporting/src/templates/index.html | 8 ++++---- docker/storperf-reporting/src/templates/plot_tables.html | 12 ++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) (limited to 'docker') 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 - - - - - - + + + + + +