diff --git a/netbox_dns_bridge/__init__.py b/netbox_dns_bridge/__init__.py
index 4c9b09c..a229f08 100644
--- a/netbox_dns_bridge/__init__.py
+++ b/netbox_dns_bridge/__init__.py
@@ -17,6 +17,7 @@ class DNSBridgeConfig(PluginConfig):
base_url = "dns-bridge"
def ready(self):
+ super().ready()
self.settings = settings.PLUGINS_CONFIG.get(self.name, None)
if not self.settings:
raise RuntimeError(
diff --git a/netbox_dns_bridge/navigation.py b/netbox_dns_bridge/navigation.py
new file mode 100644
index 0000000..747a952
--- /dev/null
+++ b/netbox_dns_bridge/navigation.py
@@ -0,0 +1,16 @@
+from django.utils.translation import gettext_lazy as _
+from netbox.plugins import PluginMenu, PluginMenuItem
+
+info_menu_item = PluginMenuItem(
+ link="plugins:netbox_dns_bridge:info",
+ link_text=_("Info"),
+ permissions=[],
+)
+
+menu = PluginMenu(
+ label=_("DNS Bridge"),
+ groups=(
+ (_("Information"), (info_menu_item,)),
+ ),
+ icon_class="mdi mdi-bridge",
+)
diff --git a/netbox_dns_bridge/templates/netbox_dns_bridge/info.html b/netbox_dns_bridge/templates/netbox_dns_bridge/info.html
new file mode 100644
index 0000000..515d469
--- /dev/null
+++ b/netbox_dns_bridge/templates/netbox_dns_bridge/info.html
@@ -0,0 +1,89 @@
+{% extends 'base/layout.html' %}
+
+{% block title %}DNS Bridge Info{% endblock %}
+
+{% block content %}
+
+
+
+
+
+
+
+
+
+ | Key |
+ Value |
+
+
+
+ {% for s in settings_rows %}
+
+ | {{ s.key }} |
+ {{ s.value }} |
+
+ {% empty %}
+ | No settings found. |
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
+
+ | Source IP |
+ View |
+ Last Seen |
+
+
+
+ {% for c in seen_clients %}
+
+ | {{ c.source_ip }} |
+ {{ c.view.name }} |
+ {{ c.last_seen|date:"Y-m-d H:i:s" }} |
+
+ {% empty %}
+ | No seen transfer clients. |
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
+
+ | Zone |
+ View |
+ Active |
+ Catalog Zone Identifier |
+
+
+
+ {% for z in zones %}
+
+ | {{ z.name }} |
+ {{ z.view|default:"—" }} |
+ {{ z.active|yesno:"Yes,No" }} |
+ {{ z.catz_identifier|default:"—" }} |
+
+ {% empty %}
+ | No zones found. |
+ {% endfor %}
+
+
+
+
+
+
+
+{% endblock %}
diff --git a/netbox_dns_bridge/urls.py b/netbox_dns_bridge/urls.py
new file mode 100644
index 0000000..96b293c
--- /dev/null
+++ b/netbox_dns_bridge/urls.py
@@ -0,0 +1,7 @@
+from django.urls import path
+
+from .views import InfoView
+
+urlpatterns = [
+ path("info/", InfoView.as_view(), name="info"),
+]
diff --git a/netbox_dns_bridge/views.py b/netbox_dns_bridge/views.py
new file mode 100644
index 0000000..830da2c
--- /dev/null
+++ b/netbox_dns_bridge/views.py
@@ -0,0 +1,43 @@
+from django.views import View
+from django.shortcuts import render
+
+from .models import IntegerKeyValueSetting, SeenTransferClients
+
+
+class InfoView(View):
+ template_name = "netbox_dns_bridge/info.html"
+
+ def get(self, request):
+ import netbox_dns.models
+
+ settings_rows = IntegerKeyValueSetting.objects.all().order_by("key")
+
+ seen_clients = (
+ SeenTransferClients.objects.select_related("view")
+ .all()
+ .order_by("source_ip")
+ )
+
+ zones = []
+ for z in netbox_dns.models.Zone.objects.select_related(
+ "view", "catz_identifier"
+ ).order_by("name"):
+ try:
+ catz_identifier = z.catz_identifier.name
+ except netbox_dns.models.Zone.catz_identifier.RelatedObjectDoesNotExist:
+ catz_identifier = None
+ zones.append(
+ {
+ "name": z.name,
+ "view": z.view.name if z.view else None,
+ "active": z.active,
+ "catz_identifier": catz_identifier,
+ }
+ )
+
+ context = {
+ "settings_rows": settings_rows,
+ "seen_clients": seen_clients,
+ "zones": zones,
+ }
+ return render(request, self.template_name, context)