2015-06-17 13:36:56 +03:00

86 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% load humanize %}
{% block content %}
<div class="row">
<div class="col-sm-12">
<h1>Hello {{ request.user.email }}</h1>
<table class="table table-hover">
<tr>
<th></th>
<th class="th-name">Name</th>
<th>Code</th>
<th>Frequency</th>
<th>Last Ping</th>
<th></th>
</tr>
{% for check in checks %}
<tr class="checks-row">
<td class="indicator-cell">
{% if check.status == "new" %}
<span class="glyphicon glyphicon-question-sign new"></span>
{% elif now < check.alert_after %}
<span class="glyphicon glyphicon-ok-sign up"></span>
{% else %}
<span class="glyphicon glyphicon-exclamation-sign down"></span>
{% endif %}
</td>
<td>
<form
method="post"
action="{% url 'hc-update-name' check.code %}"
class="name-edit form-inline inactive">
{% csrf_token %}
<input
name="name"
type="text"
value="{{ check.name }}"
placeholder="unnamed"
class="input-name form-control" />
<button class="btn btn-primary" type="submit">
<span class="glyphicon glyphicon-ok"></span>
</button>
<button class="btn btn-default name-edit-cancel">
<span class="glyphicon glyphicon-remove"></span>
</button>
</form>
</td>
<td>
<small>
<code>{{ check.code }}</code>
</small>
</td>
<td>{{ check.timeout }}</td>
<td>
{% if check.last_ping %}
<span
data-toggle="tooltip"
title="{{ check.last_ping }}">
{{ check.last_ping|naturaltime }}
</span>
{% else %}
Never
{% endif %}
</td>
<td>
<a class="setup-link" href="#">Setup Instructions</a>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
<div class="row">
<div class="col-sm-4 center-block"></div>
<form method="post" action="{% url 'hc-add-check' %}">
{% csrf_token %}
<input type="submit" class="btn btn-primary btn-lg" value="Add Check">
</form>
</div>
</div>
{% endblock %}