mirror of https://github.com/status-im/cabot.git
Fix check plugins not displaying checks correctly on service details
This commit is contained in:
parent
09793356de
commit
8450b0b466
5
CHANGES
5
CHANGES
|
@ -1,3 +1,8 @@
|
|||
master
|
||||
------
|
||||
|
||||
* Fix check plugins not displaying checks correctly on service details page
|
||||
|
||||
Version 0.11.6
|
||||
--------------
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ def get_custom_check_plugins():
|
|||
custom_check['creation_url'] = "create-" + check_name + "-check"
|
||||
custom_check['check_name'] = check_name
|
||||
custom_check['icon_class'] = getattr(check, "icon_class", "glyphicon-ok")
|
||||
custom_check['objects'] = check.objects
|
||||
custom_check_types.append(custom_check)
|
||||
|
||||
return custom_check_types
|
||||
|
|
|
@ -19,3 +19,7 @@ def echo_setting(setting):
|
|||
def format_timedelta(delta):
|
||||
# Getting rid of microseconds.
|
||||
return str(timedelta(days=delta.days, seconds=delta.seconds))
|
||||
|
||||
@register.filter
|
||||
def for_service(objects, service):
|
||||
return objects.filter(service=service)
|
||||
|
|
|
@ -103,11 +103,9 @@
|
|||
|
||||
{% include 'cabotapp/_statuscheck_list.html' with checks=service.jenkins_status_checks.all service=service checks_type="Jenkins" %}
|
||||
|
||||
{% for custom_check in custom_check_types %}
|
||||
<hr>
|
||||
|
||||
{% for check_class in custom_check_types %}
|
||||
<hr>
|
||||
{% include 'cabotapp/_statuscheck_list.html' with checks=check_class.objects.all service=service checks_type=check_class.check_name %}
|
||||
{% include 'cabotapp/_statuscheck_list.html' with checks=custom_check.objects|for_service:service service=service checks_type=custom_check.check_name %}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
|
||||
|
|
Loading…
Reference in New Issue