@@ -184,6 +184,7 @@ class ISDAdmin(admin.ModelAdmin):
184
184
list_display = ('isd_id' , 'label' ,)
185
185
list_editable = ('label' ,)
186
186
ordering = ['isd_id' ]
187
+ search_fields = ('isd_id' , 'label' )
187
188
188
189
def get_readonly_fields (self , request , obj ):
189
190
"""
@@ -228,6 +229,7 @@ class HostAdminMixin:
228
229
HostInline (the ModelInline for Host in ASAdmin).
229
230
This is simply a bag of methods that can be used in readonly_fields/list_display.
230
231
"""
232
+
231
233
def latest_config_deployed (self , obj ):
232
234
return not obj .needs_config_deployment ()
233
235
@@ -589,6 +591,7 @@ class VPNAdmin(admin.ModelAdmin):
589
591
actions = ['update_key' ]
590
592
list_display = ('__str__' , 'server' , 'subnet' , 'server_vpn_ip' , 'num_clients' )
591
593
list_display_links = ('__str__' ,)
594
+ search_fields = ('subnet' , 'server__label' , 'server__AS__label' , 'server__AS__as_id' )
592
595
593
596
def get_form (self , request , obj = None , ** kwargs ):
594
597
"""
@@ -618,6 +621,7 @@ class VPNClientAdmin(admin.ModelAdmin):
618
621
list_display = ('__str__' , 'vpn' , 'ip' , 'common_name' )
619
622
list_display_links = ('__str__' ,)
620
623
list_filter = ('vpn' , 'active' )
624
+ search_fields = ('host__label' , 'host__AS__label' , 'host__AS__as_id' , 'host__AS__owner__email' )
621
625
622
626
def get_form (self , request , obj = None , ** kwargs ):
623
627
"""
@@ -718,6 +722,8 @@ class LinkAdmin(admin.ModelAdmin):
718
722
list_display = ('__str__' , 'type' , 'active' , 'public_ip_a' , 'public_port_a' , 'bind_ip_a' ,
719
723
'public_ip_b' , 'public_port_b' , 'bind_ip_b' ,)
720
724
list_filter = ('type' , 'active' , 'interfaceA__AS' , 'interfaceB__AS' ,)
725
+ search_fields = ('interfaceA__AS__as_id' , 'interfaceA__AS__label' , 'interfaceA__host__label' ,
726
+ 'interfaceB__AS__as_id' , 'interfaceB__AS__label' , 'interfaceB__host__label' )
721
727
722
728
def public_ip_a (self , obj ):
723
729
return obj .interfaceA .get_public_ip ()
@@ -746,6 +752,7 @@ class HostAdmin(HostAdminMixin, admin.ModelAdmin):
746
752
'internal_ip' , 'public_ip' , 'bind_ip' , 'ssh_host' ,
747
753
'latest_config_deployed' , 'get_scionlab_config_cmd' , 'get_config_link' )
748
754
list_filter = ('AS__isd' , 'AS' , )
755
+ search_fields = ('AS__as_id' , 'label' , 'ssh_host' )
749
756
ordering = ['AS' ]
750
757
751
758
def get_urls (self ):
0 commit comments