templates/index: Directly referencing config.REFRESH_RATE

Fixes https://github.com/voxpupuli/puppetboard/issues/213

Also changing the 'if' condition from '!=' to '>' since this application
can only work with unsigned integers
This commit is contained in:
corey.hammerton
2016-02-01 19:59:24 -05:00
parent fd29fe4261
commit f9edda82b4
2 changed files with 2 additions and 4 deletions

View File

@@ -140,7 +140,6 @@ def index(env):
# TODO: Would be great if we could parallelize this somehow, doing these # TODO: Would be great if we could parallelize this somehow, doing these
# requests in sequence is rather pointless. # requests in sequence is rather pointless.
prefix = 'puppetlabs.puppetdb.query.population' prefix = 'puppetlabs.puppetdb.query.population'
refreshrate = app.config['REFRESH_RATE']
num_nodes = get_or_abort( num_nodes = get_or_abort(
puppetdb.metric, puppetdb.metric,
"{0}{1}".format(prefix, ':type=default,name=num-nodes')) "{0}{1}".format(prefix, ':type=default,name=num-nodes'))
@@ -198,7 +197,6 @@ def index(env):
nodes=nodes_overview, nodes=nodes_overview,
stats=stats, stats=stats,
envs=envs, envs=envs,
refreshrate=refreshrate,
current_env=env current_env=env
) )

View File

@@ -1,8 +1,8 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% import '_macros.html' as macros %} {% import '_macros.html' as macros %}
{% block content %} {% block content %}
{% if refreshrate != 0 %} {% if config.REFRESH_RATE > 0 %}
<meta http-equiv="refresh" content="{{refreshrate}}"> <meta http-equiv="refresh" content="{{config.REFRESH_RATE}}">
{% endif %} {% endif %}
<div class="ui vertical grid"> <div class="ui vertical grid">
<div class="four column row"> <div class="four column row">