From c63c4d679589720f94738d1383386cccbfeef738 Mon Sep 17 00:00:00 2001 From: Victor Golovanenko Date: Wed, 25 Aug 2021 16:16:56 +0300 Subject: [PATCH] NetBox 3.0: initial support --- .../interface_comparison.html | 18 ++++++++---------- netbox_interface_sync/views.py | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/netbox_interface_sync/templates/netbox_interface_sync/interface_comparison.html b/netbox_interface_sync/templates/netbox_interface_sync/interface_comparison.html index d39862b..48b268e 100644 --- a/netbox_interface_sync/templates/netbox_interface_sync/interface_comparison.html +++ b/netbox_interface_sync/templates/netbox_interface_sync/interface_comparison.html @@ -1,17 +1,15 @@ -{% extends 'base.html' %} +{% extends 'base/layout.html' %} +{% block title %}{{ device }} - Interface comparison{% endblock %} {% block header %} -
- -
-

{% block title %}{{ device }} - Interface comparison{% endblock %}

+ + {{ block.super }} {% endblock %} {% block content %} diff --git a/netbox_interface_sync/views.py b/netbox_interface_sync/views.py index ad90bcb..55adfcd 100644 --- a/netbox_interface_sync/views.py +++ b/netbox_interface_sync/views.py @@ -17,7 +17,7 @@ class InterfaceComparisonView(LoginRequiredMixin, PermissionRequiredMixin, View) def get(self, request, 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"]: interfaces = list(filter(lambda i: not i.is_virtual, interfaces)) interface_templates = InterfaceTemplate.objects.filter(device_type=device.device_type) @@ -58,7 +58,7 @@ class InterfaceComparisonView(LoginRequiredMixin, PermissionRequiredMixin, View) form = InterfaceComparisonForm(request.POST) if form.is_valid(): device = get_object_or_404(Device.objects.filter(id=device_id)) - interfaces = device.vc_interfaces + interfaces = device.vc_interfaces() if config["exclude_virtual_interfaces"]: interfaces = interfaces.exclude(type__in=["virtual", "lag"]) interface_templates = InterfaceTemplate.objects.filter(device_type=device.device_type)