Initial work on IP ranges

This commit is contained in:
jeremystretch
2021-07-16 09:15:19 -04:00
parent 337f95e269
commit 11a14927c9
24 changed files with 994 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
{% extends 'generic/object.html' %}
{% load buttons %}
{% load helpers %}
{% block breadcrumbs %}
<li class="breadcrumb-item">
<a href="{% url 'ipam:iprange_list' %}">IP Ranges</a>
</li>
{% if object.vrf %}
<li class="breadcrumb-item">
<a href="{% url 'ipam:vrf' pk=object.vrf.pk %}">{{ object.vrf }}</a>
</li>
{% endif %}
<li class="breadcrumb-item">
{{ object }}
</li>
{% endblock %}
{% block tab_items %}
<li role="presentation" class="nav-item">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">
IP Range
</a>
</li>
{% 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 <span class="badge bg-primary">{{ object.get_child_ips.count }}</span>
</a>
</li>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends 'ipam/iprange/base.html' %}
{% block extra_controls %}
{% if perms.ipam.add_ipaddress and active_tab == 'ip-addresses' and object.first_available_ip %}
<a href="{% url 'ipam:ipaddress_add' %}?address={{ object.first_available_ip }}&vrf={{ object.vrf.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-sm btn-outline-success m-1">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
Add an IP Address
</a>
{% endif %}
{% endblock %}
{% block content %}
<div class="row">
<div class="col col-md-12">
{% include 'utilities/obj_table.html' with table=ip_table heading='IP Addresses' bulk_edit_url='ipam:ipaddress_bulk_edit' bulk_delete_url='ipam:ipaddress_bulk_delete' %}
</div>
</div>
{% endblock %}