Merge pull request #7 from nicklewis/add-metric-name

Add the name of the metric to the metric page
This commit is contained in:
Daniele Sluijters
2013-08-21 17:08:45 -07:00
2 changed files with 8 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ from __future__ import absolute_import
import os import os
import logging import logging
import collections import collections
import urllib
from flask import ( from flask import (
Flask, render_template, abort, url_for, Flask, render_template, abort, url_for,
@@ -206,5 +207,6 @@ def metrics():
@app.route('/metric/<metric>') @app.route('/metric/<metric>')
def metric(metric): def metric(metric):
name = urllib.unquote(metric)
metric = puppetdb.metric(metric) metric = puppetdb.metric(metric)
return render_template('metric.html', metric=sorted(metric.items())) return render_template('metric.html', name=name, metric=sorted(metric.items()))

View File

@@ -1,6 +1,10 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block content %} {% block content %}
<h1>Metric</h1> <div class="page-header">
<h1>Metric
<small>{{name}}</small>
</h1>
</div>
<table class="table table-striped"> <table class="table table-striped">
<tbody> <tbody>
{% for key,value in metric %} {% for key,value in metric %}