From c0cef0a3c06609cafae943512266c35ddbe2bc6b Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Mon, 28 Oct 2013 16:50:19 +0100 Subject: [PATCH] overview: Cosmetic changes. * Don't pass unresponsive to the view, access config[] object instead * Remove the statistics header, it only takes up space * Lowercase a few things * Change the descriptions for 'radiator' to make the math work: Because of how PuppetDB's aggregate-events-count works nodes with both successful and failed events count for both causing success + failure + unreported to not equal population, which is weird. Now we're simply stating that they have failed events instead of saying that the node is succesful/failed. --- puppetboard/app.py | 2 +- puppetboard/templates/index.html | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/puppetboard/app.py b/puppetboard/app.py index 18a8a9a..e4bbc80 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -102,7 +102,7 @@ def index(): node.noresponse = str(delta.days) + "d " + str(int(delta.seconds/3600)) +"h " + str(int((delta.seconds%3600)/60))+ "m" unreported.append(node) - return render_template('index.html', metrics=metrics, latest_event_count=latest_event_count, latest_events=latest_events, unreported=unreported, unreported_time=app.config['UNRESPONSIVE_HOURS']) + return render_template('index.html', metrics=metrics, latest_event_count=latest_event_count, latest_events=latest_events, unreported=unreported) @app.route('/nodes') def nodes(): diff --git a/puppetboard/templates/index.html b/puppetboard/templates/index.html index d3c0c9d..5701b8c 100644 --- a/puppetboard/templates/index.html +++ b/puppetboard/templates/index.html @@ -1,23 +1,22 @@ {% extends 'layout.html' %} {% block row_fluid %}
-
-

Statistics

-
-
-

{{latest_event_count['failures']}} Failed

- nodes in the latest reports +

{{latest_event_count['failures']}} node(s)

+ with failures in latest reports
-

{{latest_event_count['successes']}} Succeeded

- nodes in the latest reports +

{{latest_event_count['successes']}} node(s)

+ with successes in latest reports
-

{{ unreported|length }} Unreported

- nodes in the last {{ unreported_time }} hours +

{{ unreported|length }} unreported

+ + {% if unreported|length == 1 %} node {% else %} nodes {% endif %} + in the last {{ config.UNRESPONSIVE_HOURS }} hours +
@@ -41,7 +40,7 @@
-

Nodes without Report since {{ unreported_time }} hours

+

Nodes unresponsive in the last {{ config.UNRESPONSIVE_HOURS }} hours

{% for node in unreported %} @@ -54,7 +53,7 @@ {% endfor %}
-

Latest Reports with events

+

Latest reports with events

{% for event in latest_events %}