From 73e26e8c1c5ddff410a0a3390636cf7385c4b852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 20 Nov 2013 13:34:13 +0100 Subject: [PATCH] error fix, format string and css button width fix --- puppetboard/app.py | 4 ++-- puppetboard/static/css/puppetboard.css | 3 +++ puppetboard/templates/index.html | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/puppetboard/app.py b/puppetboard/app.py index e642a5b..edf2736 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -205,13 +205,13 @@ def report_latest(node_name): """ node = get_or_abort(puppetdb.node, node_name) reports = get_or_abort(puppetdb._query, 'reports', - query='["=","certname","' + node_name + '"]', + query='["=","certname","{0}"]'.format(node_name), limit=1) if len(reports) > 0: report = reports[0]['hash'] return redirect(url_for('report', node=node_name, report_id=report)) else: - abort(500) + abort(404) @app.route('/report//') diff --git a/puppetboard/static/css/puppetboard.css b/puppetboard/static/css/puppetboard.css index 99188e9..46d002f 100644 --- a/puppetboard/static/css/puppetboard.css +++ b/puppetboard/static/css/puppetboard.css @@ -99,3 +99,6 @@ div[id^='message-event'] { background-color: rgb(231, 76, 60); background-color: rgb(129, 145, 146); } +.btn-lastreport { + width:100px; +} diff --git a/puppetboard/templates/index.html b/puppetboard/templates/index.html index 096c837..c051aa8 100644 --- a/puppetboard/templates/index.html +++ b/puppetboard/templates/index.html @@ -80,9 +80,9 @@ {{ node.name }} {% if node.unreported_time != None or node.status != 'unreported' %} - Latest Report + Latest Report {% else %} - No Report + No Report {% endif %}