{% extends "isitup/base.html" %}

{% block title %}{{object}}{% endblock %}

{% block content %}

<h3>Service</h3>

<dl class="well">
    <dt>{{object}}</dt>
	<dd>Host: {{object.host}}</dd>
	{% if object.path %}<dd>Path: {{object.path}}</dd>{% endif %}
	<dd>Status: {{object.up}}</dd>
	<dd>Code: {{object.status_code}}</dd>
	<dd>Uptime: {{object.uptime}} days</dd>
	<dd>Uptime rate: {{object.uptime_rate|floatformat}}%</dd>
	<dd>Avg response: {{object.avg_response_time|floatformat}} seconds</dd>
</dl>

<p><a class="btn" href="{% url service-list %}" alt="Back to service list">Back to services</a></p>

<h4>Outages</h4>
<ul>
{% for o in object.serviceoutage_set.all %}
<li>Began on {{o.start|date:"Y m d"}} with a {{o.response_code}} response code and lasted {{o.duration}}</li>
{% endfor %}
</ul>

<h4>History</h4>
<table class="table">
<tr><th>Code</th><th>Date</th><th>Response time</th></tr>
{% for check in object.servicecheck_set.all %}
<tr><td>{{check.status_code}}</td><td>{{check.created}}</td><td>{{check.response_time}}</td></tr>
{% endfor %}
</table>



{% endblock %}
