Browse Source

Limit "value" column width in channel admin

pull/81/head
Pēteris Caune 8 years ago
parent
commit
63b10b40ce
2 changed files with 13 additions and 3 deletions
  1. +6
    -3
      hc/api/admin.py
  2. +7
    -0
      static/css/admin/channels.css

+ 6
- 3
hc/api/admin.py View File

@ -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",


+ 7
- 0
static/css/admin/channels.css View File

@ -0,0 +1,7 @@
.field-value {
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

Loading…
Cancel
Save