diff --git a/hc/api/admin.py b/hc/api/admin.py index ee9b3763..e9e5a031 100644 --- a/hc/api/admin.py +++ b/hc/api/admin.py @@ -24,7 +24,7 @@ class ChecksAdmin(admin.ModelAdmin): class Media: css = { - 'all': ('css/admin/checks.css',) + 'all': ('css/admin/checks.css',) } search_fields = ["name", "user__email", "code"] @@ -34,7 +34,6 @@ class ChecksAdmin(admin.ModelAdmin): list_filter = ("status", OwnershipListFilter, "last_ping") actions = ["send_alert"] - def email(self, obj): return obj.user.email if obj.user else None @@ -44,7 +43,6 @@ class ChecksAdmin(admin.ModelAdmin): return "%s [%s]" % (obj.name, obj.tags) - def send_alert(self, request, qs): for check in qs: check.send_alert() @@ -141,6 +139,11 @@ class PingsAdmin(admin.ModelAdmin): @admin.register(Channel) class ChannelsAdmin(admin.ModelAdmin): + class Media: + css = { + 'all': ('css/admin/channels.css',) + } + search_fields = ["value", "user__email"] list_select_related = ("user", ) list_display = ("id", "code", "email", "formatted_kind", "value", diff --git a/static/css/admin/channels.css b/static/css/admin/channels.css new file mode 100644 index 00000000..093bd503 --- /dev/null +++ b/static/css/admin/channels.css @@ -0,0 +1,7 @@ +.field-value { + max-width: 400px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + +} \ No newline at end of file