diff --git a/hc/api/admin.py b/hc/api/admin.py index 00f77a7d..e7c3294f 100644 --- a/hc/api/admin.py +++ b/hc/api/admin.py @@ -5,9 +5,18 @@ from hc.api.models import Check @admin.register(Check) class ChecksAdmin(admin.ModelAdmin): - list_display = ("id", "code", "user", "last_ping") + class Media: + css = { + 'all': ('css/admin/checks.css',) + } + + list_display = ("id", "name", "created", "code", "status", "email", "last_ping") + list_select_related = ("user", ) actions = ["send_alert"] + def email(self, obj): + return obj.user.email if obj.user else None + def send_alert(self, request, qs): for check in qs: check.send_alert() diff --git a/static/css/admin/checks.css b/static/css/admin/checks.css new file mode 100644 index 00000000..e91d22ff --- /dev/null +++ b/static/css/admin/checks.css @@ -0,0 +1,3 @@ +.field-code { + font-family: monospace; +} \ No newline at end of file