mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Swapped the order of cable and connection fields
This commit is contained in:
@@ -2392,9 +2392,7 @@ class Cable(ChangeLoggedModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.label:
|
return self.label if self.label else '#{}'.format(self.pk)
|
||||||
return '{} (#{})'.format(self.label, self.pk)
|
|
||||||
return '#{}'.format(self.pk)
|
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('dcim:cable', args=[self.pk])
|
return reverse('dcim:cable', args=[self.pk])
|
||||||
|
@@ -526,8 +526,8 @@
|
|||||||
<th>LAG</th>
|
<th>LAG</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
<th>Mode</th>
|
<th>Mode</th>
|
||||||
<th colspan="2">Connection</th>
|
|
||||||
<th>Cable</th>
|
<th>Cable</th>
|
||||||
|
<th colspan="2">Connection</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -590,8 +590,8 @@
|
|||||||
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
|
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th colspan="2">Connection</th>
|
|
||||||
<th>Cable</th>
|
<th>Cable</th>
|
||||||
|
<th colspan="2">Connection</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -649,8 +649,8 @@
|
|||||||
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
|
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th colspan="2">Connection</th>
|
|
||||||
<th>Cable</th>
|
<th>Cable</th>
|
||||||
|
<th colspan="2">Connection</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@@ -5,6 +5,15 @@
|
|||||||
<i class="fa fa-fw fa-keyboard-o"></i> {{ cp }}
|
<i class="fa fa-fw fa-keyboard-o"></i> {{ cp }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% with cable=cp.get_connected_cable %}
|
||||||
|
{% if cable %}
|
||||||
|
via <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Connection #}
|
{# Connection #}
|
||||||
{% if cp.connected_endpoint %}
|
{% if cp.connected_endpoint %}
|
||||||
<td>
|
<td>
|
||||||
@@ -19,15 +28,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Cable #}
|
|
||||||
<td>
|
|
||||||
{% with cable=cp.get_connected_cable %}
|
|
||||||
{% if cable %}
|
|
||||||
via <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Actions #}
|
{# Actions #}
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% if perms.dcim.change_consoleport %}
|
{% if perms.dcim.change_consoleport %}
|
||||||
|
@@ -12,6 +12,18 @@
|
|||||||
<i class="fa fa-fw fa-keyboard-o"></i> {{ csp }}
|
<i class="fa fa-fw fa-keyboard-o"></i> {{ csp }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% with cable=csp.get_connected_cable %}
|
||||||
|
{% if cable %}
|
||||||
|
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
||||||
|
{% if cable.far_end != csp.connected_endpoint %}
|
||||||
|
to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Connection #}
|
{# Connection #}
|
||||||
{% if csp.connected_endpoint %}
|
{% if csp.connected_endpoint %}
|
||||||
<td>
|
<td>
|
||||||
@@ -26,18 +38,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Cable #}
|
|
||||||
<td>
|
|
||||||
{% with cable=csp.get_connected_cable %}
|
|
||||||
{% if cable %}
|
|
||||||
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
|
||||||
{% if cable.far_end != csp.connected_endpoint %}
|
|
||||||
to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Actions #}
|
{# Actions #}
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% if perms.dcim.change_consoleserverport %}
|
{% if perms.dcim.change_consoleserverport %}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
{# Cable #}
|
{# Cable #}
|
||||||
<td>
|
<td>
|
||||||
{% if cable %}
|
{% 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> <a href="{{ cable.far_end.get_absolute_url }}">{{ cable.far_end }}</a>
|
<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 %}
|
{% else %}
|
||||||
<span class="text-muted">Not connected</span>
|
<span class="text-muted">Not connected</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -28,6 +28,18 @@
|
|||||||
{# 802.1Q mode #}
|
{# 802.1Q mode #}
|
||||||
<td>{{ iface.get_mode_display }}</td>
|
<td>{{ iface.get_mode_display }}</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% with cable=iface.get_connected_cable %}
|
||||||
|
{% if cable %}
|
||||||
|
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
||||||
|
{% if cable.far_end != csp.connected_endpoint %}
|
||||||
|
to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Connection or type #}
|
{# Connection or type #}
|
||||||
{% if iface.is_lag %}
|
{% if iface.is_lag %}
|
||||||
<td colspan="2" class="text-muted">
|
<td colspan="2" class="text-muted">
|
||||||
@@ -69,18 +81,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Cable #}
|
|
||||||
<td>
|
|
||||||
{% with cable=iface.get_connected_cable %}
|
|
||||||
{% if cable %}
|
|
||||||
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
|
||||||
{% if cable.far_end != csp.connected_endpoint %}
|
|
||||||
to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Buttons #}
|
{# Buttons #}
|
||||||
<td class="text-right text-nowrap">
|
<td class="text-right text-nowrap">
|
||||||
{% if show_graphs %}
|
{% if show_graphs %}
|
||||||
|
@@ -12,6 +12,15 @@
|
|||||||
<i class="fa fa-fw fa-bolt"></i> {{ po }}
|
<i class="fa fa-fw fa-bolt"></i> {{ po }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% with cable=po.get_connected_cable %}
|
||||||
|
{% if cable %}
|
||||||
|
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Connection #}
|
{# Connection #}
|
||||||
{% if po.connected_endpoint %}
|
{% if po.connected_endpoint %}
|
||||||
<td>
|
<td>
|
||||||
@@ -26,15 +35,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Cable #}
|
|
||||||
<td>
|
|
||||||
{% with cable=po.get_connected_cable %}
|
|
||||||
{% if cable %}
|
|
||||||
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Actions #}
|
{# Actions #}
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% if perms.dcim.change_poweroutlet %}
|
{% if perms.dcim.change_poweroutlet %}
|
||||||
|
@@ -5,6 +5,15 @@
|
|||||||
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
|
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
{# Cable #}
|
||||||
|
<td>
|
||||||
|
{% with cable=pp.get_connected_cable %}
|
||||||
|
{% if cable %}
|
||||||
|
via <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
</td>
|
||||||
|
|
||||||
{# Connection #}
|
{# Connection #}
|
||||||
{% if pp.connected_endpoint %}
|
{% if pp.connected_endpoint %}
|
||||||
<td>
|
<td>
|
||||||
@@ -19,15 +28,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Cable #}
|
|
||||||
<td>
|
|
||||||
{% with cable=pp.get_connected_cable %}
|
|
||||||
{% if cable %}
|
|
||||||
via <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{# Actions #}
|
{# Actions #}
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% if perms.dcim.change_powerport %}
|
{% if perms.dcim.change_powerport %}
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
{# Cable #}
|
{# Cable #}
|
||||||
<td>
|
<td>
|
||||||
{% if cable %}
|
{% 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> <a href="{{ cable.far_end.get_absolute_url }}">{{ cable.far_end }}</a>
|
<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 %}
|
{% else %}
|
||||||
<span class="text-muted">Not connected</span>
|
<span class="text-muted">Not connected</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user