|
@ -24,7 +24,7 @@ class ChecksAdmin(admin.ModelAdmin): |
|
|
|
|
|
|
|
|
class Media: |
|
|
class Media: |
|
|
css = { |
|
|
css = { |
|
|
'all': ('css/admin/checks.css',) |
|
|
|
|
|
|
|
|
'all': ('css/admin/checks.css',) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
search_fields = ["name", "user__email", "code"] |
|
|
search_fields = ["name", "user__email", "code"] |
|
@ -34,7 +34,6 @@ class ChecksAdmin(admin.ModelAdmin): |
|
|
list_filter = ("status", OwnershipListFilter, "last_ping") |
|
|
list_filter = ("status", OwnershipListFilter, "last_ping") |
|
|
actions = ["send_alert"] |
|
|
actions = ["send_alert"] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def email(self, obj): |
|
|
def email(self, obj): |
|
|
return obj.user.email if obj.user else None |
|
|
return obj.user.email if obj.user else None |
|
|
|
|
|
|
|
@ -44,7 +43,6 @@ class ChecksAdmin(admin.ModelAdmin): |
|
|
|
|
|
|
|
|
return "%s [%s]" % (obj.name, obj.tags) |
|
|
return "%s [%s]" % (obj.name, obj.tags) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def send_alert(self, request, qs): |
|
|
def send_alert(self, request, qs): |
|
|
for check in qs: |
|
|
for check in qs: |
|
|
check.send_alert() |
|
|
check.send_alert() |
|
@ -141,6 +139,11 @@ class PingsAdmin(admin.ModelAdmin): |
|
|
|
|
|
|
|
|
@admin.register(Channel) |
|
|
@admin.register(Channel) |
|
|
class ChannelsAdmin(admin.ModelAdmin): |
|
|
class ChannelsAdmin(admin.ModelAdmin): |
|
|
|
|
|
class Media: |
|
|
|
|
|
css = { |
|
|
|
|
|
'all': ('css/admin/channels.css',) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
search_fields = ["value", "user__email"] |
|
|
search_fields = ["value", "user__email"] |
|
|
list_select_related = ("user", ) |
|
|
list_select_related = ("user", ) |
|
|
list_display = ("id", "code", "email", "formatted_kind", "value", |
|
|
list_display = ("id", "code", "email", "formatted_kind", "value", |
|
|