Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-refresh on index page #99

Merged
merged 1 commit into from
Dec 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions puppetboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def index(env):
# TODO: Would be great if we could parallelize this somehow, doing these
# requests in sequence is rather pointless.
prefix = 'puppetlabs.puppetdb.query.population'
refreshrate = app.config['REFRESH_RATE']
num_nodes = get_or_abort(
puppetdb.metric,
"{0}{1}".format(prefix, ':type=default,name=num-nodes'))
Expand Down Expand Up @@ -193,6 +194,7 @@ def index(env):
nodes=nodes_overview,
stats=stats,
envs=envs,
refreshrate=refreshrate,
current_env=env
)

Expand Down
1 change: 1 addition & 0 deletions puppetboard/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
('Architecture', 'hardwaremodel' ),
('Kernel Version', 'kernelrelease' ),
('Puppet Version', 'puppetversion' ), ]
REFRESH_RATE = 30
3 changes: 3 additions & 0 deletions puppetboard/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% extends 'layout.html' %}
{% import '_macros.html' as macros %}
{% block content %}
{% if refreshrate != 0 %}
<meta http-equiv="refresh" content="{{refreshrate}}">
{% endif %}
<div class="ui vertical grid">
<div class="four column row">
<div class="column">
Expand Down