Commit b13dfce3 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Add /health page

parent 894eba56
......@@ -244,6 +244,11 @@ def net_draw(net, alt=None):
except KeyError:
abort(404)
@app.route("/health")
def health_page():
global entries
return render_template('health.html', entries=entries.values())
@app.route("/api")
def api():
return render_template('api.html')
......
{% extends "base.html" %}
{% from 'macros.html' import fmt_int, fmt_float %}
{% block net_active %}
active
{% endblock %}
{% block content %}
<div class="column-group">
<div class="xlarge-100 large-100 small-100 bottom-space">
<table class="ink-table hover sortable">
<thead>
<tr>
<th class="align-left tight">Name</th>
<th class="align-left">Title</th>
<th class="align-left tight">Upstream status</th>
<th class="align-left">Last checked</th>
</tr>
</thead>
<tbody>
{% for entry in entries %}
<tr>
<td class="mono"> <a href="/net/{{ entry.name }}">{{ entry.name }}</a> </td>
<td> {{ entry.title }} </td>
<td>
{% if entry.orphan %}
<span class="ink-label grey" title="Upstream is no more. It has ceased to be. It has expired and gone to meet its maker. It's an ex-upstream!"></span>
{% elif entry.upstream_status[0] == 200 %}
<span class="ink-label green" title="Upstream health OK.">OK</span>
{% else %}
<span class="ink-label red" title="Upstream health NOT OK!">{{entry.upstream_status[0]}}</span>
{% endif %}
</td>
<td>
{{entry.upstream_status[1]}}
</td>
</tr>
{% endfor %}
</tbody>
<table>
</div>
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment