tables added to webapp
diff --git a/web_app/__init__.py b/web_app/__init__.py
index a720d12..ada3f17 100644
--- a/web_app/__init__.py
+++ b/web_app/__init__.py
@@ -2,6 +2,7 @@
from flask_bootstrap import Bootstrap
import json
import os.path
+from report import build_vertical_bar, build_lines_chart
from storage_api import create_storage, TEST_PATH
app = Flask(__name__)
@@ -49,7 +50,12 @@
tests = load_test(test_name)
header_keys = ['build_id', 'iso_md5', 'type']
table = [[]]
+ storage = create_storage('file://' + TEST_PATH + '/' + test_name + '.json')
+ results = storage.recent_builds()
+ bars = build_vertical_bar(results)
+ lines = build_lines_chart(results)
+ urls = bars + lines
if len(tests) > 0:
sorted_keys = sorted(tests[0].keys())
@@ -68,7 +74,7 @@
table.append(row)
- return render_template("table.html", headers=header_keys, table=table)
+ return render_template("table.html", headers=header_keys, table=table, urls=urls)
@app.route("/tests/<test_name>", methods=['POST'])
diff --git a/web_app/templates/table.html b/web_app/templates/table.html
index 1084a3a..dedb38b 100644
--- a/web_app/templates/table.html
+++ b/web_app/templates/table.html
@@ -8,8 +8,14 @@
</head>
<body>
{% block body %}
+ <h1 align="center">Lab name goes here:-)</h1>
<div class="table-responsive">
<table class="table" width="600">
+ <div id="images">
+ {% for url in urls %}
+ <img src="{{ url }}">
+ {% endfor %}
+ </div>
{% for header in headers %}
<th>
<h2>{{ header }}</h2>