cabot/app/templates/cabotapp/service_detail.html

213 lines
7.0 KiB
HTML
Raw Normal View History

2014-01-05 17:24:04 +00:00
{% extends 'base.html' %}
{% block title %}{{ block.super }} - {{ service.name }}{% endblock title %}
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="col-xs-1"><h2><i class="fa fa-gears"></i></h2></div>
<div class="col-xs-5"><h2><span class="break"></span>{{ service.name }}</h2></div>
<div class="col-xs-4 text-right"><h2><span class="label label-{% if service.overall_status == service.PASSING_STATUS %}success{% else %}danger{% endif %}">{{ service.overall_status|lower|capfirst }}</span> <span class="label label-{% if service.alerts_enabled %}success{% else %}warning{% endif %}">{% if service.alerts_enabled %}Alerts enabled{%else %}Alerts disabled{% endif %}</span></h2></div>
2014-01-20 22:27:51 +00:00
<div class="col-xs-2 text-right"><h2><a href="{% url update-service service.id %}"><i class="glyphicon glyphicon-edit"></i></a></h2></div>
2014-01-05 17:24:04 +00:00
</div>
</div>
<hr>
<div class="row">
2014-01-10 22:54:28 +00:00
<div class="col-md-6 col-xs-12">
<div class="col-xs-1"><h3><i class="fa fa-cog"></i></h3></div>
<div class="col-xs-11"><h3>Configuration</h3></div>
<div class="col-xs-12">
<div class="col-xs-1"><h5><i class="glyphicon glyphicon-link"></i></h5></div>
<div class="col-xs-3"><h5><span class="break"></span>Service URL</h5></div>
<div class="col-xs-8"><h5>{{ service.url|urlize|default:"None configured" }}</h5></div>
</div>
<div class="col-xs-12">
<div class="col-xs-1"><h5><i class="glyphicon glyphicon-user"></i></h5></div>
<div class="col-xs-3"><h5><span class="break"></span>Users watching</h5></div>
<div class="col-xs-8"><h5>
{% if not service.users_to_notify.all %}
No users subscribed
{% else %}
{{ service.users_to_notify.all|join:", " }}
{% endif %}
</h5></div>
</div>
<div class="col-xs-12">
<div class="col-xs-1"><h5><i class="fa fa-exclamation-triangle"></i></h5></div>
<div class="col-xs-3"><h5><span class="break"></span>Alert types</h5></div>
<div class="col-xs-8">
<h5>
{% if service.email_alert %}<i class="fa fa-envelope"></i> Email{% endif %}
{% if service.hipchat_alert %}<i class="fa fa-comment"></i> Hipchat{% endif %}
{% if service.sms_alert %}<i class="fa fa-mobile"></i> SMS{% endif %}
{% if service.telephone_alert %}<i class="fa fa-phone"></i> Telephone{% endif %}
</h5>
</div>
2014-01-05 17:24:04 +00:00
</div>
</div>
2014-01-10 22:54:28 +00:00
<div class="col-xs-12 col-md-6">
2014-01-05 17:24:04 +00:00
<div class="col-xs-1"><h3><i class="fa fa-bar-chart-o"></i></h3></div>
2014-01-23 14:59:22 +00:00
<div class="col-xs-11"><h3>Status (24 hours)</h3></div>
<div class="col-xs-12">
<div id="graph" style="height: 150px; margin: 1 0px;"></div>
<div id="timeline"></div>
</div>
2014-01-05 17:24:04 +00:00
</div>
</div>
<hr>
{% include 'cabotapp/_statuscheck_list.html' with checks=service.graphite_status_checks.all service=service checks_type="Graphite" %}
<hr>
{% include 'cabotapp/_statuscheck_list.html' with checks=service.http_status_checks.all service=service checks_type="Http" %}
<hr>
{% include 'cabotapp/_statuscheck_list.html' with checks=service.jenkins_status_checks.all service=service checks_type="Jenkins" %}
<hr>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-1"><h3><i class="fa fa-table"></i></h3></div>
<div class="col-xs-11">
<h3>Status check report</h3>
</div>
<div class="col-xs-12">
<form action="{% url checks-report %}" method="get">
<div class="form-group">
<div class="col-xs-12">
{{ report_form.service }}
<label class="col-xs-2 control-label">{{ report_form.checks.label_tag }}</label>
<div class="col-xs-10">{{ report_form.checks }}</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
<label class="col-xs-2 control-label">{{ report_form.date_from.label_tag }}</label>
<div class="col-xs-10">{{ report_form.date_from }}</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
<label class="col-xs-2 control-label">{{ report_form.date_to.label_tag }}</label>
<div class="col-xs-10">{{ report_form.date_to }}</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<div class="col-xs-6 col-xs-offset-2">
<button type="submit" class="btn btn-primary">Get report</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<hr>
2014-01-05 17:24:04 +00:00
<div class="row">
<div class="col-xs-12">
<div class="col-xs-1"><h3><i class="fa fa-exclamation-triangle"></i></h3></div>
<div class="col-xs-11">
<h3>Recovery instructions</h3>
</div>
{% if service.hackpad_id %}
2014-02-04 07:59:17 -05:00
<div class="col-xs-12">
2014-02-01 11:31:59 +00:00
<script src="{{ service.hackpad_id }}"></script>
2014-02-04 07:59:17 -05:00
</div>
2014-01-05 17:24:04 +00:00
{% else %}
<div class="col-xs-11 col-xs-offset-1">No hackpad configured</div>
{% endif %}
</div>
</div>
</div>
{% endblock content %}
{% block js %}
{% load compress %}
{% load jsonify %}
{{ block.super }}
<script type="text/javascript">
window.SERVICE_HISTORY = {{ service.recent_snapshots|jsonify }}
</script>
2014-01-23 14:59:22 +00:00
<script type="text/javascript" src="{{ STATIC_URL }}arachnys/js/d3.js"></script>
2014-02-03 19:40:45 -05:00
{% compress js %}
2014-01-23 14:59:22 +00:00
<script type="text/javascript" src="{{ STATIC_URL }}arachnys/js/rickshaw.js"></script>
2014-01-05 17:24:04 +00:00
<script type="text/coffeescript">
$(document).ready ->
data = window.SERVICE_HISTORY
2014-01-23 14:59:22 +00:00
labels = {
num_checks_active: 'blue'
num_checks_failing: '#f00'
}
processedData = formatDataForRickshaw data, labels
drawRickshaw processedData.series, labels, processedData.events
formatDataForRickshaw = (data, labels) ->
series = {}
events = []
for label, color of labels
series[label] = {
color: color
name: label
data: []
}
for slice in data
if slice.did_send_alert
events.push {time: slice.time, message: 'Sent alert'}
for label, color of labels
series[label].data.push
x: slice.time
y: slice[label]
ret = []
for line, val of series
ret.push val
return {
series: ret
events: events
}
drawRickshaw = (data, labels, events = []) ->
rickshawLine = new Rickshaw.Graph
renderer: 'line'
element: document.querySelector('#graph')
series: data
height: 140
rickshawLine.render()
hoverDetail = new Rickshaw.Graph.HoverDetail({graph: rickshawLine})
xAxis = new Rickshaw.Graph.Axis.Time({graph: rickshawLine})
xAxis.render()
yAxis = new Rickshaw.Graph.Axis.Y({graph: rickshawLine})
yAxis.render()
window.annotator = annotator = new Rickshaw.Graph.Annotate({
graph: rickshawLine
element: document.getElementById('timeline')
})
for evt in events
annotator.add evt.time, evt.message
annotator.update()
</script>
<script type="text/javascript">
$(function(){
$(':input.datepicker').datepicker({
dateFormat: 'yy-mm-dd',
buttonImage: '{{ STATIC_URL }}theme/img/calendar.gif',
buttonImageOnly: true,
showOn: 'button'
});
});
2014-01-05 17:24:04 +00:00
</script>
{% endcompress %}
{% endblock js %}