mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Optimized front/rear port connection displays
This commit is contained in:
parent
05431aa83b
commit
17a71d3e26
@ -1,46 +1,44 @@
|
|||||||
{% with cable=frontport.get_connected_cable %}
|
<tr class="frontport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
|
||||||
<tr class="frontport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
|
|
||||||
|
|
||||||
{# Checkbox #}
|
{# Checkbox #}
|
||||||
{% if perms.dcim.change_frontport or perms.dcim.delete_frontport %}
|
{% if perms.dcim.change_frontport or perms.dcim.delete_frontport %}
|
||||||
<td class="pk">
|
<td class="pk">
|
||||||
<input name="pk" type="checkbox" value="{{ frontport.pk }}" />
|
<input name="pk" type="checkbox" value="{{ frontport.pk }}" />
|
||||||
</td>
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# Name #}
|
||||||
|
<td>
|
||||||
|
<i class="fa fa-fw fa-square{% if not cable %}-o{% endif %}"></i> {{ frontport }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
{# Type #}
|
||||||
|
<td>{{ frontport.get_type_display }}</td>
|
||||||
|
|
||||||
|
{# Rear port #}
|
||||||
|
<td>{{ frontport.rear_port }}</td>
|
||||||
|
<td>{{ frontport.rear_port_position }}</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% if frontport.cable %}
|
||||||
|
<a href="{{ frontport.cable.get_absolute_url }}">{{ frontport.cable }}</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="text-muted">Not connected</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Name #}
|
{# Actions #}
|
||||||
<td>
|
<td class="text-right">
|
||||||
<i class="fa fa-fw fa-square{% if not cable %}-o{% endif %}"></i> {{ frontport }}
|
{% if perms.dcim.change_frontport %}
|
||||||
</td>
|
<a href="{% url 'dcim:frontport_edit' pk=frontport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
|
||||||
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
||||||
{# Type #}
|
</a>
|
||||||
<td>{{ frontport.get_type_display }}</td>
|
{% endif %}
|
||||||
|
{% if perms.dcim.delete_frontport %}
|
||||||
{# Rear port #}
|
<a href="{% url 'dcim:frontport_delete' pk=frontport.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
|
||||||
<td>{{ frontport.rear_port }}</td>
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
||||||
<td>{{ frontport.rear_port_position }}</td>
|
</a>
|
||||||
|
{% endif %}
|
||||||
{# Cable #}
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
{% if cable %}
|
|
||||||
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
|
||||||
{% else %}
|
|
||||||
<span class="text-muted">Not connected</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Actions #}
|
|
||||||
<td class="text-right">
|
|
||||||
{% if perms.dcim.change_frontport %}
|
|
||||||
<a href="{% url 'dcim:frontport_edit' pk=frontport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
|
|
||||||
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if perms.dcim.delete_frontport %}
|
|
||||||
<a href="{% url 'dcim:frontport_delete' pk=frontport.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
|
|
||||||
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endwith %}
|
|
||||||
|
@ -1,45 +1,43 @@
|
|||||||
{% with cable=rearport.get_connected_cable %}
|
<tr class="rearport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
|
||||||
<tr class="rearport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
|
|
||||||
|
|
||||||
{# Checkbox #}
|
{# Checkbox #}
|
||||||
{% if perms.dcim.change_rearport or perms.dcim.delete_rearport %}
|
{% if perms.dcim.change_rearport or perms.dcim.delete_rearport %}
|
||||||
<td class="pk">
|
<td class="pk">
|
||||||
<input name="pk" type="checkbox" value="{{ rearport.pk }}" />
|
<input name="pk" type="checkbox" value="{{ rearport.pk }}" />
|
||||||
</td>
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# Name #}
|
||||||
|
<td>
|
||||||
|
<i class="fa fa-fw fa-square{% if not cable %}-o{% endif %}"></i> {{ rearport }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
{# Type #}
|
||||||
|
<td>{{ rearport.get_type_display }}</td>
|
||||||
|
|
||||||
|
{# Positions #}
|
||||||
|
<td>{{ rearport.positions }}</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% if rearport.cable %}
|
||||||
|
<a href="{{ rearport.cable.get_absolute_url }}">{{ rearport.cable }}</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="text-muted">Not connected</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Name #}
|
{# Actions #}
|
||||||
<td>
|
<td class="text-right">
|
||||||
<i class="fa fa-fw fa-square{% if not cable %}-o{% endif %}"></i> {{ rearport }}
|
{% if perms.dcim.change_rearport %}
|
||||||
</td>
|
<a href="{% url 'dcim:rearport_edit' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
|
||||||
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
||||||
{# Type #}
|
</a>
|
||||||
<td>{{ rearport.get_type_display }}</td>
|
{% endif %}
|
||||||
|
{% if perms.dcim.delete_rearport %}
|
||||||
{# Positions #}
|
<a href="{% url 'dcim:rearport_delete' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
|
||||||
<td>{{ rearport.positions }}</td>
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
{# Cable #}
|
{% endif %}
|
||||||
<td>
|
</td>
|
||||||
{% if cable %}
|
</tr>
|
||||||
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
|
||||||
{% else %}
|
|
||||||
<span class="text-muted">Not connected</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Actions #}
|
|
||||||
<td class="text-right">
|
|
||||||
{% if perms.dcim.change_rearport %}
|
|
||||||
<a href="{% url 'dcim:rearport_edit' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
|
|
||||||
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if perms.dcim.delete_rearport %}
|
|
||||||
<a href="{% url 'dcim:rearport_delete' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
|
|
||||||
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endwith %}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user