Add link to jenkins job from service-checks dashboard

This commit is contained in:
Alexander James Phillips 2014-01-14 17:24:56 +00:00
parent 0918e82b65
commit a2ca3f918e
3 changed files with 16 additions and 0 deletions

View File

View File

@ -0,0 +1,9 @@
from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag
def jenkins_human_url(jobname):
return '{}job/{}/'.format(settings.JENKINS_API, jobname)

View File

@ -1,3 +1,5 @@
{% load extra %}
<div class="row">
<div class="col-xs-12">
<div class="col-xs-1"><h3><i class="{% if checks_type == "All" %}fa fa-cog{% else %}glyphicon glyphicon-{% if checks_type == "Http" %}arrow-up{% elif checks_type == "Jenkins" %}ok{% else %}signal{% endif %}{% endif %}"></i></h3></div>
@ -91,6 +93,11 @@
<a class="btn btn-xs" href="{% url run-check pk=check.id %}">
<i class="glyphicon glyphicon-refresh"></i><span class="break"></span>
</a>
{% if checks_type == "Jenkins" %}
<a class="btn btn-xs" href="{% jenkins_human_url check.name %}">
<i class="glyphicon glyphicon-link"></i><span class="break"></span>
</a>
{% endif %}
</td>
</tr>
{% endfor %}