Added a hacky solution to allow users to be able to set a number of reports that they wish to display on the reports panel on the node page

This commit is contained in:
stack72
2014-05-16 16:37:16 -05:00
parent bfdc778a81
commit 81c71607ae
5 changed files with 22 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ from pypuppetdb import connect
from puppetboard.forms import QueryForm
from puppetboard.utils import (
get_or_abort, yield_or_stop,
ten_reports, jsonprint
ten_reports, limit_reports, jsonprint
)
@@ -173,12 +173,13 @@ def node(node_name):
"""
node = get_or_abort(puppetdb.node, node_name)
facts = node.facts()
reports = ten_reports(node.reports())
reports = limit_reports(node.reports(), app.config['REPORTS_COUNT'])
return render_template(
'node.html',
node=node,
facts=yield_or_stop(facts),
reports=yield_or_stop(reports))
reports=yield_or_stop(reports),
reports_count=app.config['REPORTS_COUNT'])
@app.route('/reports')