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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user