Upgrade models to full NetboxModel to allow UI/API interaction:
modified: netbox_dns_bridge/models.py deleted: netbox_dns_bridge/migrations/0003_catalogzone_and_per_zone_identifier.py new file: netbox_dns_bridge/migrations/0003_full_netbox_models.py Adjust model access and function calls to match new models: modified: netbox_dns_bridge/signals/netbox_dns_zones.py modified: netbox_dns_bridge/management/commands/dns_transfer_endpoint/catalog_zone_manager.py modified: netbox_dns_bridge/management/commands/dns_transfer_endpoint/request_handler.py Update UI elements and permission interactions: modified: netbox_dns_bridge/filtersets.py modified: netbox_dns_bridge/forms.py modified: netbox_dns_bridge/jobs/notify.py modified: netbox_dns_bridge/navigation.py modified: netbox_dns_bridge/tables.py deleted: netbox_dns_bridge/templates/netbox_dns_bridge/catalog_zone_members.html new file: netbox_dns_bridge/templates/netbox_dns_bridge/catalogzone.html new file: netbox_dns_bridge/templates/netbox_dns_bridge/catalogzonemember.html deleted: netbox_dns_bridge/templates/netbox_dns_bridge/notify_overview.html new file: netbox_dns_bridge/templates/netbox_dns_bridge/seentransferclient.html modified: netbox_dns_bridge/urls.py modified: netbox_dns_bridge/views.py AI/LLM updated tests (Not verified): modified: netbox_dns_bridge/tests/conftest.py modified: netbox_dns_bridge/tests/test_catalog_zone_manager.py modified: netbox_dns_bridge/tests/test_models.py modified: netbox_dns_bridge/tests/test_notify.py modified: netbox_dns_bridge/tests/test_request_handler_integration.py modified: netbox_dns_bridge/tests/test_signals.py modified: netbox_dns_bridge/tests/test_smoke.py modified: netbox_dns_bridge/tests/test_views.py
This commit is contained in:
1 parent
14805ed32b
commit
1c51206196
26 files changed
+813
-451
No files matched your search
+32
-12
@@ -1,29 +1,30 @@
|
||||
import django_tables2 as tables
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import netbox_dns.models
|
||||
from netbox.tables import NetBoxTable
|
||||
from netbox.tables.columns import ActionsColumn
|
||||
|
||||
from .models import CatalogZone
|
||||
from .models import CatalogZone, CatalogZoneMember, SeenTransferClient
|
||||
|
||||
|
||||
class CatalogZoneMemberTable(NetBoxTable):
|
||||
name = tables.Column(linkify=True)
|
||||
zone = tables.Column(
|
||||
accessor="zone__name",
|
||||
verbose_name=_("Zone"),
|
||||
linkify=True,
|
||||
)
|
||||
view = tables.Column(
|
||||
accessor="view__name",
|
||||
accessor="catalog_zone__view__name",
|
||||
verbose_name=_("View"),
|
||||
)
|
||||
status = tables.Column(verbose_name=_("Status"))
|
||||
catz_identifier = tables.Column(
|
||||
accessor="catz_identifier__name",
|
||||
verbose_name=_("Catalog Zone Identifier"),
|
||||
default="—",
|
||||
)
|
||||
|
||||
actions = ActionsColumn(actions=())
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = netbox_dns.models.Zone
|
||||
fields = ("name", "view", "status", "catz_identifier")
|
||||
default_columns = ("name", "view", "status", "catz_identifier")
|
||||
model = CatalogZoneMember
|
||||
fields = ("name", "zone", "view")
|
||||
default_columns = ("name", "zone", "view")
|
||||
|
||||
|
||||
class CatalogZoneTable(NetBoxTable):
|
||||
@@ -38,6 +39,8 @@ class CatalogZoneTable(NetBoxTable):
|
||||
soa_expire = tables.Column(verbose_name=_("Expire"))
|
||||
soa_minimum = tables.Column(verbose_name=_("Minimum"))
|
||||
|
||||
actions = ActionsColumn(actions=("edit", "changelog"))
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = CatalogZone
|
||||
fields = (
|
||||
@@ -56,3 +59,20 @@ class CatalogZoneTable(NetBoxTable):
|
||||
"soa_expire",
|
||||
"soa_minimum",
|
||||
)
|
||||
|
||||
|
||||
class SeenTransferClientTable(NetBoxTable):
|
||||
source_ip = tables.Column(linkify=True)
|
||||
view = tables.Column(
|
||||
accessor="view__name",
|
||||
verbose_name=_("View"),
|
||||
linkify=True,
|
||||
)
|
||||
last_seen = tables.DateTimeColumn(verbose_name=_("Last Seen"))
|
||||
|
||||
actions = ActionsColumn(actions=())
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = SeenTransferClient
|
||||
fields = ("source_ip", "view", "last_seen")
|
||||
default_columns = ("source_ip", "view", "last_seen")
|
||||
Reference in new issue
Block a user