mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 12:06:53 -06:00
Closes #6881: Wrap interface IP addresses in a badge that displays status and/or role
This commit is contained in:
parent
9a8d33e6bf
commit
a71604e79f
@ -41,9 +41,19 @@ DEVICEBAY_STATUS = """
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
INTERFACE_IPADDRESSES = """
|
INTERFACE_IPADDRESSES = """
|
||||||
{% for ip in record.ip_addresses.all %}
|
<div class="table-badge-group">
|
||||||
<a href="{{ ip.get_absolute_url }}">{{ ip }}</a><br />
|
{% for ip in record.ip_addresses.all %}
|
||||||
{% endfor %}
|
<a
|
||||||
|
class="table-badge{% if ip.status != 'active' %} badge bg-{{ ip.get_status_class }}{% elif ip.role %} badge bg-{{ ip.get_role_class }}{% endif %}"
|
||||||
|
href="{{ ip.get_absolute_url }}"
|
||||||
|
{% if ip.status != 'active'%}data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}"
|
||||||
|
{% elif ip.role %}data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_role_display }}"
|
||||||
|
{% endif %}
|
||||||
|
>
|
||||||
|
{{ ip }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
INTERFACE_TAGGED_VLANS = """
|
INTERFACE_TAGGED_VLANS = """
|
||||||
|
BIN
netbox/project-static/dist/netbox-dark.css
vendored
BIN
netbox/project-static/dist/netbox-dark.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox-light.css
vendored
BIN
netbox/project-static/dist/netbox-light.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox-print.css
vendored
BIN
netbox/project-static/dist/netbox-print.css
vendored
Binary file not shown.
@ -797,6 +797,24 @@ table tbody {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Style objects with statuses/roles within a table. As of implementation, used for IP addresses
|
||||||
|
// assigned to interfaces.
|
||||||
|
table .table-badge-group {
|
||||||
|
font-family: $font-family-monospace;
|
||||||
|
|
||||||
|
.table-badge {
|
||||||
|
display: block;
|
||||||
|
width: min-content;
|
||||||
|
// Apply badge padding so that IP addresses *not* within a badge appear aligned with IP
|
||||||
|
// addresses that *are* within a badge.
|
||||||
|
padding: $badge-padding-y $badge-padding-x;
|
||||||
|
margin-top: map.get($spacers, 1);
|
||||||
|
margin-bottom: map.get($spacers, 1);
|
||||||
|
font-size: $font-size-xs;
|
||||||
|
font-weight: $font-weight-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pre.change-data {
|
pre.change-data {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user