mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-07 08:08:15 -06:00
Show description disabled by default. Added IFACE_STATUS_CLASSES for labels.
This commit is contained in:
parent
79eda3a55d
commit
88095c020d
@ -56,6 +56,11 @@ IFACE_ENABLED_CHOICES = [
|
||||
[IFACE_ENABLED, 'Enabled'],
|
||||
]
|
||||
|
||||
IFACE_STATUS_CLASSES = {
|
||||
0: 'disabled',
|
||||
1: 'enabled',
|
||||
}
|
||||
|
||||
# Interface form factors
|
||||
# Virtual
|
||||
IFACE_FF_VIRTUAL = 0
|
||||
|
@ -1623,8 +1623,9 @@ class InterfaceListFilterForm(BootstrapMixin, forms.Form):
|
||||
device = forms.CharField(required=False, label='Device name')
|
||||
enabled = forms.ChoiceField(choices=add_blank_choice(IFACE_ENABLED_CHOICES), required=False)
|
||||
role = FilterChoiceField(
|
||||
required=False,
|
||||
queryset=DeviceRole.objects.annotate(filter_count=Count('devices')),
|
||||
to_field_name='slug',
|
||||
to_field_name='slug'
|
||||
)
|
||||
mac_address = forms.CharField(required=False, label='MAC address')
|
||||
|
||||
|
@ -1235,7 +1235,7 @@ class Interface(models.Model):
|
||||
return None
|
||||
|
||||
def get_status_class(self):
|
||||
return IFACE_ENABLED_CHOICES[self.enabled]
|
||||
return IFACE_STATUS_CLASSES[self.enabled]
|
||||
|
||||
# Used for export
|
||||
def to_csv(self):
|
||||
|
@ -388,8 +388,8 @@
|
||||
<button class="btn btn-default btn-xs toggle-ips" selected="selected">
|
||||
<span class="glyphicon glyphicon-check" aria-hidden="true"></span> Show IPs
|
||||
</button>
|
||||
<button class="btn btn-default btn-xs toggle-description" selected="selected">
|
||||
<span class="glyphicon glyphicon-check" aria-hidden="true"></span> Show Description
|
||||
<button class="btn btn-default btn-xs toggle-description">
|
||||
<span class="glyphicon glyphicon-check" aria-hidden="true"></span> Show Descriptions
|
||||
</button>
|
||||
{% if perms.dcim.change_interface and interfaces|length > 1 %}
|
||||
<button class="btn btn-default btn-xs toggle">
|
||||
|
@ -11,7 +11,7 @@
|
||||
<span class="label label-primary">{{ iface.lag.name }}</span>
|
||||
{% endif %}
|
||||
{% if iface.description %}
|
||||
<i class="fa fa-fw fa-comment-o" hidden="true" title="{{ iface.description }}"></i>
|
||||
<i class="fa fa-fw fa-comment-o" aria-hidden="true" title="{{ iface.description }}"></i>
|
||||
{% endif %}
|
||||
<td>
|
||||
{% if iface.description %}
|
||||
|
Loading…
Reference in New Issue
Block a user