Merge branch 'feature' into 8366-job-scheduling

Sync with upstream
This commit is contained in:
kkthxbye-code
2022-10-09 11:18:47 +02:00
194 changed files with 3775 additions and 2449 deletions

View File

@@ -19,17 +19,6 @@
<h5 class="card-header">Provider</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">ASN</th>
<td>
{% if object.asn %}
<div class="float-end text-warning">
<i class="mdi mdi-alert" title="This field will be removed in a future release. Please migrate this data to ASN objects."></i>
</div>
{% endif %}
{{ object.asn|placeholder }}
</td>
</tr>
<tr>
<th scope="row">ASNs</th>
<td>
@@ -44,24 +33,6 @@
<th scope="row">Account</th>
<td>{{ object.account|placeholder }}</td>
</tr>
<tr>
<th scope="row">Customer Portal</th>
<td>
{% if object.portal_url %}
<a href="{{ object.portal_url }}">{{ object.portal_url }}</a>
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">NOC Contact</th>
<td>{{ object.noc_contact|markdown|placeholder }}</td>
</tr>
<tr>
<th scope="row">Admin Contact</th>
<td>{{ object.admin_contact|markdown|placeholder }}</td>
</tr>
<tr>
<th scope="row">Circuits</th>
<td>

View File

@@ -54,80 +54,40 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
</h5>
<div class="card-body">
{% if object.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:consoleport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% if object.connected_endpoint %}
<tr>
<th scope="row">Device</th>
<td>{{ object.connected_endpoint.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<td>{{ object.connected_endpoint|linkify:"name" }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ object.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.connected_endpoint.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleserverport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Console Server Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
</li>
</ul>
</div>
{% endif %}
</div>
{% endif %}
<div class="card">
<h5 class="card-header">Connection</h5>
<div class="card-body">
{% if object.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' %}
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleserverport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Console Server Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
</li>
</ul>
</div>
{% endif %}
</div>
{% endif %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">

View File

@@ -54,82 +54,40 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
</h5>
<div class="card-body">
{% if object.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:consoleserverport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% if object.connected_endpoint %}
<tr>
<th scope="row">Device</th>
<td>
{{ object.connected_endpoint.device|linkify }}
</td>
</tr>
<tr>
<th scope="row">Name</th>
<td>{{ object.connected_endpoint|linkify:"name" }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ object.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.connected_endpoint.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Console Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
</li>
</ul>
</div>
{% endif %}
<div class="card">
<h5 class="card-header">Connection</h5>
<div class="card-body">
{% if object.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' %}
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Console Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
</li>
</ul>
</div>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">

View File

@@ -7,7 +7,7 @@
{% block content %}
<div class="row">
<div class="col col-md-6">
<div class="col col-12 col-xl-6">
<div class="card">
<h5 class="card-header">
Device
@@ -66,7 +66,7 @@
{% with object.parent_bay.device as parent %}
{{ parent|linkify }} / {{ object.parent_bay }}
{% if parent.position %}
(U{{ parent.position }} / {{ parent.get_face_display }})
(U{{ parent.position|floatformat }} / {{ parent.get_face_display }})
{% endif %}
{% endwith %}
{% elif object.rack and object.position %}
@@ -90,7 +90,7 @@
<tr>
<th scope="row">Device Type</th>
<td>
{{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height }}U)
{{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height|floatformat }}U)
</td>
</tr>
<tr>
@@ -153,7 +153,7 @@
{% include 'inc/panels/comments.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="col col-12 col-xl-6">
<div class="card">
<h5 class="card-header">Management</h5>
<div class="card-body">
@@ -286,6 +286,22 @@
</div>
{% include 'inc/panels/contacts.html' %}
{% include 'inc/panels/image_attachments.html' %}
{% if object.rack and object.position %}
<div class="row" style="margin-bottom: 20px">
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Front</h4>
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='front' extra_params=svg_extra %}
</div>
</div>
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Rear</h4>
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='rear' extra_params=svg_extra %}
</div>
</div>
</div>
{% endif %}
{% plugin_right_page object %}
</div>
</div>

View File

@@ -54,113 +54,3 @@
</div>
{% endif %}
{% endblock %}
{% block extra_tabs %}
{% with tab_name='device-bays' devicebay_count=object.devicebays.count %}
{% if active_tab == tab_name or devicebay_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_devicebays' pk=object.pk %}">Device Bays {% badge devicebay_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='module-bays' modulebay_count=object.modulebays.count %}
{% if active_tab == tab_name or modulebay_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_modulebays' pk=object.pk %}">Module Bays {% badge modulebay_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='interfaces' interface_count=object.interfaces_count %}
{% if active_tab == tab_name or interface_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_interfaces' pk=object.pk %}">Interfaces {% badge interface_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='front-ports' frontport_count=object.frontports.count %}
{% if active_tab == tab_name or frontport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_frontports' pk=object.pk %}">Front Ports {% badge frontport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='rear-ports' rearport_count=object.rearports.count %}
{% if active_tab == tab_name or rearport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_rearports' pk=object.pk %}">Rear Ports {% badge rearport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='console-ports' consoleport_count=object.consoleports.count %}
{% if active_tab == tab_name or consoleport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_consoleports' pk=object.pk %}">Console Ports {% badge consoleport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='console-server-ports' consoleserverport_count=object.consoleserverports.count %}
{% if active_tab == tab_name or consoleserverport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_consoleserverports' pk=object.pk %}">Console Server Ports {% badge consoleserverport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='power-ports' powerport_count=object.powerports.count %}
{% if active_tab == tab_name or powerport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_powerports' pk=object.pk %}">Power Ports {% badge powerport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='power-outlets' poweroutlet_count=object.poweroutlets.count %}
{% if active_tab == tab_name or poweroutlet_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_poweroutlets' pk=object.pk %}">Power Outlets {% badge poweroutlet_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='inventory-items' inventoryitem_count=object.inventoryitems.count %}
{% if active_tab == tab_name or inventoryitem_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:device_inventory' pk=object.pk %}">Inventory {% badge inventoryitem_count %}</a>
</li>
{% endif %}
{% endwith %}
{% if perms.dcim.napalm_read_device and object.status == 'active' and object.primary_ip and object.platform.napalm_driver %}
{# NAPALM-enabled tabs #}
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'status' %} active{% endif %}" href="{% url 'dcim:device_status' pk=object.pk %}">
Status
</a>
</li>
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'lldp-neighbors' %} active{% endif %}" href="{% url 'dcim:device_lldp_neighbors' pk=object.pk %}">
LLDP Neighbors
</a>
</li>
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'config' %} active{% endif %}" href="{% url 'dcim:device_config' pk=object.pk %}">
Configuration
</a>
</li>
{% endif %}
{% if perms.extras.view_configcontext %}
<li role="presentation" class="nav-item">
<a href="{% url 'dcim:device_configcontext' pk=object.pk %}" class="nav-link{% if active_tab == 'config-context' %} active{% endif %}">
Config Context
</a>
</li>
{% endif %}
{% endblock %}

View File

@@ -29,12 +29,22 @@
</tr>
<tr>
<td>Height (U)</td>
<td>{{ object.u_height }}</td>
<td>{{ object.u_height|floatformat }}</td>
</tr>
<tr>
<td>Full Depth</td>
<td>{% checkmark object.is_full_depth %}</td>
</tr>
<tr>
<td>Weight</td>
<td>
{% if object.weight %}
{{ object.weight|floatformat }} {{ object.get_weight_unit_display }}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<td>Parent/Child</td>
<td>

View File

@@ -51,85 +51,3 @@
</div>
{% endif %}
{% endblock %}
{% block extra_tabs %}
{% with tab_name='device-bay-templates' devicebay_count=object.devicebaytemplates.count %}
{% if active_tab == tab_name or devicebay_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_devicebays' pk=object.pk %}">Device Bays {% badge devicebay_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='module-bay-templates' modulebay_count=object.modulebaytemplates.count %}
{% if active_tab == tab_name or modulebay_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_modulebays' pk=object.pk %}">Module Bays {% badge modulebay_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='interface-templates' interface_count=object.interfacetemplates.count %}
{% if active_tab == tab_name or interface_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_interfaces' pk=object.pk %}">Interfaces {% badge interface_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='front-port-templates' frontport_count=object.frontporttemplates.count %}
{% if active_tab == tab_name or frontport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_frontports' pk=object.pk %}">Front Ports {% badge frontport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='rear-port-templates' rearport_count=object.rearporttemplates.count %}
{% if active_tab == tab_name or rearport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_rearports' pk=object.pk %}">Rear Ports {% badge rearport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='console-port-templates' consoleport_count=object.consoleporttemplates.count %}
{% if active_tab == tab_name or consoleport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_consoleports' pk=object.pk %}">Console Ports {% badge consoleport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='console-server-port-templates' consoleserverport_count=object.consoleserverporttemplates.count %}
{% if active_tab == tab_name or consoleserverport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_consoleserverports' pk=object.pk %}">Console Server Ports {% badge consoleserverport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='power-port-templates' powerport_count=object.powerporttemplates.count %}
{% if active_tab == tab_name or powerport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_powerports' pk=object.pk %}">Power Ports {% badge powerport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='power-outlet-templates' poweroutlet_count=object.poweroutlettemplates.count %}
{% if active_tab == tab_name or poweroutlet_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_poweroutlets' pk=object.pk %}">Power Outlets {% badge poweroutlet_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with tab_name='inventory-item-templates' inventoryitem_count=object.inventoryitemtemplates.count %}
{% if active_tab == tab_name or inventoryitem_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == tab_name %} active{% endif %}" href="{% url 'dcim:devicetype_inventoryitems' pk=object.pk %}">Inventory Items {% badge inventoryitem_count %}</a>
</li>
{% endif %}
{% endwith %}
{% endblock %}

View File

@@ -1,14 +0,0 @@
<td>
{% if termination.parent_object.provider %}
<i class="mdi mdi-lightning-bolt" title="Circuit"></i>
<a href="{{ termination.parent_object.get_absolute_url }}">
{{ termination.parent_object.provider }}
{{ termination.parent_object }}
</a>
{% else %}
{{ termination.parent_object|linkify }}
{% endif %}
</td>
<td>
{{ termination|linkify }}
</td>

View File

@@ -0,0 +1,36 @@
<table class="table table-hover">
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_complete and object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Path Endpoints</th>
<td>
{% for endpoint in object.connected_endpoints %}
{% if endpoint.parent_object %}
{{ endpoint.parent_object|linkify }}
<i class="mdi mdi-chevron-right"></i>
{% endif %}
{{ endpoint|linkify }}
{% if not forloop.last %}<br />{% endif %}
{% empty %}
{{ ''|placeholder }}
{% endfor %}
</td>
</tr>
</table>

View File

@@ -144,89 +144,7 @@
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
</div>
{% elif object.cable %}
<table class="table table-hover">
{% if object.connected_endpoint.device %}
<tr>
<td colspan="2">
{% if object.connected_endpoint.enabled %}
<span class="badge bg-success">Enabled</span>
{% else %}
<span class="badge bg-danger">Disabled</span>
{% endif %}
</td>
</tr>
{% endif %}
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% if object.connected_endpoint.device %}
{% with iface=object.connected_endpoint %}
<tr>
<th scope="row">Device</th>
<td>{{ iface.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<td>{{ iface|linkify:"name" }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ iface.get_type_display }}</td>
</tr>
<tr>
<th scope="row">LAG</th>
<td>{{ iface.lag|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ iface.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">MTU</th>
<td>{{ iface.mtu|placeholder }}</td>
</tr>
<tr>
<th scope="row">MAC Address</th>
<td>{{ iface.mac_address|placeholder }}</td>
</tr>
<tr>
<th scope="row">802.1Q Mode</th>
<td>{{ iface.get_mode_display }}</td>
</tr>
{% endwith %}
{% elif object.connected_endpoint.circuit %}
{% with ct=object.connected_endpoint %}
<tr>
<th scope="row">Provider</th>
<td>{{ ct.circuit.provider|linkify }}</td>
</tr>
<tr>
<th scope="row">Circuit</th>
<td>{{ ct.circuit|linkify }}</td>
</tr>
<tr>
<th scope="row">Side</th>
<td>{{ ct.term_side }}</td>
</tr>
{% endwith %}
{% endif %}
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_complete and object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
</table>
{% include 'dcim/inc/connection_endpoints.html' %}
{% elif object.wireless_link %}
<table class="table table-hover">
<tr>
@@ -238,7 +156,7 @@
</a>
</td>
</tr>
{% with peer_interface=object.connected_endpoint %}
{% with peer_interface=object.link_peers.0 %}
<tr>
<th scope="row">Device</th>
<td>{{ peer_interface.device|linkify }}</td>

View File

@@ -22,6 +22,16 @@
<td>Part Number</td>
<td>{{ object.part_number|placeholder }}</td>
</tr>
<tr>
<td>Weight</td>
<td>
{% if object.weight %}
{{ object.weight|floatformat }} {{ object.get_weight_unit_display }}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<td>Instances</td>
<td><a href="{% url 'dcim:module_list' %}?module_type_id={{ object.pk }}">{{ instance_count }}</a></td>

View File

@@ -42,61 +42,3 @@
</div>
{% endif %}
{% endblock %}
{% block extra_tabs %}
{% with interface_count=object.interfacetemplates.count %}
{% if interface_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'interface-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_interfaces' pk=object.pk %}">Interfaces {% badge interface_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with frontport_count=object.frontporttemplates.count %}
{% if frontport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'front-port-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_frontports' pk=object.pk %}">Front Ports {% badge frontport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with rearport_count=object.rearporttemplates.count %}
{% if rearport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'rear-port-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_rearports' pk=object.pk %}">Rear Ports {% badge rearport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with consoleport_count=object.consoleporttemplates.count %}
{% if consoleport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'console-port-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_consoleports' pk=object.pk %}">Console Ports {% badge consoleport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with consoleserverport_count=object.consoleserverporttemplates.count %}
{% if consoleserverport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'console-server-port-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_consoleserverports' pk=object.pk %}">Console Server Ports {% badge consoleserverport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with powerport_count=object.powerporttemplates.count %}
{% if powerport_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'power-port-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_powerports' pk=object.pk %}">Power Ports {% badge powerport_count %}</a>
</li>
{% endif %}
{% endwith %}
{% with poweroutlet_count=object.poweroutlettemplates.count %}
{% if poweroutlet_count %}
<li role="presentation" class="nav-item">
<a class="nav-link {% if active_tab == 'power-outlet-templates' %} active{% endif %}" href="{% url 'dcim:moduletype_poweroutlets' pk=object.pk %}">Power Outlets {% badge poweroutlet_count %}</a>
</li>
{% endif %}
{% endwith %}
{% endblock %}

View File

@@ -41,8 +41,8 @@
<tr>
<th scope="row">Connected Device</th>
<td>
{% if object.connected_endpoint %}
{{ object.connected_endpoint.device|linkify }} ({{ object.connected_endpoint }})
{% if object.connected_endpoints %}
{{ object.connected_endpoints.0.device|linkify }} ({{ object.connected_endpoints.0|linkify:"name" }})
{% else %}
{{ ''|placeholder }}
{% endif %}
@@ -50,7 +50,7 @@
</tr>
<tr>
<th scope="row">Utilization (Allocated)</th>
{% with utilization=object.connected_endpoint.get_power_draw %}
{% with utilization=object.connected_endpoints.0.get_power_draw %}
{% if utilization %}
<td>
{{ utilization.allocated }}VA / {{ object.available_power }}VA
@@ -100,73 +100,33 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
</div>
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:powerfeed_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% if object.connected_endpoint %}
<tr>
<th scope="row">Device</th>
<td>{{ object.connected_endpoint.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<td>{{ object.connected_endpoint|linkify:"name" }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ object.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.connected_endpoint.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% else %}
<div class="text-muted">
Not connected
</div>
{% endif %}
<div class="card">
<h5 class="card-header">Connection</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
</div>
{% if not object.mark_connected and not object.cable %}
<div class="card-footer">
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerfeed&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
</a>
{% endif %}
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' %}
{% else %}
<div class="text-muted">
Not connected
</div>
{% endif %}
{% endif %}
</div>
{% include 'inc/panels/comments.html' %}
{% plugin_right_page object %}
{% if not object.mark_connected and not object.cable %}
<div class="card-footer">
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerfeed&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
</a>
{% endif %}
</div>
{% endif %}
</div>
{% include 'inc/panels/comments.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">

View File

@@ -58,69 +58,29 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
</div>
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:poweroutlet_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% if object.connected_endpoint %}
<tr>
<th scope="row">Device</th>
<td>{{ object.connected_endpoint.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<td>{{ object.connected_endpoint|linkify:"name" }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ object.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.connected_endpoint.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.poweroutlet&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" title="Connect" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
</a>
{% endif %}
</div>
{% endif %}
<div class="card">
<h5 class="card-header">Connection</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' %}
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.poweroutlet&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" title="Connect" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
</a>
{% endif %}
</div>
{% endif %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row mb-3">

View File

@@ -58,79 +58,39 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
</div>
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:powerport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% if object.connected_endpoint %}
<tr>
<th scope="row">Device</th>
<td>{{ object.connected_endpoint.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<td>{{ object.connected_endpoint|linkify:"name" }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ object.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.connected_endpoint.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<td>
{% if object.path.is_active %}
<span class="badge bg-success">Reachable</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<span class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerportport&a_terminations={{ object.pk }}&termination_b_type=dcim.poweroutlet&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-link">Power Outlet</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerportport&a_terminations={{ object.pk }}&termination_b_type=dcim.powerfeed&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-link">Power Feed</a>
</li>
</ul>
</span>
{% endif %}
</div>
{% endif %}
<div class="card">
<h5 class="card-header">Connection</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' %}
{% else %}
<div class="text-muted">
Not Connected
{% if perms.dcim.add_cable %}
<span class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerportport&a_terminations={{ object.pk }}&termination_b_type=dcim.poweroutlet&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-link">Power Outlet</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerportport&a_terminations={{ object.pk }}&termination_b_type=dcim.powerfeed&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="dropdown-link">Power Feed</a>
</li>
</ul>
</span>
{% endif %}
</div>
{% endif %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
{% include 'dcim/inc/panels/inventory_items.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">

View File

@@ -104,9 +104,7 @@
</div>
</div>
<div class="card">
<h5 class="card-header">
Dimensions
</h5>
<h5 class="card-header">Dimensions</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
@@ -147,6 +145,20 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Rack Weight</th>
<td>
{% if object.weight %}
{{ object.weight|floatformat }} {{ object.get_weight_unit_display }}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Total Weight</th>
<td>{{ object.total_weight|floatformat }} Kilograms</td>
</tr>
</table>
</div>
</div>
@@ -186,6 +198,7 @@
</div>
</div>
{% endif %}
{% include 'inc/panels/image_attachments.html' %}
<div class="card">
<h5 class="card-header">

View File

@@ -57,6 +57,14 @@
</div>
{% render_field form.desc_units %}
</div>
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Weight</h5>
</div>
{% render_field form.weight %}
{% render_field form.weight_unit %}
</div>
{% if form.custom_fields %}
<div class="field-group my-5">

View File

@@ -4,6 +4,7 @@
{% load helpers %}
{% load perms %}
{% load plugins %}
{% load tabs %}
{% comment %}
Blocks:
@@ -80,37 +81,14 @@ Context:
<ul class="nav nav-tabs px-3">
{# Primary tab #}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
<a class="nav-link{% if not tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{# Include any additional tabs #}
{# Include any extra tabs passed by the view #}
{% block extra_tabs %}{% endblock %}
{# Object journal #}
{% if perms.extras.view_journalentry %}
{% with journal_viewname=object|viewname:'journal' %}
{% url journal_viewname pk=object.pk as journal_url %}
{% if journal_url %}
<li role="presentation" class="nav-item">
<a href="{{ journal_url }}" class="nav-link{% if active_tab == 'journal'%} active{% endif %}">
Journal {% badge object.journal_entries.count %}
</a>
</li>
{% endif %}
{% endwith %}
{% endif %}
{# Object changelog #}
{% if perms.extras.view_objectchange %}
{% with changelog_viewname=object|viewname:'changelog' %}
{% url changelog_viewname pk=object.pk as changelog_url %}
{% if changelog_url %}
<li role="presentation" class="nav-item">
<a href="{{ changelog_url }}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
{% endwith %}
{% endif %}
{# Include tabs for registered model views #}
{% model_view_tabs object %}
</ul>
{% endblock tabs %}

View File

@@ -6,13 +6,3 @@
{{ block.super }}
<li class="breadcrumb-item"><a href="{% url 'ipam:aggregate_list' %}?rir_id={{ object.rir.pk }}">{{ object.rir }}</a></li>
{% endblock %}
{% block extra_tabs %}
{% if perms.ipam.view_prefix %}
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'prefixes' %} active{% endif %}" href="{% url 'ipam:aggregate_prefixes' pk=object.pk %}">
Prefixes {% badge object.get_child_prefixes.count %}
</a>
</li>
{% endif %}
{% endblock %}

View File

@@ -26,6 +26,10 @@
<td>Group ID</td>
<td>{{ object.group_id }}</td>
</tr>
<tr>
<td>Name</td>
<td>{{ object.name|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ object.description|placeholder }}</td>

View File

@@ -8,6 +8,7 @@
</div>
{% render_field form.protocol %}
{% render_field form.group_id %}
{% render_field form.name %}
{% render_field form.description %}
{% render_field form.tags %}
</div>

View File

@@ -8,13 +8,3 @@
<li class="breadcrumb-item"><a href="{% url 'ipam:iprange_list' %}?vrf_id={{ object.vrf.pk }}">{{ object.vrf }}</a></li>
{% endif %}
{% endblock %}
{% block extra_tabs %}
{% if perms.ipam.view_ipaddress %}
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'ip-addresses' %} active{% endif %}" href="{% url 'ipam:iprange_ipaddresses' pk=object.pk %}">
IP Addresses {% badge object.get_child_ips.count %}
</a>
</li>
{% endif %}
{% endblock %}

View File

@@ -8,21 +8,3 @@
<li class="breadcrumb-item"><a href="{% url 'ipam:prefix_list' %}?vrf_id={{ object.vrf.pk }}">{{ object.vrf }}</a></li>
{% endif %}
{% endblock %}
{% block extra_tabs %}
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'prefixes' %} active{% endif %}" href="{% url 'ipam:prefix_prefixes' pk=object.pk %}">
Child Prefixes {% badge object.get_child_prefixes.count %}
</a>
</li>
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'ip-ranges' %} active{% endif %}" href="{% url 'ipam:prefix_ipranges' pk=object.pk %}">
Child Ranges {% badge object.get_child_ranges.count %}
</a>
</li>
<li role="presentation" class="nav-item">
<a class="nav-link{% if active_tab == 'ip-addresses' %} active{% endif %}" href="{% url 'ipam:prefix_ipaddresses' pk=object.pk %}">
IP Addresses {% badge object.get_child_ips.count %}
</a>
</li>
{% endblock %}

View File

@@ -13,27 +13,3 @@
<li class="breadcrumb-item"><a href="{% url 'ipam:vlan_list' %}?group_id={{ object.group.pk }}">{{ object.group }}</a></li>
{% endif %}
{% endblock %}
{% block tabs %}
<ul class="nav nav-tabs px-3">
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{% url 'ipam:vlan' pk=object.pk %}">VLAN</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'interfaces' %} active{% endif %}" href="{% url 'ipam:vlan_interfaces' pk=object.pk %}">Device Interfaces {% badge object.get_interfaces.count %}</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'vminterfaces' %} active{% endif %}" href="{% url 'ipam:vlan_vminterfaces' pk=object.pk %}">VM Interfaces {% badge object.get_vminterfaces.count %}</a>
</li>
{% if perms.extras.view_journalentry %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'journal' %} active{% endif %}" href="{% url 'ipam:vlan_journal' pk=object.pk %}">Journal</a>
</li>
{% endif %}
{% if perms.extras.view_objectchange %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'changelog' %} active{% endif %}" href="{% url 'ipam:vlan_changelog' pk=object.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock %}

View File

@@ -3,6 +3,9 @@
{% load form_helpers %}
{% block form %}
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Contact Assignment</h5>

View File

@@ -21,7 +21,7 @@
</tr>
<tr>
<th scope="row">Group</th>
<td>{{ object.group|linkify }}</td>
<td>{{ object.group|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
@@ -34,7 +34,7 @@
</tr>
<tr>
<th scope="row">Site</th>
<td>{{ object.site|linkify }}</td>
<td>{{ object.site|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Virtual Machines</th>

View File

@@ -24,20 +24,3 @@
</a>
{% endif %}
{% endblock %}
{% block extra_tabs %}
{% with virtualmachine_count=object.virtual_machines.count %}
<li role="presentation" class="nav-item">
<a href="{% url 'virtualization:cluster_virtualmachines' pk=object.pk %}" class="nav-link{% if active_tab == 'virtual-machines' %} active{% endif %}">
Virtual Machines {% badge virtualmachine_count %}
</a>
</li>
{% endwith %}
{% with device_count=object.devices.count %}
<li role="presentation" class="nav-item">
<a href="{% url 'virtualization:cluster_devices' pk=object.pk %}" class="nav-link{% if active_tab == 'devices' %} active{% endif %}">
Devices {% badge device_count %}
</a>
</li>
{% endwith %}
{% endblock %}

View File

@@ -21,18 +21,3 @@
</a>
{% endif %}
{% endblock %}
{% block extra_tabs %}
{% with interface_count=object.interfaces.count %}
{% if interface_count %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'interfaces' %} active{% endif %}" href="{% url 'virtualization:virtualmachine_interfaces' pk=object.pk %}">Interfaces {% badge interface_count %}</a>
</li>
{% endif %}
{% endwith %}
{% if perms.extras.view_configcontext %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'config-context' %} active{% endif %}" href="{% url 'virtualization:virtualmachine_configcontext' pk=object.pk %}">Config Context</a>
</li>
{% endif %}
{% endblock %}