2021-03-29 16:43:29 -04:00
|
|
|
{% extends 'ipam/prefix/base.html' %}
|
2022-01-03 09:17:15 -05:00
|
|
|
{% load humanize %}
|
2017-11-22 12:40:58 -05:00
|
|
|
{% load helpers %}
|
2020-03-15 23:45:18 -04:00
|
|
|
{% load plugins %}
|
2023-07-29 03:30:25 +07:00
|
|
|
{% load i18n %}
|
2023-11-30 02:50:59 +05:30
|
|
|
{% load mptt %}
|
2016-03-01 11:23:03 -05:00
|
|
|
|
2021-03-13 14:26:12 -07:00
|
|
|
{% block content %}
|
|
|
|
<div class="row">
|
2021-12-29 09:59:25 -05:00
|
|
|
<div class="col col-md-6">
|
|
|
|
<div class="card">
|
2023-07-29 03:30:25 +07:00
|
|
|
<h5 class="card-header">{% trans "Prefix" %}</h5>
|
2024-01-17 16:25:42 -05:00
|
|
|
<table class="table table-hover attr-table">
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Family" %}</th>
|
|
|
|
<td>IPv{{ object.family }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "VRF" %}</th>
|
|
|
|
<td>
|
|
|
|
{% if object.vrf %}
|
|
|
|
<a href="{% url 'ipam:vrf' pk=object.vrf.pk %}">{{ object.vrf }}</a>
|
|
|
|
{% else %}
|
|
|
|
<span>{% trans "Global" %}</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Tenant" %}</th>
|
2021-12-29 09:59:25 -05:00
|
|
|
<td>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% if object.tenant.group %}
|
|
|
|
{{ object.tenant.group|linkify }} /
|
2021-12-29 09:59:25 -05:00
|
|
|
{% endif %}
|
2024-01-17 16:25:42 -05:00
|
|
|
{{ object.tenant|linkify|placeholder }}
|
2021-12-29 09:59:25 -05:00
|
|
|
</td>
|
2024-01-17 16:25:42 -05:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Aggregate" %}</th>
|
|
|
|
<td>
|
|
|
|
{% if aggregate %}
|
|
|
|
<a href="{% url 'ipam:aggregate' pk=aggregate.pk %}">{{ aggregate.prefix }}</a> ({{ aggregate.rir }})
|
|
|
|
{% else %}
|
|
|
|
{{ ''|placeholder }}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% if object.site.region %}
|
2021-12-29 09:59:25 -05:00
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Region" %}</th>
|
2021-12-29 09:59:25 -05:00
|
|
|
<td>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% nested_tree object.site.region %}
|
2021-12-29 09:59:25 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% endif %}
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Site" %}</th>
|
|
|
|
<td>{{ object.site|linkify|placeholder }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "VLAN" %}</th>
|
|
|
|
<td>
|
|
|
|
{% if object.vlan %}
|
|
|
|
{% if object.vlan.group %}
|
|
|
|
{{ object.vlan.group|linkify }} /
|
2021-12-29 09:59:25 -05:00
|
|
|
{% endif %}
|
2024-01-17 16:25:42 -05:00
|
|
|
{{ object.vlan|linkify }}
|
|
|
|
{% else %}
|
|
|
|
{{ ''|placeholder }}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Status" %}</th>
|
|
|
|
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Role" %}</th>
|
|
|
|
<td>{{ object.role|linkify|placeholder }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Description" %}</th>
|
|
|
|
<td>{{ object.description|placeholder }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Is a pool" %}</th>
|
|
|
|
<td>{% checkmark object.is_pool %}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2020-03-15 23:45:18 -04:00
|
|
|
</div>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% plugin_left_page object %}
|
2021-12-29 09:59:25 -05:00
|
|
|
</div>
|
|
|
|
<div class="col col-md-6">
|
|
|
|
<div class="card">
|
2024-01-30 20:55:28 -05:00
|
|
|
<h5 class="card-header">
|
|
|
|
{% trans "Addressing" %}
|
|
|
|
{% if object.prefix.version == 4 %}
|
|
|
|
<div class="card-actions">
|
|
|
|
<a class="btn btn-ghost-primary btn-sm" data-bs-toggle="modal" data-bs-target="#prefix-modal">
|
|
|
|
<i class="mdi mdi-information-outline" aria-hidden="true"></i> {% trans "Addressing Details" %}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</h5>
|
2024-01-17 16:25:42 -05:00
|
|
|
<table class="table table-hover attr-table">
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Utilization" %}</th>
|
|
|
|
<td>
|
|
|
|
{% if object.mark_utilized %}
|
|
|
|
{% utilization_graph 100 warning_threshold=0 danger_threshold=0 %}
|
|
|
|
<small>({% trans "Marked fully utilized" %})</small>
|
|
|
|
{% else %}
|
|
|
|
{% utilization_graph object.get_utilization %}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% with child_ip_count=object.get_child_ips.count %}
|
2021-12-29 09:59:25 -05:00
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Child IPs" %}</th>
|
2021-12-29 09:59:25 -05:00
|
|
|
<td>
|
2024-01-17 16:25:42 -05:00
|
|
|
<a href="{% url 'ipam:prefix_ipaddresses' pk=object.pk %}">{{ child_ip_count }}</a>
|
2021-12-29 09:59:25 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% endwith %}
|
|
|
|
{% with available_count=object.get_available_ips.size %}
|
2021-12-29 09:59:25 -05:00
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Available IPs" %}</th>
|
2021-12-29 09:59:25 -05:00
|
|
|
<td>
|
2024-01-17 16:25:42 -05:00
|
|
|
{# Use human-friendly words for counts greater than one million #}
|
|
|
|
{% if available_count > 1000000 %}
|
|
|
|
{{ available_count|intword }}
|
|
|
|
{% else %}
|
|
|
|
{{ available_count|intcomma }}
|
|
|
|
{% endif %}
|
2021-12-29 09:59:25 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% endwith %}
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "First available IP" %}</th>
|
|
|
|
<td>
|
|
|
|
{% with first_available_ip=object.get_first_available_ip %}
|
|
|
|
{% if first_available_ip %}
|
|
|
|
{% if perms.ipam.add_ipaddress %}
|
2024-02-05 14:38:26 -05:00
|
|
|
<a href="{% url 'ipam:ipaddress_add' %}?address={{ first_available_ip }}{% if object.vrf %}&vrf={{ object.vrf_id }}{% endif %}{% if object.tenant %}&tenant={{ object.tenant.pk }}{% endif %}">{{ first_available_ip }}</a>
|
2024-01-17 16:25:42 -05:00
|
|
|
{% else %}
|
|
|
|
{{ first_available_ip }}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{{ ''|placeholder }}
|
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2021-03-13 02:19:42 -07:00
|
|
|
</div>
|
2021-12-29 09:59:25 -05:00
|
|
|
{% include 'inc/panels/custom_fields.html' %}
|
|
|
|
{% include 'inc/panels/tags.html' %}
|
2022-11-04 08:28:09 -04:00
|
|
|
{% include 'inc/panels/comments.html' %}
|
2021-12-29 09:59:25 -05:00
|
|
|
{% plugin_right_page object %}
|
|
|
|
</div>
|
2021-03-13 14:26:12 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-12">
|
2021-07-21 11:20:35 -04:00
|
|
|
{% if duplicate_prefix_table.rows %}
|
|
|
|
{% include 'inc/panel_table.html' with table=duplicate_prefix_table heading='Duplicate Prefixes' %}
|
|
|
|
{% endif %}
|
|
|
|
{% include 'inc/panel_table.html' with table=parent_prefix_table heading='Parent Prefixes' %}
|
2021-03-13 14:26:12 -07:00
|
|
|
{% plugin_full_width_page object %}
|
2018-06-14 13:14:35 -04:00
|
|
|
</div>
|
2021-03-13 14:26:12 -07:00
|
|
|
</div>
|
2022-08-16 10:04:47 -04:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block modals %}
|
|
|
|
{{ block.super }}
|
|
|
|
{% if object.prefix.version == 4 %}
|
|
|
|
<div class="modal fade" id="prefix-modal" tabindex="-1" aria-hidden="true">
|
|
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2023-07-29 03:30:25 +07:00
|
|
|
<h5 class="modal-title">{% trans "Prefix Details" %}</h5>
|
2022-08-16 10:04:47 -04:00
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
|
|
</div>
|
2024-01-17 16:25:42 -05:00
|
|
|
<div class="modal-body p-0">
|
|
|
|
<table class="table table-hover attr-table m-0">
|
2022-08-16 10:04:47 -04:00
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Network Address" %}</th>
|
2022-08-16 10:04:47 -04:00
|
|
|
<td>{{ object.prefix.network }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Network Mask" %}</th>
|
2022-08-16 10:04:47 -04:00
|
|
|
<td>{{ object.prefix.netmask }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Wildcard Mask" %}</th>
|
2022-08-16 10:04:47 -04:00
|
|
|
<td>{{ object.prefix.hostmask }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2024-01-17 16:25:42 -05:00
|
|
|
<th scope="row">{% trans "Broadcast Address" %}</th>
|
2022-08-16 10:04:47 -04:00
|
|
|
<td>{{ object.prefix.broadcast }}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2022-07-23 20:24:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-16 10:04:47 -04:00
|
|
|
{% endif %}
|
2016-03-01 11:23:03 -05:00
|
|
|
{% endblock %}
|