@@ -53,6 +53,14 @@ def get_cabletermination_row_class(record):
5353 return ''
5454
5555
56+ def get_interface_row_class (record ):
57+ if not record .enabled :
58+ return 'danger'
59+ elif record .is_virtual :
60+ return 'primary'
61+ return get_cabletermination_row_class (record )
62+
63+
5664def get_interface_state_attribute (record ):
5765 """
5866 Get interface enabled state as string to attach to <tr/> DOM element.
@@ -501,8 +509,8 @@ class Meta(DeviceComponentTable.Meta):
501509
502510class DeviceInterfaceTable (InterfaceTable ):
503511 name = tables .TemplateColumn (
504- template_code = '<i class="mdi mdi-{% if iface .mgmt_only %}wrench{% elif iface .is_lag %}drag -horizontal-variant '
505- '{% elif iface .is_virtual %}circle{% elif iface .is_wireless %}wifi{% else %}ethernet'
512+ template_code = '<i class="mdi mdi-{% if record .mgmt_only %}wrench{% elif record .is_lag %}reorder -horizontal'
513+ '{% elif record .is_virtual %}circle{% elif record .is_wireless %}wifi{% else %}ethernet'
506514 '{% endif %}"></i> <a href="{{ record.get_absolute_url }}">{{ value }}</a>' ,
507515 order_by = Accessor ('_name' ),
508516 attrs = {'td' : {'class' : 'text-nowrap' }}
@@ -534,7 +542,7 @@ class Meta(DeviceComponentTable.Meta):
534542 'cable' , 'connection' , 'actions' ,
535543 )
536544 row_attrs = {
537- 'class' : get_cabletermination_row_class ,
545+ 'class' : get_interface_row_class ,
538546 'data-name' : lambda record : record .name ,
539547 'data-enabled' : get_interface_state_attribute ,
540548 }
@@ -653,7 +661,8 @@ class DeviceBayTable(DeviceComponentTable):
653661 }
654662 )
655663 status = tables .TemplateColumn (
656- template_code = DEVICEBAY_STATUS
664+ template_code = DEVICEBAY_STATUS ,
665+ order_by = Accessor ('installed_device__status' )
657666 )
658667 installed_device = tables .Column (
659668 linkify = True
0 commit comments