netbox-plugin-dns 1.1.2__py3-none-any.whl → 1.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of netbox-plugin-dns might be problematic. Click here for more details.
- netbox_dns/__init__.py +6 -5
- netbox_dns/api/nested_serializers.py +3 -2
- netbox_dns/api/serializers_/nameserver.py +2 -1
- netbox_dns/api/serializers_/record.py +5 -4
- netbox_dns/api/serializers_/record_template.py +2 -1
- netbox_dns/api/serializers_/view.py +2 -1
- netbox_dns/api/serializers_/zone.py +12 -11
- netbox_dns/api/serializers_/zone_template.py +8 -7
- netbox_dns/api/views.py +9 -4
- netbox_dns/choices/record.py +4 -2
- netbox_dns/choices/zone.py +6 -4
- netbox_dns/fields/address.py +2 -1
- netbox_dns/fields/network.py +2 -1
- netbox_dns/fields/rfc2317.py +7 -3
- netbox_dns/filtersets/nameserver.py +3 -2
- netbox_dns/filtersets/record.py +10 -9
- netbox_dns/filtersets/record_template.py +3 -2
- netbox_dns/filtersets/view.py +3 -2
- netbox_dns/filtersets/zone.py +24 -22
- netbox_dns/filtersets/zone_template.py +15 -14
- netbox_dns/forms/nameserver.py +41 -17
- netbox_dns/forms/record.py +43 -26
- netbox_dns/forms/record_template.py +49 -28
- netbox_dns/forms/registrar.py +21 -17
- netbox_dns/forms/registration_contact.py +37 -25
- netbox_dns/forms/view.py +49 -27
- netbox_dns/forms/zone.py +167 -120
- netbox_dns/forms/zone_template.py +53 -43
- netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
- netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
- netbox_dns/management/commands/rebuild_dnssync.py +14 -1
- netbox_dns/models/nameserver.py +6 -2
- netbox_dns/models/record.py +63 -30
- netbox_dns/models/record_template.py +16 -8
- netbox_dns/models/registrar.py +11 -7
- netbox_dns/models/registration_contact.py +23 -11
- netbox_dns/models/view.py +15 -6
- netbox_dns/models/zone.py +65 -43
- netbox_dns/models/zone_template.py +12 -10
- netbox_dns/navigation.py +30 -28
- netbox_dns/signals/ipam_dnssync.py +21 -14
- netbox_dns/tables/ipam_dnssync.py +2 -1
- netbox_dns/tables/nameserver.py +2 -0
- netbox_dns/tables/record.py +21 -11
- netbox_dns/tables/record_template.py +12 -5
- netbox_dns/tables/registrar.py +2 -0
- netbox_dns/tables/registration_contact.py +2 -0
- netbox_dns/tables/view.py +3 -1
- netbox_dns/tables/zone.py +15 -2
- netbox_dns/tables/zone_template.py +7 -0
- netbox_dns/templates/netbox_dns/nameserver.html +6 -5
- netbox_dns/templates/netbox_dns/record/managed.html +2 -1
- netbox_dns/templates/netbox_dns/record/related.html +26 -14
- netbox_dns/templates/netbox_dns/record.html +39 -20
- netbox_dns/templates/netbox_dns/recordtemplate.html +27 -15
- netbox_dns/templates/netbox_dns/registrar.html +11 -10
- netbox_dns/templates/netbox_dns/registrationcontact.html +16 -15
- netbox_dns/templates/netbox_dns/view/button.html +2 -1
- netbox_dns/templates/netbox_dns/view/prefix.html +7 -4
- netbox_dns/templates/netbox_dns/view/related.html +26 -10
- netbox_dns/templates/netbox_dns/view.html +11 -14
- netbox_dns/templates/netbox_dns/zone/base.html +2 -1
- netbox_dns/templates/netbox_dns/zone/child.html +3 -2
- netbox_dns/templates/netbox_dns/zone/record.html +3 -2
- netbox_dns/templates/netbox_dns/zone/registration.html +8 -7
- netbox_dns/templates/netbox_dns/zone.html +28 -30
- netbox_dns/templates/netbox_dns/zonetemplate.html +27 -17
- netbox_dns/utilities/ipam_dnssync.py +15 -4
- netbox_dns/validators/dns_name.py +11 -4
- netbox_dns/validators/dns_value.py +9 -4
- netbox_dns/validators/rfc2317.py +6 -3
- netbox_dns/views/nameserver.py +4 -2
- netbox_dns/views/record_template.py +4 -3
- netbox_dns/views/registrar.py +3 -1
- netbox_dns/views/registration_contact.py +2 -1
- netbox_dns/views/view.py +2 -1
- netbox_dns/views/zone.py +6 -4
- netbox_dns/views/zone_template.py +8 -7
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/METADATA +1 -1
- netbox_plugin_dns-1.1.3.dist-info/RECORD +150 -0
- netbox_plugin_dns-1.1.2.dist-info/RECORD +0 -148
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/LICENSE +0 -0
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/WHEEL +0 -0
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
from django.urls import reverse
|
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
|
3
4
|
|
|
4
5
|
from netbox.models import NetBoxModel
|
|
5
6
|
from netbox.search import SearchIndex, register_search
|
|
@@ -13,25 +14,29 @@ __all__ = (
|
|
|
13
14
|
|
|
14
15
|
class ZoneTemplate(NetBoxModel):
|
|
15
16
|
name = models.CharField(
|
|
16
|
-
verbose_name="Template
|
|
17
|
+
verbose_name=_("Template Name"),
|
|
17
18
|
unique=True,
|
|
18
19
|
max_length=200,
|
|
19
20
|
)
|
|
20
21
|
description = models.CharField(
|
|
22
|
+
verbose_name=_("Description"),
|
|
21
23
|
max_length=200,
|
|
22
24
|
blank=True,
|
|
23
25
|
)
|
|
24
26
|
nameservers = models.ManyToManyField(
|
|
27
|
+
verbose_name=_("Nameservers"),
|
|
25
28
|
to="NameServer",
|
|
26
29
|
related_name="+",
|
|
27
30
|
blank=True,
|
|
28
31
|
)
|
|
29
32
|
record_templates = models.ManyToManyField(
|
|
33
|
+
verbose_name=_("Record Templates"),
|
|
30
34
|
to="RecordTemplate",
|
|
31
35
|
related_name="zone_templates",
|
|
32
36
|
blank=True,
|
|
33
37
|
)
|
|
34
38
|
tenant = models.ForeignKey(
|
|
39
|
+
verbose_name=_("Tenant"),
|
|
35
40
|
to="tenancy.Tenant",
|
|
36
41
|
on_delete=models.SET_NULL,
|
|
37
42
|
related_name="+",
|
|
@@ -39,45 +44,42 @@ class ZoneTemplate(NetBoxModel):
|
|
|
39
44
|
null=True,
|
|
40
45
|
)
|
|
41
46
|
registrar = models.ForeignKey(
|
|
47
|
+
verbose_name=_("Registrar"),
|
|
42
48
|
to="Registrar",
|
|
43
49
|
on_delete=models.SET_NULL,
|
|
44
50
|
related_name="+",
|
|
45
|
-
help_text="The external registrar the domain is registered with",
|
|
46
51
|
blank=True,
|
|
47
52
|
null=True,
|
|
48
53
|
)
|
|
49
54
|
registrant = models.ForeignKey(
|
|
55
|
+
verbose_name=_("Registrant"),
|
|
50
56
|
to="RegistrationContact",
|
|
51
57
|
on_delete=models.SET_NULL,
|
|
52
58
|
related_name="+",
|
|
53
|
-
help_text="The owner of the domain",
|
|
54
59
|
blank=True,
|
|
55
60
|
null=True,
|
|
56
61
|
)
|
|
57
62
|
admin_c = models.ForeignKey(
|
|
63
|
+
verbose_name=_("Administrative Contact"),
|
|
58
64
|
to="RegistrationContact",
|
|
59
65
|
on_delete=models.SET_NULL,
|
|
60
|
-
verbose_name="Admin contact",
|
|
61
66
|
related_name="+",
|
|
62
|
-
help_text="The administrative contact for the domain",
|
|
63
67
|
blank=True,
|
|
64
68
|
null=True,
|
|
65
69
|
)
|
|
66
70
|
tech_c = models.ForeignKey(
|
|
71
|
+
verbose_name=_("Technical Contact"),
|
|
67
72
|
to="RegistrationContact",
|
|
68
73
|
on_delete=models.SET_NULL,
|
|
69
|
-
verbose_name="Tech contact",
|
|
70
74
|
related_name="+",
|
|
71
|
-
help_text="The technical contact for the domain",
|
|
72
75
|
blank=True,
|
|
73
76
|
null=True,
|
|
74
77
|
)
|
|
75
78
|
billing_c = models.ForeignKey(
|
|
79
|
+
verbose_name=_("Billing Contact"),
|
|
76
80
|
to="RegistrationContact",
|
|
77
81
|
on_delete=models.SET_NULL,
|
|
78
|
-
verbose_name="Billing contact",
|
|
79
82
|
related_name="+",
|
|
80
|
-
help_text="The billing contact for the domain",
|
|
81
83
|
blank=True,
|
|
82
84
|
null=True,
|
|
83
85
|
)
|
|
@@ -104,7 +106,7 @@ class ZoneTemplate(NetBoxModel):
|
|
|
104
106
|
)
|
|
105
107
|
|
|
106
108
|
class Meta:
|
|
107
|
-
verbose_name = "Zone Template"
|
|
109
|
+
verbose_name = _("Zone Template")
|
|
108
110
|
verbose_name_plural = "Zone Templates"
|
|
109
111
|
|
|
110
112
|
ordering = ("name",)
|
netbox_dns/navigation.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
|
+
|
|
1
3
|
from netbox.plugins import PluginMenuButton, PluginMenuItem, PluginMenu
|
|
2
4
|
from netbox.plugins.utils import get_plugin_config
|
|
3
5
|
|
|
@@ -6,18 +8,18 @@ top_level_menu = get_plugin_config("netbox_dns", "top_level_menu")
|
|
|
6
8
|
|
|
7
9
|
view_menu_item = PluginMenuItem(
|
|
8
10
|
link="plugins:netbox_dns:view_list",
|
|
9
|
-
link_text="Views",
|
|
11
|
+
link_text=_("Views"),
|
|
10
12
|
permissions=["netbox_dns.view_view"],
|
|
11
13
|
buttons=(
|
|
12
14
|
PluginMenuButton(
|
|
13
15
|
"plugins:netbox_dns:view_add",
|
|
14
|
-
"Add",
|
|
16
|
+
_("Add"),
|
|
15
17
|
"mdi mdi-plus-thick",
|
|
16
18
|
permissions=["netbox_dns.add_view"],
|
|
17
19
|
),
|
|
18
20
|
PluginMenuButton(
|
|
19
21
|
"plugins:netbox_dns:view_import",
|
|
20
|
-
"Import",
|
|
22
|
+
_("Import"),
|
|
21
23
|
"mdi mdi-upload",
|
|
22
24
|
permissions=["netbox_dns.add_view"],
|
|
23
25
|
),
|
|
@@ -26,18 +28,18 @@ view_menu_item = PluginMenuItem(
|
|
|
26
28
|
|
|
27
29
|
zone_menu_item = PluginMenuItem(
|
|
28
30
|
link="plugins:netbox_dns:zone_list",
|
|
29
|
-
link_text="Zones",
|
|
31
|
+
link_text=_("Zones"),
|
|
30
32
|
permissions=["netbox_dns.view_zone"],
|
|
31
33
|
buttons=(
|
|
32
34
|
PluginMenuButton(
|
|
33
35
|
"plugins:netbox_dns:zone_add",
|
|
34
|
-
"Add",
|
|
36
|
+
_("Add"),
|
|
35
37
|
"mdi mdi-plus-thick",
|
|
36
38
|
permissions=["netbox_dns.add_zone"],
|
|
37
39
|
),
|
|
38
40
|
PluginMenuButton(
|
|
39
41
|
"plugins:netbox_dns:zone_import",
|
|
40
|
-
"Import",
|
|
42
|
+
_("Import"),
|
|
41
43
|
"mdi mdi-upload",
|
|
42
44
|
permissions=["netbox_dns.add_zone"],
|
|
43
45
|
),
|
|
@@ -46,18 +48,18 @@ zone_menu_item = PluginMenuItem(
|
|
|
46
48
|
|
|
47
49
|
nameserver_menu_item = PluginMenuItem(
|
|
48
50
|
link="plugins:netbox_dns:nameserver_list",
|
|
49
|
-
link_text="Nameservers",
|
|
51
|
+
link_text=_("Nameservers"),
|
|
50
52
|
permissions=["netbox_dns.view_nameserver"],
|
|
51
53
|
buttons=(
|
|
52
54
|
PluginMenuButton(
|
|
53
55
|
"plugins:netbox_dns:nameserver_add",
|
|
54
|
-
"Add",
|
|
56
|
+
_("Add"),
|
|
55
57
|
"mdi mdi-plus-thick",
|
|
56
58
|
permissions=["netbox_dns.add_nameserver"],
|
|
57
59
|
),
|
|
58
60
|
PluginMenuButton(
|
|
59
61
|
"plugins:netbox_dns:nameserver_import",
|
|
60
|
-
"Import",
|
|
62
|
+
_("Import"),
|
|
61
63
|
"mdi mdi-upload",
|
|
62
64
|
permissions=["netbox_dns.add_nameserver"],
|
|
63
65
|
),
|
|
@@ -66,18 +68,18 @@ nameserver_menu_item = PluginMenuItem(
|
|
|
66
68
|
|
|
67
69
|
record_menu_item = PluginMenuItem(
|
|
68
70
|
link="plugins:netbox_dns:record_list",
|
|
69
|
-
link_text="Records",
|
|
71
|
+
link_text=_("Records"),
|
|
70
72
|
permissions=["netbox_dns.view_record"],
|
|
71
73
|
buttons=(
|
|
72
74
|
PluginMenuButton(
|
|
73
75
|
"plugins:netbox_dns:record_add",
|
|
74
|
-
"Add",
|
|
76
|
+
_("Add"),
|
|
75
77
|
"mdi mdi-plus-thick",
|
|
76
78
|
permissions=["netbox_dns.add_record"],
|
|
77
79
|
),
|
|
78
80
|
PluginMenuButton(
|
|
79
81
|
"plugins:netbox_dns:record_import",
|
|
80
|
-
"Import",
|
|
82
|
+
_("Import"),
|
|
81
83
|
"mdi mdi-upload",
|
|
82
84
|
permissions=["netbox_dns.add_record"],
|
|
83
85
|
),
|
|
@@ -86,24 +88,24 @@ record_menu_item = PluginMenuItem(
|
|
|
86
88
|
|
|
87
89
|
managed_record_menu_item = PluginMenuItem(
|
|
88
90
|
link="plugins:netbox_dns:managed_record_list",
|
|
89
|
-
link_text="Managed Records",
|
|
91
|
+
link_text=_("Managed Records"),
|
|
90
92
|
permissions=["netbox_dns.view_record"],
|
|
91
93
|
)
|
|
92
94
|
|
|
93
95
|
zonetemplate_menu_item = PluginMenuItem(
|
|
94
96
|
link="plugins:netbox_dns:zonetemplate_list",
|
|
95
|
-
link_text="Zone Templates",
|
|
97
|
+
link_text=_("Zone Templates"),
|
|
96
98
|
permissions=["netbox_dns.view_zonetemplate"],
|
|
97
99
|
buttons=(
|
|
98
100
|
PluginMenuButton(
|
|
99
101
|
"plugins:netbox_dns:zonetemplate_add",
|
|
100
|
-
"Add",
|
|
102
|
+
_("Add"),
|
|
101
103
|
"mdi mdi-plus-thick",
|
|
102
104
|
permissions=["netbox_dns.add_zonetemplate"],
|
|
103
105
|
),
|
|
104
106
|
PluginMenuButton(
|
|
105
107
|
"plugins:netbox_dns:zonetemplate_import",
|
|
106
|
-
"Import",
|
|
108
|
+
_("Import"),
|
|
107
109
|
"mdi mdi-upload",
|
|
108
110
|
permissions=["netbox_dns.add_zonetemplate"],
|
|
109
111
|
),
|
|
@@ -112,18 +114,18 @@ zonetemplate_menu_item = PluginMenuItem(
|
|
|
112
114
|
|
|
113
115
|
recordtemplate_menu_item = PluginMenuItem(
|
|
114
116
|
link="plugins:netbox_dns:recordtemplate_list",
|
|
115
|
-
link_text="Record Templates",
|
|
117
|
+
link_text=_("Record Templates"),
|
|
116
118
|
permissions=["netbox_dns.view_recordtemplate"],
|
|
117
119
|
buttons=(
|
|
118
120
|
PluginMenuButton(
|
|
119
121
|
"plugins:netbox_dns:recordtemplate_add",
|
|
120
|
-
"Add",
|
|
122
|
+
_("Add"),
|
|
121
123
|
"mdi mdi-plus-thick",
|
|
122
124
|
permissions=["netbox_dns.add_recordtemplate"],
|
|
123
125
|
),
|
|
124
126
|
PluginMenuButton(
|
|
125
127
|
"plugins:netbox_dns:recordtemplate_import",
|
|
126
|
-
"Import",
|
|
128
|
+
_("Import"),
|
|
127
129
|
"mdi mdi-upload",
|
|
128
130
|
permissions=["netbox_dns.add_recordtemplate"],
|
|
129
131
|
),
|
|
@@ -132,18 +134,18 @@ recordtemplate_menu_item = PluginMenuItem(
|
|
|
132
134
|
|
|
133
135
|
registrar_menu_item = PluginMenuItem(
|
|
134
136
|
link="plugins:netbox_dns:registrar_list",
|
|
135
|
-
link_text="Registrars",
|
|
137
|
+
link_text=_("Registrars"),
|
|
136
138
|
permissions=["netbox_dns.view_registrar"],
|
|
137
139
|
buttons=(
|
|
138
140
|
PluginMenuButton(
|
|
139
141
|
"plugins:netbox_dns:registrar_add",
|
|
140
|
-
"Add",
|
|
142
|
+
_("Add"),
|
|
141
143
|
"mdi mdi-plus-thick",
|
|
142
144
|
permissions=["netbox_dns.add_registrar"],
|
|
143
145
|
),
|
|
144
146
|
PluginMenuButton(
|
|
145
147
|
"plugins:netbox_dns:registrar_import",
|
|
146
|
-
"Import",
|
|
148
|
+
_("Import"),
|
|
147
149
|
"mdi mdi-upload",
|
|
148
150
|
permissions=["netbox_dns.add_registrar"],
|
|
149
151
|
),
|
|
@@ -152,18 +154,18 @@ registrar_menu_item = PluginMenuItem(
|
|
|
152
154
|
|
|
153
155
|
contact_menu_item = PluginMenuItem(
|
|
154
156
|
link="plugins:netbox_dns:registrationcontact_list",
|
|
155
|
-
link_text="Registration Contacts",
|
|
157
|
+
link_text=_("Registration Contacts"),
|
|
156
158
|
permissions=["netbox_dns.view_registrationcontact"],
|
|
157
159
|
buttons=(
|
|
158
160
|
PluginMenuButton(
|
|
159
161
|
"plugins:netbox_dns:registrationcontact_add",
|
|
160
|
-
"Add",
|
|
162
|
+
_("Add"),
|
|
161
163
|
"mdi mdi-plus-thick",
|
|
162
164
|
permissions=["netbox_dns.add_registrationcontact"],
|
|
163
165
|
),
|
|
164
166
|
PluginMenuButton(
|
|
165
167
|
"plugins:netbox_dns:registrationcontact_import",
|
|
166
|
-
"Import",
|
|
168
|
+
_("Import"),
|
|
167
169
|
"mdi mdi-upload",
|
|
168
170
|
permissions=["netbox_dns.add_registrationcontact"],
|
|
169
171
|
),
|
|
@@ -176,7 +178,7 @@ if top_level_menu:
|
|
|
176
178
|
label=menu_name,
|
|
177
179
|
groups=(
|
|
178
180
|
(
|
|
179
|
-
"DNS Configuration",
|
|
181
|
+
_("DNS Configuration"),
|
|
180
182
|
(
|
|
181
183
|
view_menu_item,
|
|
182
184
|
zone_menu_item,
|
|
@@ -186,14 +188,14 @@ if top_level_menu:
|
|
|
186
188
|
),
|
|
187
189
|
),
|
|
188
190
|
(
|
|
189
|
-
"Templates",
|
|
191
|
+
_("Templates"),
|
|
190
192
|
(
|
|
191
193
|
zonetemplate_menu_item,
|
|
192
194
|
recordtemplate_menu_item,
|
|
193
195
|
),
|
|
194
196
|
),
|
|
195
197
|
(
|
|
196
|
-
"Domain Registration",
|
|
198
|
+
_("Domain Registration"),
|
|
197
199
|
(
|
|
198
200
|
registrar_menu_item,
|
|
199
201
|
contact_menu_item,
|
|
@@ -4,6 +4,7 @@ from django.conf import settings
|
|
|
4
4
|
from django.dispatch import receiver
|
|
5
5
|
from django.db.models.signals import pre_delete, pre_save, post_save, m2m_changed
|
|
6
6
|
from django.core.exceptions import ValidationError
|
|
7
|
+
from django.utils.translation import gettext as _
|
|
7
8
|
|
|
8
9
|
from netbox.context import current_request
|
|
9
10
|
from netbox.signals import post_clean
|
|
@@ -60,18 +61,18 @@ def ipam_dnssync_ipaddress_post_clean(instance, **kwargs):
|
|
|
60
61
|
if not ip_address.custom_field_data.get("ipaddress_dns_disabled"):
|
|
61
62
|
raise ValidationError(
|
|
62
63
|
{
|
|
63
|
-
"dns_name":
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
"dns_name": _(
|
|
65
|
+
"Unique DNS records are enforced and there is already "
|
|
66
|
+
"an active IP address {address} with DNS name {name}. Plesase choose "
|
|
67
|
+
"a different name or disable record creation for this IP address."
|
|
68
|
+
).format(address=instance.address, name=instance.dns_name)
|
|
67
69
|
}
|
|
68
70
|
)
|
|
69
71
|
|
|
70
72
|
# +
|
|
71
73
|
# Check NetBox DNS record permission for changes to IPAddress custom fields
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
if (request := current_request.get()) is not None:
|
|
74
|
+
# -
|
|
75
|
+
if (current_request.get()) is not None:
|
|
75
76
|
cf_data = instance.custom_field_data
|
|
76
77
|
if (
|
|
77
78
|
not instance._state.adding
|
|
@@ -96,7 +97,7 @@ def ipam_dnssync_ipaddress_post_clean(instance, **kwargs):
|
|
|
96
97
|
and not check_record_permission(change=False, delete=False)
|
|
97
98
|
):
|
|
98
99
|
raise ValidationError(
|
|
99
|
-
|
|
100
|
+
_("You do not have permission to alter DNSsync custom fields")
|
|
100
101
|
)
|
|
101
102
|
|
|
102
103
|
try:
|
|
@@ -139,13 +140,17 @@ def ipam_dnssync_prefix_pre_save(instance, **kwargs):
|
|
|
139
140
|
dns_views = ", ".join([view.name for view in instance.netbox_dns_views.all()])
|
|
140
141
|
if request is not None:
|
|
141
142
|
raise AbortRequest(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
_(
|
|
144
|
+
"This prefix is currently assigned to the following DNS views: {views}. "
|
|
145
|
+
"Please deassign it from these views before making changes to the prefix "
|
|
146
|
+
"or VRF."
|
|
147
|
+
).format(views=dns_views)
|
|
145
148
|
)
|
|
146
149
|
|
|
147
150
|
raise ValidationError(
|
|
148
|
-
|
|
151
|
+
_(
|
|
152
|
+
"Prefix is assigned to DNS views {views}. Prefix and VRF must not be changed"
|
|
153
|
+
).format(views=dns_views)
|
|
149
154
|
)
|
|
150
155
|
|
|
151
156
|
|
|
@@ -166,8 +171,10 @@ def ipam_dnssync_prefix_pre_delete(instance, **kwargs):
|
|
|
166
171
|
except ValidationError as exc:
|
|
167
172
|
if request is not None:
|
|
168
173
|
raise AbortRequest(
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
_(
|
|
175
|
+
"Prefix deletion would cause DNS errors: {errors}. Please review "
|
|
176
|
+
"DNS View assignments for this and the parent prefix"
|
|
177
|
+
).format(errors=exc.messages[0])
|
|
171
178
|
)
|
|
172
179
|
else:
|
|
173
180
|
raise exc
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
3
|
|
|
3
4
|
from ipam.tables import PrefixTable
|
|
4
5
|
from utilities.tables import register_table_column
|
|
5
6
|
|
|
6
7
|
views = tables.ManyToManyColumn(
|
|
7
|
-
verbose_name="DNS Views",
|
|
8
|
+
verbose_name=_("DNS Views"),
|
|
8
9
|
linkify_item=True,
|
|
9
10
|
)
|
|
10
11
|
|
netbox_dns/tables/nameserver.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
3
|
|
|
3
4
|
from netbox.tables import NetBoxTable, TagColumn
|
|
4
5
|
from tenancy.tables import TenancyColumnsMixin
|
|
@@ -11,6 +12,7 @@ __all__ = ("NameServerTable",)
|
|
|
11
12
|
|
|
12
13
|
class NameServerTable(TenancyColumnsMixin, NetBoxTable):
|
|
13
14
|
name = tables.Column(
|
|
15
|
+
verbose_name=_("Name"),
|
|
14
16
|
linkify=True,
|
|
15
17
|
)
|
|
16
18
|
tags = TagColumn(
|
netbox_dns/tables/record.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
2
|
from django.utils.html import format_html
|
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
|
4
|
+
from django.utils.translation import pgettext_lazy as _p
|
|
3
5
|
|
|
4
6
|
|
|
5
7
|
from netbox.tables import (
|
|
@@ -23,33 +25,39 @@ __all__ = (
|
|
|
23
25
|
|
|
24
26
|
class RecordBaseTable(TenancyColumnsMixin, NetBoxTable):
|
|
25
27
|
zone = tables.Column(
|
|
28
|
+
verbose_name=_("Zone"),
|
|
26
29
|
linkify=True,
|
|
27
30
|
)
|
|
28
31
|
view = tables.Column(
|
|
32
|
+
verbose_name=_p("DNS", "View"),
|
|
29
33
|
accessor="zone__view",
|
|
30
34
|
linkify=True,
|
|
31
35
|
)
|
|
32
|
-
type = tables.Column(
|
|
36
|
+
type = tables.Column(
|
|
37
|
+
verbose_name=_("Type"),
|
|
38
|
+
)
|
|
33
39
|
name = tables.Column(
|
|
40
|
+
verbose_name=_("Name"),
|
|
34
41
|
linkify=True,
|
|
35
42
|
)
|
|
36
43
|
fqdn = tables.Column(
|
|
37
|
-
verbose_name="FQDN",
|
|
44
|
+
verbose_name=_("FQDN"),
|
|
38
45
|
linkify=True,
|
|
39
46
|
)
|
|
40
47
|
value = tables.TemplateColumn(
|
|
48
|
+
verbose_name=_("Value"),
|
|
41
49
|
template_code="{{ value|truncatechars:64 }}",
|
|
42
50
|
)
|
|
43
51
|
unicode_value = tables.TemplateColumn(
|
|
44
|
-
verbose_name="Unicode Value",
|
|
52
|
+
verbose_name=_("Unicode Value"),
|
|
45
53
|
template_code="{{ value|truncatechars:64 }}",
|
|
46
54
|
accessor="value",
|
|
47
55
|
)
|
|
48
56
|
ttl = tables.Column(
|
|
49
|
-
verbose_name="TTL",
|
|
57
|
+
verbose_name=_("TTL"),
|
|
50
58
|
)
|
|
51
59
|
active = tables.BooleanColumn(
|
|
52
|
-
verbose_name="Active",
|
|
60
|
+
verbose_name=_("Active"),
|
|
53
61
|
)
|
|
54
62
|
|
|
55
63
|
def render_name(self, value, record):
|
|
@@ -60,15 +68,17 @@ class RecordBaseTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
60
68
|
|
|
61
69
|
|
|
62
70
|
class RecordTable(RecordBaseTable):
|
|
63
|
-
status = ChoiceFieldColumn(
|
|
71
|
+
status = ChoiceFieldColumn(
|
|
72
|
+
verbose_name=_("Status"),
|
|
73
|
+
)
|
|
64
74
|
disable_ptr = tables.BooleanColumn(
|
|
65
|
-
verbose_name="Disable PTR",
|
|
75
|
+
verbose_name=_("Disable PTR"),
|
|
66
76
|
)
|
|
67
77
|
tags = TagColumn(
|
|
68
78
|
url_name="plugins:netbox_dns:record_list",
|
|
69
79
|
)
|
|
70
80
|
ptr_record = tables.Column(
|
|
71
|
-
verbose_name="PTR Record",
|
|
81
|
+
verbose_name=_("PTR Record"),
|
|
72
82
|
linkify=True,
|
|
73
83
|
)
|
|
74
84
|
|
|
@@ -91,15 +101,15 @@ class RecordTable(RecordBaseTable):
|
|
|
91
101
|
|
|
92
102
|
class ManagedRecordTable(RecordBaseTable):
|
|
93
103
|
address_record = tables.Column(
|
|
94
|
-
verbose_name="Address Record",
|
|
104
|
+
verbose_name=_("Address Record"),
|
|
95
105
|
linkify=True,
|
|
96
106
|
)
|
|
97
107
|
ipam_ip_address = tables.Column(
|
|
98
|
-
verbose_name="IPAM IP Address",
|
|
108
|
+
verbose_name=_("IPAM IP Address"),
|
|
99
109
|
linkify=True,
|
|
100
110
|
)
|
|
101
111
|
related_ip_address = tables.Column(
|
|
102
|
-
verbose_name="Related IP Address",
|
|
112
|
+
verbose_name=_("Related IP Address"),
|
|
103
113
|
empty_values=(),
|
|
104
114
|
orderable=False,
|
|
105
115
|
)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
3
|
|
|
3
4
|
from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
|
|
4
5
|
from tenancy.tables import TenancyColumnsMixin
|
|
@@ -15,23 +16,29 @@ __all__ = (
|
|
|
15
16
|
|
|
16
17
|
class RecordTemplateTable(TenancyColumnsMixin, NetBoxTable):
|
|
17
18
|
name = tables.Column(
|
|
19
|
+
verbose_name=_("Name"),
|
|
18
20
|
linkify=True,
|
|
19
21
|
)
|
|
20
|
-
record_name = tables.Column(
|
|
21
|
-
|
|
22
|
+
record_name = tables.Column(
|
|
23
|
+
verbose_name=_("Record Name"),
|
|
24
|
+
)
|
|
25
|
+
type = tables.Column(
|
|
26
|
+
verbose_name=_("Type"),
|
|
27
|
+
)
|
|
22
28
|
value = tables.TemplateColumn(
|
|
29
|
+
verbose_name=_("Value"),
|
|
23
30
|
template_code="{{ value|truncatechars:64 }}",
|
|
24
31
|
)
|
|
25
32
|
unicode_value = tables.TemplateColumn(
|
|
26
|
-
verbose_name="Unicode Value",
|
|
33
|
+
verbose_name=_("Unicode Value"),
|
|
27
34
|
template_code="{{ value|truncatechars:64 }}",
|
|
28
35
|
accessor="value",
|
|
29
36
|
)
|
|
30
37
|
ttl = tables.Column(
|
|
31
|
-
verbose_name="TTL",
|
|
38
|
+
verbose_name=_("TTL"),
|
|
32
39
|
)
|
|
33
40
|
disable_ptr = tables.BooleanColumn(
|
|
34
|
-
verbose_name="Disable PTR",
|
|
41
|
+
verbose_name=_("Disable PTR"),
|
|
35
42
|
)
|
|
36
43
|
tags = TagColumn(
|
|
37
44
|
url_name="plugins:netbox_dns:recordtemplate_list",
|
netbox_dns/tables/registrar.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
3
|
|
|
3
4
|
from netbox.tables import NetBoxTable, TagColumn
|
|
4
5
|
|
|
@@ -10,6 +11,7 @@ __all__ = ("RegistrarTable",)
|
|
|
10
11
|
|
|
11
12
|
class RegistrarTable(NetBoxTable):
|
|
12
13
|
name = tables.Column(
|
|
14
|
+
verbose_name=_("Name"),
|
|
13
15
|
linkify=True,
|
|
14
16
|
)
|
|
15
17
|
tags = TagColumn(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
3
|
|
|
3
4
|
from netbox.tables import NetBoxTable, TagColumn
|
|
4
5
|
|
|
@@ -10,6 +11,7 @@ __all__ = ("RegistrationContactTable",)
|
|
|
10
11
|
|
|
11
12
|
class RegistrationContactTable(NetBoxTable):
|
|
12
13
|
contact_id = tables.Column(
|
|
14
|
+
verbose_name=_("Contact ID"),
|
|
13
15
|
linkify=True,
|
|
14
16
|
)
|
|
15
17
|
tags = TagColumn(
|
netbox_dns/tables/view.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
3
|
|
|
3
4
|
from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
|
|
4
5
|
from tenancy.tables import TenancyColumnsMixin
|
|
@@ -14,10 +15,11 @@ __all__ = (
|
|
|
14
15
|
|
|
15
16
|
class ViewTable(TenancyColumnsMixin, NetBoxTable):
|
|
16
17
|
name = tables.Column(
|
|
18
|
+
verbose_name=_("Name"),
|
|
17
19
|
linkify=True,
|
|
18
20
|
)
|
|
19
21
|
default_view = tables.BooleanColumn(
|
|
20
|
-
verbose_name="Default View",
|
|
22
|
+
verbose_name=_("Default View"),
|
|
21
23
|
)
|
|
22
24
|
tags = TagColumn(url_name="plugins:netbox_dns:view_list")
|
|
23
25
|
|
netbox_dns/tables/zone.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import django_tables2 as tables
|
|
2
|
+
from django.utils.translation import gettext_lazy as _
|
|
3
|
+
from django.utils.translation import pgettext_lazy as _p
|
|
2
4
|
|
|
3
5
|
from netbox.tables import (
|
|
4
6
|
ChoiceFieldColumn,
|
|
@@ -15,15 +17,20 @@ __all__ = ("ZoneTable",)
|
|
|
15
17
|
|
|
16
18
|
class ZoneTable(TenancyColumnsMixin, NetBoxTable):
|
|
17
19
|
name = tables.Column(
|
|
20
|
+
verbose_name=_("Name"),
|
|
18
21
|
linkify=True,
|
|
19
22
|
)
|
|
20
23
|
view = tables.Column(
|
|
24
|
+
verbose_name=_p("DNS", "View"),
|
|
21
25
|
linkify=True,
|
|
22
26
|
)
|
|
23
27
|
soa_mname = tables.Column(
|
|
28
|
+
verbose_name=_("SOA MName"),
|
|
24
29
|
linkify=True,
|
|
25
30
|
)
|
|
26
|
-
status = ChoiceFieldColumn(
|
|
31
|
+
status = ChoiceFieldColumn(
|
|
32
|
+
verbose_name=_("Status"),
|
|
33
|
+
)
|
|
27
34
|
tags = TagColumn(
|
|
28
35
|
url_name="plugins:netbox_dns:zone_list",
|
|
29
36
|
)
|
|
@@ -31,24 +38,30 @@ class ZoneTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
31
38
|
verbose_name="Default TTL",
|
|
32
39
|
)
|
|
33
40
|
rfc2317_prefix = tables.Column(
|
|
34
|
-
verbose_name="RFC2317 Prefix",
|
|
41
|
+
verbose_name=_("RFC2317 Prefix"),
|
|
35
42
|
)
|
|
36
43
|
rfc2317_parent_zone = tables.Column(
|
|
44
|
+
verbose_name=_("RFC2317 Parent Zone"),
|
|
37
45
|
linkify=True,
|
|
38
46
|
)
|
|
39
47
|
registrar = tables.Column(
|
|
48
|
+
verbose_name=_("Registrar"),
|
|
40
49
|
linkify=True,
|
|
41
50
|
)
|
|
42
51
|
registrant = tables.Column(
|
|
52
|
+
verbose_name=_("Registrant"),
|
|
43
53
|
linkify=True,
|
|
44
54
|
)
|
|
45
55
|
admin_c = tables.Column(
|
|
56
|
+
verbose_name=_("Administrative Contact"),
|
|
46
57
|
linkify=True,
|
|
47
58
|
)
|
|
48
59
|
tech_c = tables.Column(
|
|
60
|
+
verbose_name=_("Technical Contact"),
|
|
49
61
|
linkify=True,
|
|
50
62
|
)
|
|
51
63
|
billing_c = tables.Column(
|
|
64
|
+
verbose_name=_("Billing Contact"),
|
|
52
65
|
linkify=True,
|
|
53
66
|
)
|
|
54
67
|
|