summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaksham115 <saksham.agrawal@research.iiit.ac.in>2017-07-25 23:09:16 +0530
committerSaksham Agrawal <saksham.agrawal@research.iiit.ac.in>2017-07-25 18:07:08 +0000
commit9b1febca47789f85469faab8175c8928ede937ac (patch)
tree123d0790145a84c43da338de3169e596fc58d7d6
parentd1950be43cd82d1e2c12fff0303ac4d8c0f586e8 (diff)
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 <saksham.agrawal@research.iiit.ac.in>
-rw-r--r--docker/storperf-reporting/src/app.py11
-rw-r--r--docker/storperf-reporting/src/templates/index.html8
-rw-r--r--docker/storperf-reporting/src/templates/plot_tables.html12
3 files changed, 21 insertions, 10 deletions
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/<path:path>')
+def js(path):
+ return send_from_directory('static/js/', path)
+
+
+@app.route('/reporting/css/<path:path>')
+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 @@
<head>
<title>Graphing Module | Storperf</title>
- <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
- <script src="{{ url_for('static', filename='js/jquery-2.1.3.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/jquery.bootpag.min.js') }}"></script>
+ <link rel="stylesheet" href="/reporting/css/bootstrap.min.css">
+ <script src="/reporting/js/jquery-2.1.3.min.js"></script>
+ <script src="/reporting/js/bootstrap.min.js"></script>
+ <script src="/reporting/js/jquery.bootpag.min.js"></script>
</head>
<body>
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 @@
<head>
<meta charset="utf-8" />
<title>Chart | Storperf</title>
- <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
- <script src="{{ url_for('static', filename='js/jquery-2.1.3.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/jquery.bootpag.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/plotly-latest.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/Chart.min.js') }}"></script>
+ <link rel="stylesheet" href="/reporting/css/bootstrap.min.css">
+ <script src="/reporting/js/jquery-2.1.3.min.js"></script>
+ <script src="/reporting/js/bootstrap.min.js"></script>
+ <script src="/reporting/js/jquery.bootpag.min.js"></script>
+ <script src="/reporting/js/plotly-latest.min.js"></script>
+ <script src="/reporting/js/Chart.min.js"></script>
<style>
.table td {
text-align: left;