summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorMark Beierl <mark.beierl@dell.com>2017-07-25 21:04:07 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-25 21:04:07 +0000
commit967371648191c37e20123c08e761c7a8a2a98516 (patch)
treedb5504a23f4015a4027d6f923fb8fd7a366c4e7d /docker
parent3e30bf5912cbd63a9dfc1977bbc1c900889ebd3c (diff)
parent9b1febca47789f85469faab8175c8928ede937ac (diff)
Merge "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"
Diffstat (limited to 'docker')
-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;