From f198d14a8733fe0965173e94ddbf7c4c9e0686db Mon Sep 17 00:00:00 2001 From: Ilya Shakhat Date: Fri, 4 Apr 2014 14:29:45 +0400 Subject: [PATCH] KPI report enhancements * Dynamic routing to templates (no Flask endpoint is needed for new reports) * Added KPI to become core engineer * Added KPI on disagreement ratio * Added more examples on KPI usage Change-Id: I8b91ad0864b18d8bf731e4a4677f23daa0a714e5 --- dashboard/kpi.py | 7 +-- dashboard/templates/kpi/base_kpi.html | 81 ++++++++++++++++++++++----- dashboard/templates/kpi/example.html | 38 +++++++++---- 3 files changed, 96 insertions(+), 30 deletions(-) diff --git a/dashboard/kpi.py b/dashboard/kpi.py index ef793c743..1c26c4739 100644 --- a/dashboard/kpi.py +++ b/dashboard/kpi.py @@ -21,8 +21,7 @@ from dashboard import decorators blueprint = flask.Blueprint('kpi', __name__, url_prefix='/kpi') -@blueprint.route('/example') -@decorators.templated() +@blueprint.route('/') @decorators.exception_handler() -def example(): - return +def kpi_report(path): + return flask.render_template('kpi/' + path + '.html'), 200 diff --git a/dashboard/templates/kpi/base_kpi.html b/dashboard/templates/kpi/base_kpi.html index fc2bc9d01..dd09e6493 100644 --- a/dashboard/templates/kpi/base_kpi.html +++ b/dashboard/templates/kpi/base_kpi.html @@ -38,8 +38,8 @@ {% endblock %} @@ -34,4 +47,7 @@

Percentage in top

+ +

Core status

+
{% endblock %}