Fix stats template, don't error on missing runner stats
[GitLab/stricted-build/lineage_builder.git] / ui / app.py
index dc7895e3fa72ca990d0af2b55c2e7603f0e90d19..70155486cc5d8cf5fc57e8a82a8578c5e9719760 100644 (file)
--- a/ui/app.py
+++ b/ui/app.py
@@ -127,7 +127,9 @@ def web_runner(runner):
 
 @app.route('/stats')
 def web_stats():
-    return render_template('stats.html', stats=stats())
+    stats_ = stats()
+    runners = ['all'] + [x for x in sorted(stats_['builds'].keys()) if x != 'all']
+    return render_template('stats.html', stats=stats_, runners=runners)
 
 @app.route("/runners/")
 def web_runners():