Closes #20564: Many-to-many pass-through port mappings (#20851)

This commit is contained in:
Jeremy Stretch
2025-12-09 12:17:17 -05:00
committed by GitHub
parent 97d0a16fd4
commit 17d8f78ae3
35 changed files with 2512 additions and 941 deletions

View File

@@ -47,12 +47,8 @@
</td>
</tr>
<tr>
<th scope="row">{% trans "Rear Port" %}</th>
<td>{{ object.rear_port|linkify }}</td>
</tr>
<tr>
<th scope="row">{% trans "Rear Port Position" %}</th>
<td>{{ object.rear_port_position }}</td>
<th scope="row">{% trans "Positions" %}</th>
<td>{{ object.positions }}</td>
</tr>
<tr>
<th scope="row">{% trans "Description" %}</th>
@@ -62,6 +58,7 @@
</div>
{% include 'inc/panels/custom_fields.html' %}
{% include 'inc/panels/tags.html' %}
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-12 col-md-6">
@@ -126,7 +123,29 @@
</div>
{% endif %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
<div class="card">
<h2 class="card-header">{% trans "Port Mappings" %}</h2>
<table class="table table-hover">
{% if rear_port_mappings %}
<thead>
<tr>
<th>{% trans "Position" %}</th>
<th>{% trans "Rear Port" %}</th>
</tr>
</thead>
{% endif %}
{% for mapping in rear_port_mappings %}
<tr>
<td>{{ mapping.front_port_position }}</td>
<td>
<a href="{{ mapping.rear_port.get_absolute_url }}">{{ mapping.rear_port }}:{{ mapping.rear_port_position }}</a>
</td>
</tr>
{% empty %}
{% trans "No mappings defined" %}
{% endfor %}
</table>
</div>
{% plugin_right_page object %}
</div>
</div>

View File

@@ -58,6 +58,7 @@
</div>
{% include 'inc/panels/custom_fields.html' %}
{% include 'inc/panels/tags.html' %}
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-12 col-md-6">
@@ -116,7 +117,29 @@
</div>
{% endif %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
<div class="card">
<h2 class="card-header">{% trans "Port Mappings" %}</h2>
<table class="table table-hover">
{% if front_port_mappings %}
<thead>
<tr>
<th>{% trans "Position" %}</th>
<th>{% trans "Front Port" %}</th>
</tr>
</thead>
{% endif %}
{% for mapping in front_port_mappings %}
<tr>
<td>{{ mapping.rear_port_position }}</td>
<td>
<a href="{{ mapping.front_port.get_absolute_url }}">{{ mapping.front_port }}:{{ mapping.front_port_position }}</a>
</td>
</tr>
{% empty %}
{% trans "No mappings defined" %}
{% endfor %}
</table>
</div>
{% plugin_right_page object %}
</div>
</div>