Make fact value clickable.

In the Facts view you can now click on the value of a fact and get a
listing of all the nodes with that value for that fact.

Closes #13
This commit is contained in:
Daniele Sluijters
2013-11-05 15:38:49 +01:00
parent 0563224c87
commit 754784f4af
4 changed files with 25 additions and 5 deletions

View File

@@ -250,6 +250,12 @@ def fact(fact):
name=fact,
facts=localfacts)))
@app.route('/fact/<fact>/<value>')
def fact_value(fact, value):
"""On asking for fact/value get all nodes with that fact."""
facts = get_or_abort(puppetdb.facts, fact, value)
localfacts = [f for f in yield_or_stop(facts)]
return render_template('fact.html', name=fact, value=value, facts=localfacts)
@app.route('/query', methods=('GET', 'POST'))
def query():