mirror of
https://github.com/drygdryg/netbox-plugin-interface-sync
synced 2024-11-25 18:10:52 +03:00
NetBox 3.0: initial support
This commit is contained in:
parent
0f85c97038
commit
c63c4d6795
@ -1,17 +1,15 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base/layout.html' %}
|
||||||
|
|
||||||
|
{% block title %}{{ device }} - Interface comparison{% endblock %}
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<div class="row noprint">
|
<nav class="breadcrumb-container px-3" aria-label="breadcrumb">
|
||||||
<div class="col-sm-8 col-md-9">
|
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="{% url 'dcim:device_list' %}">Devices</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'dcim:device_list' %}">Devices</a></li>
|
||||||
<li><a href="{% url 'dcim:device_list' %}?site={{ device.site.slug }}">{{ device.site }}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'dcim:device_list' %}?site={{ device.site.slug }}">{{ device.site }}</a></li>
|
||||||
<li><a href="{% url 'dcim:device' pk=device.id %}">{{ device }}</a></li>
|
<li class="breadcrumb-item"><a href="{% url 'dcim:device' pk=device.id %}">{{ device }}</a></li>
|
||||||
<li>Interface comparison</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</nav>
|
||||||
</div>
|
{{ block.super }}
|
||||||
<h1>{% block title %}{{ device }} - Interface comparison{% endblock %}</h1>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@ -17,7 +17,7 @@ class InterfaceComparisonView(LoginRequiredMixin, PermissionRequiredMixin, View)
|
|||||||
|
|
||||||
def get(self, request, device_id):
|
def get(self, request, device_id):
|
||||||
device = get_object_or_404(Device.objects.filter(id=device_id))
|
device = get_object_or_404(Device.objects.filter(id=device_id))
|
||||||
interfaces = device.vc_interfaces
|
interfaces = device.vc_interfaces()
|
||||||
if config["exclude_virtual_interfaces"]:
|
if config["exclude_virtual_interfaces"]:
|
||||||
interfaces = list(filter(lambda i: not i.is_virtual, interfaces))
|
interfaces = list(filter(lambda i: not i.is_virtual, interfaces))
|
||||||
interface_templates = InterfaceTemplate.objects.filter(device_type=device.device_type)
|
interface_templates = InterfaceTemplate.objects.filter(device_type=device.device_type)
|
||||||
@ -58,7 +58,7 @@ class InterfaceComparisonView(LoginRequiredMixin, PermissionRequiredMixin, View)
|
|||||||
form = InterfaceComparisonForm(request.POST)
|
form = InterfaceComparisonForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
device = get_object_or_404(Device.objects.filter(id=device_id))
|
device = get_object_or_404(Device.objects.filter(id=device_id))
|
||||||
interfaces = device.vc_interfaces
|
interfaces = device.vc_interfaces()
|
||||||
if config["exclude_virtual_interfaces"]:
|
if config["exclude_virtual_interfaces"]:
|
||||||
interfaces = interfaces.exclude(type__in=["virtual", "lag"])
|
interfaces = interfaces.exclude(type__in=["virtual", "lag"])
|
||||||
interface_templates = InterfaceTemplate.objects.filter(device_type=device.device_type)
|
interface_templates = InterfaceTemplate.objects.filter(device_type=device.device_type)
|
||||||
|
Loading…
Reference in New Issue
Block a user