netbox-plugin-dns 0.21.4__py3-none-any.whl → 1.4.7__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.
Files changed (232) hide show
  1. netbox_dns/__init__.py +106 -41
  2. netbox_dns/api/field_serializers.py +25 -0
  3. netbox_dns/api/nested_serializers.py +95 -52
  4. netbox_dns/api/serializers.py +14 -296
  5. netbox_dns/api/serializers_/__init__.py +0 -0
  6. netbox_dns/api/serializers_/dnssec_key_template.py +69 -0
  7. netbox_dns/api/serializers_/dnssec_policy.py +165 -0
  8. netbox_dns/api/serializers_/nameserver.py +56 -0
  9. netbox_dns/api/serializers_/prefix.py +18 -0
  10. netbox_dns/api/serializers_/record.py +105 -0
  11. netbox_dns/api/serializers_/record_template.py +71 -0
  12. netbox_dns/api/serializers_/registrar.py +45 -0
  13. netbox_dns/api/serializers_/registration_contact.py +50 -0
  14. netbox_dns/api/serializers_/view.py +81 -0
  15. netbox_dns/api/serializers_/zone.py +247 -0
  16. netbox_dns/api/serializers_/zone_template.py +157 -0
  17. netbox_dns/api/urls.py +13 -2
  18. netbox_dns/api/views.py +96 -58
  19. netbox_dns/choices/__init__.py +4 -0
  20. netbox_dns/choices/dnssec_key_template.py +67 -0
  21. netbox_dns/choices/dnssec_policy.py +40 -0
  22. netbox_dns/choices/record.py +104 -0
  23. netbox_dns/choices/utilities.py +4 -0
  24. netbox_dns/choices/zone.py +119 -0
  25. netbox_dns/fields/__init__.py +4 -0
  26. netbox_dns/fields/address.py +22 -16
  27. netbox_dns/fields/choice_array.py +33 -0
  28. netbox_dns/fields/ipam.py +15 -0
  29. netbox_dns/fields/network.py +42 -18
  30. netbox_dns/fields/rfc2317.py +97 -0
  31. netbox_dns/fields/timeperiod.py +33 -0
  32. netbox_dns/filters.py +7 -0
  33. netbox_dns/filtersets/__init__.py +12 -0
  34. netbox_dns/filtersets/dnssec_key_template.py +57 -0
  35. netbox_dns/filtersets/dnssec_policy.py +101 -0
  36. netbox_dns/filtersets/nameserver.py +46 -0
  37. netbox_dns/filtersets/record.py +135 -0
  38. netbox_dns/filtersets/record_template.py +59 -0
  39. netbox_dns/{filters → filtersets}/registrar.py +8 -1
  40. netbox_dns/{filters/contact.py → filtersets/registration_contact.py} +9 -3
  41. netbox_dns/filtersets/view.py +45 -0
  42. netbox_dns/filtersets/zone.py +254 -0
  43. netbox_dns/filtersets/zone_template.py +165 -0
  44. netbox_dns/forms/__init__.py +5 -1
  45. netbox_dns/forms/dnssec_key_template.py +250 -0
  46. netbox_dns/forms/dnssec_policy.py +654 -0
  47. netbox_dns/forms/nameserver.py +121 -27
  48. netbox_dns/forms/record.py +215 -104
  49. netbox_dns/forms/record_template.py +285 -0
  50. netbox_dns/forms/registrar.py +108 -31
  51. netbox_dns/forms/registration_contact.py +282 -0
  52. netbox_dns/forms/view.py +331 -20
  53. netbox_dns/forms/zone.py +769 -373
  54. netbox_dns/forms/zone_template.py +463 -0
  55. netbox_dns/graphql/__init__.py +25 -22
  56. netbox_dns/graphql/enums.py +41 -0
  57. netbox_dns/graphql/filter_lookups.py +13 -0
  58. netbox_dns/graphql/filters/__init__.py +12 -0
  59. netbox_dns/graphql/filters/dnssec_key_template.py +63 -0
  60. netbox_dns/graphql/filters/dnssec_policy.py +124 -0
  61. netbox_dns/graphql/filters/nameserver.py +32 -0
  62. netbox_dns/graphql/filters/record.py +89 -0
  63. netbox_dns/graphql/filters/record_template.py +55 -0
  64. netbox_dns/graphql/filters/registrar.py +30 -0
  65. netbox_dns/graphql/filters/registration_contact.py +27 -0
  66. netbox_dns/graphql/filters/view.py +28 -0
  67. netbox_dns/graphql/filters/zone.py +147 -0
  68. netbox_dns/graphql/filters/zone_template.py +97 -0
  69. netbox_dns/graphql/schema.py +89 -7
  70. netbox_dns/graphql/types.py +355 -0
  71. netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  72. netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  73. netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
  74. netbox_dns/management/commands/cleanup_database.py +175 -156
  75. netbox_dns/management/commands/cleanup_rrset_ttl.py +64 -0
  76. netbox_dns/management/commands/rebuild_dnssync.py +23 -0
  77. netbox_dns/management/commands/setup_dnssync.py +140 -0
  78. netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -27
  79. netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +557 -0
  80. netbox_dns/migrations/{0013_add_nameserver_zone_record_description.py → 0002_contact_description_registrar_description.py} +4 -9
  81. netbox_dns/migrations/0003_default_view.py +15 -0
  82. netbox_dns/migrations/0004_create_and_assign_default_view.py +26 -0
  83. netbox_dns/migrations/0005_alter_zone_view_not_null.py +18 -0
  84. netbox_dns/migrations/0006_templating.py +172 -0
  85. netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
  86. netbox_dns/migrations/0008_view_prefixes.py +18 -0
  87. netbox_dns/migrations/0009_rename_contact_registrationcontact.py +36 -0
  88. netbox_dns/migrations/0010_view_ip_address_filter.py +18 -0
  89. netbox_dns/migrations/0011_rename_related_fields.py +63 -0
  90. netbox_dns/migrations/0012_natural_ordering.py +88 -0
  91. netbox_dns/migrations/0013_zonetemplate_soa_mname_zonetemplate_soa_rname.py +30 -0
  92. netbox_dns/migrations/0014_alter_unique_constraints_lowercase.py +42 -0
  93. netbox_dns/migrations/0015_dnssec.py +168 -0
  94. netbox_dns/migrations/{0015_add_record_status.py → 0016_dnssec_policy_status.py} +5 -4
  95. netbox_dns/migrations/0017_dnssec_policy_zone_zone_template.py +41 -0
  96. netbox_dns/migrations/0018_zone_domain_status_zone_expiration_date.py +23 -0
  97. netbox_dns/migrations/0019_dnssecpolicy_parental_agents.py +25 -0
  98. netbox_dns/migrations/0020_netbox_3_4.py +1 -1
  99. netbox_dns/migrations/0020_remove_dnssecpolicy_parental_agents_and_more.py +29 -0
  100. netbox_dns/migrations/0021_alter_record_ptr_record.py +25 -0
  101. netbox_dns/migrations/0021_record_ip_address.py +1 -1
  102. netbox_dns/migrations/0022_alter_record_ipam_ip_address.py +26 -0
  103. netbox_dns/migrations/0023_disable_ptr_false.py +27 -0
  104. netbox_dns/migrations/0024_zonetemplate_parental_agents.py +25 -0
  105. netbox_dns/migrations/0025_remove_zone_inline_signing_and_more.py +22 -0
  106. netbox_dns/migrations/0026_alter_dnssecpolicy_nsec3_opt_out.py +18 -0
  107. netbox_dns/migrations/0026_domain_registration.py +1 -1
  108. netbox_dns/migrations/0027_zone_comments.py +18 -0
  109. netbox_dns/migrations/0028_alter_zone_default_ttl_alter_zone_soa_minimum_and_more.py +54 -0
  110. netbox_dns/migrations/0028_rfc2317_fields.py +44 -0
  111. netbox_dns/migrations/0029_alter_registrationcontact_street.py +18 -0
  112. netbox_dns/migrations/0029_record_fqdn.py +30 -0
  113. netbox_dns/mixins/__init__.py +1 -0
  114. netbox_dns/mixins/object_modification.py +57 -0
  115. netbox_dns/models/__init__.py +5 -1
  116. netbox_dns/models/dnssec_key_template.py +114 -0
  117. netbox_dns/models/dnssec_policy.py +203 -0
  118. netbox_dns/models/nameserver.py +61 -30
  119. netbox_dns/models/record.py +781 -234
  120. netbox_dns/models/record_template.py +198 -0
  121. netbox_dns/models/registrar.py +34 -15
  122. netbox_dns/models/{contact.py → registration_contact.py} +72 -43
  123. netbox_dns/models/view.py +129 -9
  124. netbox_dns/models/zone.py +806 -242
  125. netbox_dns/models/zone_template.py +209 -0
  126. netbox_dns/navigation.py +176 -76
  127. netbox_dns/signals/__init__.py +0 -0
  128. netbox_dns/signals/dnssec.py +32 -0
  129. netbox_dns/signals/ipam_dnssync.py +216 -0
  130. netbox_dns/tables/__init__.py +5 -1
  131. netbox_dns/tables/dnssec_key_template.py +49 -0
  132. netbox_dns/tables/dnssec_policy.py +140 -0
  133. netbox_dns/tables/ipam_dnssync.py +12 -0
  134. netbox_dns/tables/nameserver.py +14 -17
  135. netbox_dns/tables/record.py +117 -59
  136. netbox_dns/tables/record_template.py +91 -0
  137. netbox_dns/tables/registrar.py +20 -10
  138. netbox_dns/tables/{contact.py → registration_contact.py} +22 -11
  139. netbox_dns/tables/view.py +47 -3
  140. netbox_dns/tables/zone.py +62 -31
  141. netbox_dns/tables/zone_template.py +78 -0
  142. netbox_dns/template_content.py +124 -38
  143. netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +70 -0
  144. netbox_dns/templates/netbox_dns/dnssecpolicy.html +163 -0
  145. netbox_dns/templates/netbox_dns/nameserver.html +31 -28
  146. netbox_dns/templates/netbox_dns/record/managed.html +2 -1
  147. netbox_dns/templates/netbox_dns/record/related.html +17 -6
  148. netbox_dns/templates/netbox_dns/record.html +140 -93
  149. netbox_dns/templates/netbox_dns/recordtemplate.html +96 -0
  150. netbox_dns/templates/netbox_dns/registrar.html +41 -34
  151. netbox_dns/templates/netbox_dns/registrationcontact.html +76 -0
  152. netbox_dns/templates/netbox_dns/view/button.html +10 -0
  153. netbox_dns/templates/netbox_dns/view/prefix.html +44 -0
  154. netbox_dns/templates/netbox_dns/view/related.html +33 -0
  155. netbox_dns/templates/netbox_dns/view.html +62 -18
  156. netbox_dns/templates/netbox_dns/zone/base.html +6 -3
  157. netbox_dns/templates/netbox_dns/zone/child.html +6 -5
  158. netbox_dns/templates/netbox_dns/zone/child_zone.html +18 -0
  159. netbox_dns/templates/netbox_dns/zone/delegation_record.html +18 -0
  160. netbox_dns/templates/netbox_dns/zone/managed_record.html +1 -1
  161. netbox_dns/templates/netbox_dns/zone/record.html +6 -5
  162. netbox_dns/templates/netbox_dns/zone/registration.html +43 -24
  163. netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +18 -0
  164. netbox_dns/templates/netbox_dns/zone.html +178 -119
  165. netbox_dns/templates/netbox_dns/zonetemplate/child.html +46 -0
  166. netbox_dns/templates/netbox_dns/zonetemplate.html +124 -0
  167. netbox_dns/templatetags/netbox_dns.py +10 -0
  168. netbox_dns/urls.py +50 -210
  169. netbox_dns/utilities/__init__.py +3 -0
  170. netbox_dns/{utilities.py → utilities/conversions.py} +55 -7
  171. netbox_dns/utilities/dns.py +11 -0
  172. netbox_dns/utilities/ipam_dnssync.py +370 -0
  173. netbox_dns/validators/__init__.py +4 -0
  174. netbox_dns/validators/dns_name.py +116 -0
  175. netbox_dns/validators/dns_value.py +147 -0
  176. netbox_dns/validators/dnssec.py +148 -0
  177. netbox_dns/validators/rfc2317.py +28 -0
  178. netbox_dns/views/__init__.py +5 -1
  179. netbox_dns/views/dnssec_key_template.py +78 -0
  180. netbox_dns/views/dnssec_policy.py +146 -0
  181. netbox_dns/views/nameserver.py +34 -15
  182. netbox_dns/views/record.py +156 -15
  183. netbox_dns/views/record_template.py +93 -0
  184. netbox_dns/views/registrar.py +32 -13
  185. netbox_dns/views/registration_contact.py +101 -0
  186. netbox_dns/views/view.py +58 -14
  187. netbox_dns/views/zone.py +130 -33
  188. netbox_dns/views/zone_template.py +82 -0
  189. netbox_plugin_dns-1.4.7.dist-info/METADATA +132 -0
  190. netbox_plugin_dns-1.4.7.dist-info/RECORD +201 -0
  191. {netbox_plugin_dns-0.21.4.dist-info → netbox_plugin_dns-1.4.7.dist-info}/WHEEL +2 -1
  192. {netbox_plugin_dns-0.21.4.dist-info → netbox_plugin_dns-1.4.7.dist-info/licenses}/LICENSE +2 -1
  193. netbox_plugin_dns-1.4.7.dist-info/top_level.txt +1 -0
  194. netbox_dns/filters/__init__.py +0 -6
  195. netbox_dns/filters/nameserver.py +0 -18
  196. netbox_dns/filters/record.py +0 -53
  197. netbox_dns/filters/view.py +0 -18
  198. netbox_dns/filters/zone.py +0 -112
  199. netbox_dns/forms/contact.py +0 -211
  200. netbox_dns/graphql/contact.py +0 -19
  201. netbox_dns/graphql/nameserver.py +0 -19
  202. netbox_dns/graphql/record.py +0 -19
  203. netbox_dns/graphql/registrar.py +0 -19
  204. netbox_dns/graphql/view.py +0 -19
  205. netbox_dns/graphql/zone.py +0 -19
  206. netbox_dns/management/commands/setup_coupling.py +0 -75
  207. netbox_dns/management/commands/update_soa.py +0 -22
  208. netbox_dns/middleware.py +0 -226
  209. netbox_dns/migrations/0001_initial.py +0 -115
  210. netbox_dns/migrations/0002_zone_default_ttl.py +0 -18
  211. netbox_dns/migrations/0003_soa_managed_records.py +0 -112
  212. netbox_dns/migrations/0004_create_ptr_for_a_aaaa_records.py +0 -80
  213. netbox_dns/migrations/0005_update_ns_records.py +0 -41
  214. netbox_dns/migrations/0006_zone_soa_serial_auto.py +0 -29
  215. netbox_dns/migrations/0007_alter_zone_soa_serial_auto.py +0 -17
  216. netbox_dns/migrations/0008_zone_status_names.py +0 -21
  217. netbox_dns/migrations/0009_netbox32.py +0 -71
  218. netbox_dns/migrations/0010_update_soa_records.py +0 -58
  219. netbox_dns/migrations/0011_add_view_model.py +0 -70
  220. netbox_dns/migrations/0012_adjust_zone_and_record.py +0 -17
  221. netbox_dns/migrations/0014_add_view_description.py +0 -16
  222. netbox_dns/migrations/0016_cleanup_ptr_records.py +0 -38
  223. netbox_dns/migrations/0017_alter_record_ttl.py +0 -17
  224. netbox_dns/migrations/0018_zone_arpa_network.py +0 -51
  225. netbox_dns/migrations/0019_update_ns_ttl.py +0 -19
  226. netbox_dns/templates/netbox_dns/contact.html +0 -71
  227. netbox_dns/templates/netbox_dns/related_dns_objects.html +0 -21
  228. netbox_dns/templatetags/view_helpers.py +0 -15
  229. netbox_dns/validators.py +0 -57
  230. netbox_dns/views/contact.py +0 -83
  231. netbox_plugin_dns-0.21.4.dist-info/METADATA +0 -101
  232. netbox_plugin_dns-0.21.4.dist-info/RECORD +0 -110
@@ -1,149 +1,208 @@
1
1
  {% extends 'netbox_dns/zone/base.html' %}
2
2
  {% load helpers %}
3
- {% load render_table from django_tables2 %}
4
- {% load view_helpers %}
3
+ {% load i18n %}
4
+ {% load netbox_dns %}
5
+ {% load tz %}
5
6
 
6
7
  {% block content %}
7
8
  <div class="row">
8
9
  <div class="col col-md-6">
9
10
  <div class="card">
10
- <h5 class="card-header">
11
- Zone
12
- </h5>
13
- <div class="card-body">
11
+ <h5 class="card-header">{% trans "Zone" %}</h5>
12
+ <table class="table table-hover attr-table">
13
+ <tr>
14
+ <th scope="row">{% trans "Name" %}</th>
15
+ <td>{{ object.name }}</td>
16
+ </tr>
17
+ {% if unicode_name %}
18
+ <tr>
19
+ <th scope="row">{% trans "IDN" %}</th>
20
+ <td>{{ unicode_name }}</td>
21
+ </tr>
22
+ {% endif %}
23
+ {% if parent_zone %}
24
+ <tr>
25
+ <th scope="row">{% trans "Parent Zone" %}</th>
26
+ <td>{{ parent_zone|linkify }}</td>
27
+ </tr>
28
+ {% endif %}
29
+ <tr>
30
+ <th scope="row">{% trans "View" %}</th>
31
+ <td>{{ object.view|linkify }}</td>
32
+ </tr>
33
+ {% if object.description %}
34
+ <tr>
35
+ <th scope="row">{% trans "Description" %}</th>
36
+ <td style="word-break:break-all;">{{ object.description }}</td>
37
+ </tr>
38
+ {% endif %}
39
+ {% if object.tenant %}
40
+ <tr>
41
+ <th scope="row">{% trans "Tenant" %}</th>
42
+ <td>
43
+ {% if object.tenant.group %}
44
+ {{ object.tenant.group|linkify }} /
45
+ {% endif %}
46
+ {{ object.tenant|linkify|placeholder }}
47
+ </td>
48
+ </tr>
49
+ {% endif %}
50
+ <tr>
51
+ <th scope="row">{% trans "Status" %}</th>
52
+ <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
53
+ </tr>
54
+ <tr>
55
+ <th scope="row">{% trans "Nameservers" %}</th>
56
+ <td>
57
+ <table>
58
+ {% for nameserver in object.nameservers.all %}
59
+ <tr><td>{{ nameserver|linkify }}</td></tr>
60
+ {% endfor %}
61
+ </table>
62
+ </td>
63
+ {% if nameserver_warnings %}
64
+ <tr>
65
+ <th class="text-warning" scope="row">{% trans "Warnings" %}</th>
66
+ <td>
67
+ <table>
68
+ {% for warning in nameserver_warnings %}
69
+ <tr>
70
+ <td class="text-warning">{{ warning }}</td>
71
+ </tr>
72
+ {% endfor %}
73
+ </table>
74
+ </td>
75
+ </tr>
76
+ {% endif %}
77
+ {% if nameserver_errors %}
78
+ <tr>
79
+ <th class="text-danger" scope="row">{% trans "Errors" %}</th>
80
+ <td>
81
+ <table>
82
+ {% for error in nameserver_errors %}
83
+ <tr>
84
+ <td class="text-danger">{{ error }}</td>
85
+ </tr>
86
+ {% endfor %}
87
+ </table>
88
+ </td>
89
+ </tr>
90
+ {% endif %}
91
+ </tr>
92
+ <tr>
93
+ <th scope="row">{% trans "Default TTL" %}</th>
94
+ <td>{{ object.default_ttl }}</td>
95
+ </tr>
96
+ </table>
97
+ </div>
98
+
99
+ {% if object.dnssec_policy %}
100
+ <div class="card">
101
+ <h5 class="card-header">{% trans "DNSSEC" %}</h5>
14
102
  <table class="table table-hover attr-table">
15
103
  <tr>
16
- <th scope="row">Name</th>
17
- <td>{{ object.name }}</td>
18
- </tr>
19
- {% if unicode_name %}
20
- <tr>
21
- <th scope="row">IDN</th>
22
- <td>{{ unicode_name }}</td>
23
- </tr>
24
- {% endif %}
25
- {% if object.view %}
26
- <tr>
27
- <th scope="row">View</th>
28
- <td>
29
- <a href="{% url 'plugins:netbox_dns:view' pk=object.view.pk %}">
30
- {{ object.view }}
31
- </a>
32
- </td>
33
- </tr>
34
- {% endif %}
35
- <tr>
36
- <th scope="row">Tenant</th>
37
- <td>
38
- {% if object.tenant.group %}
39
- {{ object.tenant.group|linkify }} /
40
- {% endif %}
41
- {{ object.tenant|linkify|placeholder }}
42
- </td>
43
- </tr>
44
- <tr>
45
- <th scope="row">Status</th>
46
- <td>{{ object.status }}</td>
47
- </tr>
48
- <tr>
49
- <th scope="row">Nameservers</th>
50
- <td>
51
- <table>
52
- {% for nameserver in object.nameservers.all %}
53
- <tr>
54
- <td>
55
- <a href="{% url 'plugins:netbox_dns:nameserver' pk=nameserver.pk %}">
56
- {{ nameserver }}
57
- </a>
58
- </td>
59
- </tr>
60
- {% endfor %}
61
- </table>
62
- </td>
63
- {% if nameserver_warnings %}
64
- <tr>
65
- <th class="text-warning" scope="row">Warnings</th>
66
- <td>
67
- <table>
68
- {% for warning in nameserver_warnings %}
69
- <tr>
70
- <td class="text-warning">{{ warning }}</td>
71
- </tr>
72
- {% endfor %}
73
- </table>
74
- </td>
104
+ <th scope="row">{% trans "Policy" %}</th>
105
+ <td>{{ object.dnssec_policy|linkify }}</td>
75
106
  </tr>
76
- {% endif %}
77
- {% if nameserver_errors %}
78
107
  <tr>
79
- <th class="text-danger" scope="row">Errors</th>
108
+ <th scope="row">{% trans "Parental Agents" %}</th>
80
109
  <td>
81
110
  <table>
82
- {% for error in nameserver_errors %}
83
- <tr>
84
- <td class="text-danger">{{ error }}</td>
85
- </tr>
111
+ {% for parental_agent in object.parental_agents %}
112
+ <tr><td>{{ parental_agent }}</td></tr>
86
113
  {% endfor %}
87
114
  </table>
88
115
  </td>
89
116
  </tr>
90
- {% endif %}
91
- </tr>
92
- <tr>
93
- <th scope="row">Default TTL</th>
94
- <td>{{ object.default_ttl }}</td>
95
- </tr>
96
- <tr>
97
- <th scope="row">Description</th>
98
- <td>{{ object.description }}</td>
99
- </tr>
100
117
  </table>
101
118
  </div>
102
- </div>
119
+ {% endif %}
103
120
 
121
+ {% include 'inc/panels/comments.html' %}
104
122
  {% include 'inc/panels/tags.html' %}
105
123
  {% include 'inc/panels/custom_fields.html' %}
106
124
  </div>
107
125
  <div class="col col-md-6">
108
126
  <div class="card">
109
- <h5 class="card-header">Zone SOA</h5>
110
- <div class="card-body">
111
- <table class="table table-hover attr-table">
112
- <tr>
113
- <th scope="row">TTL</th>
114
- <td>{{ object.soa_ttl }}</td>
115
- </tr>
116
- <tr>
117
- <th scope="row">Primary Nameserver</th>
118
- <td><a href="{% url 'plugins:netbox_dns:nameserver' pk=object.soa_mname.pk %}">{{ object.soa_mname }}</a></td>
119
- </tr>
120
- <tr>
121
- <th scope="row">Responsible</th>
122
- <td>{{ object.soa_rname }}</td>
123
- </tr>
124
- <tr>
125
- <th scope="row">Serial</th>
126
- <td>{{ object.soa_serial }}</td>
127
- </tr>
128
- <tr>
129
- <th scope="row">Refresh</th>
130
- <td>{{ object.soa_refresh }}</td>
131
- </tr>
132
- <tr>
133
- <th scope="row">Retry</th>
134
- <td>{{ object.soa_retry }}</td>
135
- </tr>
136
- <tr>
137
- <th scope="row">Expire</th>
138
- <td>{{ object.soa_expire }}</td>
139
- </tr>
140
- <tr>
141
- <th scope="row">Minimum TTL</th>
142
- <td>{{ object.soa_minimum }}</td>
143
- </tr>
144
- </table>
127
+ <h5 class="card-header">{% trans "Zone SOA" %}</h5>
128
+ <table class="table table-hover attr-table">
129
+ <tr>
130
+ <th scope="row">{% trans "TTL" %}</th>
131
+ <td>{{ object.soa_ttl }}</td>
132
+ </tr>
133
+ <tr>
134
+ <th scope="row">{% trans "MName" %}</th>
135
+ <td>{{ object.soa_mname|linkify }}</td>
136
+ </tr>
137
+ {% if mname_warning %}
138
+ <tr>
139
+ <th class="text-warning" scope="row">{% trans "Warning" %}</th>
140
+ <td class="text-warning">{{ mname_warning }}</td>
141
+ </tr>
142
+ {% endif %}
143
+
144
+ <tr>
145
+ <th scope="row">{% trans "RName" %}</th>
146
+ <td>{{ object.soa_rname }}</td>
147
+ </tr>
148
+ {% if object.soa_serial_auto %}
149
+ <tr>
150
+ <th scope="row">{% trans "Serial (auto-generated)" %}</th>
151
+ <td>
152
+ <table style="width: 100%;">
153
+ <tr>
154
+ <td>{{ object.soa_serial }}</td>
155
+ <td align="right" class="text-muted">{{ object.soa_serial|epoch_to_utc|isodatetime }}</td>
156
+ </tr>
157
+ </table>
158
+ </td>
159
+ </tr>
160
+ {% else %}
161
+ <tr>
162
+ <th scope="row">{% trans "Serial" context "SOA" %}</th>
163
+ <td>{{ object.soa_serial }}</td>
164
+ </tr>
165
+ {% endif %}
166
+ <tr>
167
+ <th scope="row">{% trans "Refresh" %}</th>
168
+ <td>{{ object.soa_refresh }}</td>
169
+ </tr>
170
+ <tr>
171
+ <th scope="row">{% trans "Retry" %}</th>
172
+ <td>{{ object.soa_retry }}</td>
173
+ </tr>
174
+ <tr>
175
+ <th scope="row">{% trans "Expire" %}</th>
176
+ <td>{{ object.soa_expire }}</td>
177
+ </tr>
178
+ <tr>
179
+ <th scope="row">{% trans "Minimum TTL" %}</th>
180
+ <td>{{ object.soa_minimum }}</td>
181
+ </tr>
182
+ </table>
183
+ </div>
184
+ {% if object.rfc2317_prefix %}
185
+ <div class="card">
186
+ <h5 class="card-header">{% trans "RFC2317" %}</h5>
187
+ <table class="table table-hover attr-table">
188
+ <tr>
189
+ <th scope="row">{% trans "Prefix" %}</th>
190
+ <td>{{ object.rfc2317_prefix }}</td>
191
+ </tr>
192
+ <tr>
193
+ <th scope="row">{% trans "Parent Managed" %}</th>
194
+ <td>{% checkmark object.rfc2317_parent_managed %}</td>
195
+ </tr>
196
+ {% if object.rfc2317_parent_managed %}
197
+ <tr>
198
+ <th scope="row">{% trans "Parent Zone" %}</th>
199
+ <td>{{ object.rfc2317_parent_zone|linkify }}</td>
200
+ </tr>
201
+ {% endif %}
202
+ </table>
145
203
  </div>
146
204
  </div>
205
+ {% endif %}
147
206
  </div>
148
207
  </div>
149
208
  {% endblock %}
@@ -0,0 +1,46 @@
1
+ {% extends 'generic/object.html' %}
2
+ {% load helpers %}
3
+ {% load render_table from django_tables2 %}
4
+ {% load perms %}
5
+ {% load i18n %}
6
+
7
+ {% block content %}
8
+ {% include 'inc/table_controls_htmx.html' with table_modal="ZoneTemplateTable_config" %}
9
+
10
+ <form method="post">
11
+ {% csrf_token %}
12
+ <input type="hidden" name="return_url" value="{% if return_url %}{{ return_url }}{% else %}{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}{% endif %}" />
13
+
14
+ <div class="card">
15
+ <div class="htmx-container table-responsive" id="object_list">
16
+ {% include 'htmx/table.html' %}
17
+ </div>
18
+ </div>
19
+
20
+ {% if perms.netbox_dns.change_zonetemplate or perms.netbox_dns.delete_zonetemplate %}
21
+ {% with bulk_edit_url="plugins:netbox_dns:zonetemplate_bulk_edit" bulk_delete_url="plugins:netbox_dns:zonetemplate_bulk_delete" %}
22
+ <div class="noprint bulk-buttons">
23
+ <div class="bulk-button-group">
24
+ {% block bulk_buttons %}{% endblock %}
25
+ {% if bulk_edit_url and perms.netbox_dns.change_zonetemplate %}
26
+ <button type="submit" name="_edit" formaction="{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-warning">
27
+ <i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit Selected" %}
28
+ </button>
29
+ {% endif %}
30
+ {% if bulk_delete_url and perms.netbox_dns.delete_zonetemplate %}
31
+ <button type="submit" name="_delete" formaction="{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-danger">
32
+ <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete Selected" %}
33
+ </button>
34
+ {% endif %}
35
+ </div>
36
+ </div>
37
+ {% endwith %}
38
+ {% endif %}
39
+ </form>
40
+
41
+ {% endblock %}
42
+
43
+ {% block modals %}
44
+ {{ block.super }}
45
+ {% table_config_form table %}
46
+ {% endblock modals %}
@@ -0,0 +1,124 @@
1
+ {% extends 'generic/object.html' %}
2
+ {% load helpers %}
3
+ {% load plugins %}
4
+ {% load render_table from django_tables2 %}
5
+ {% load perms %}
6
+ {% load i18n %}
7
+
8
+ {% block content %}
9
+ <div class="row">
10
+ <div class="col col-md-6">
11
+ <div class="card">
12
+ <h5 class="card-header">{% trans "Zone Template" %}</h5>
13
+ <table class="table table-hover attr-table">
14
+ <tr>
15
+ <th scope="row">{% trans "Name" %}</th>
16
+ <td>{{ object.name }}</td>
17
+ </tr>
18
+ {% if object.description %}
19
+ <tr>
20
+ <th scope="row">{% trans "Description" %}</th>
21
+ <td style="word-break:break-all;">{{ object.description }}</td>
22
+ </tr>
23
+ {% endif %}
24
+ {% if object.tenant %}
25
+ <tr>
26
+ <th scope="row">{% trans "Tenant" %}</th>
27
+ <td>
28
+ {% if object.tenant.group %}
29
+ {{ object.tenant.group|linkify }} /
30
+ {% endif %}
31
+ {{ object.tenant|linkify|placeholder }}
32
+ </td>
33
+ </tr>
34
+ {% endif %}
35
+ <tr>
36
+ <th scope="row">{% trans "Nameservers" %}</th>
37
+ <td>
38
+ <table>
39
+ {% for nameserver in object.nameservers.all %}
40
+ <tr><td>{{ nameserver|linkify }}</td></tr>
41
+ {% endfor %}
42
+ </table>
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <th scope="row">{% trans "SOA MName" %}</th>
47
+ <td>{{ object.soa_mname|linkify }}</td>
48
+ </tr>
49
+ <tr>
50
+ <th scope="row">{% trans "SOA RName" %}</th>
51
+ <td>{{ object.soa_rname }}</td>
52
+ </tr>
53
+ </table>
54
+ </div>
55
+
56
+ {% if object.dnssec_policy %}
57
+ <div class="card">
58
+ <h5 class="card-header">{% trans "DNSSEC" %}</h5>
59
+ <table class="table table-hover attr-table">
60
+ <tr>
61
+ <th scope="row">{% trans "Policy" %}</th>
62
+ <td>{{ object.dnssec_policy|linkify }}</td>
63
+ </tr>
64
+ <tr>
65
+ <th scope="row">{% trans "Parental Agents" %}</th>
66
+ <td>
67
+ <table>
68
+ {% for parental_agent in object.parental_agents %}
69
+ <tr><td>{{ parental_agent }}</td></tr>
70
+ {% endfor %}
71
+ </table>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ </div>
76
+ {% endif %}
77
+
78
+ {% include 'inc/panels/tags.html' %}
79
+ {% include 'inc/panels/custom_fields.html' %}
80
+ </div>
81
+ <div class="col col-md-6">
82
+ <div class="card">
83
+ <h5 class="card-header">{% trans "Domain Registration" %}</h5>
84
+ <table class="table table-hover attr-table">
85
+ <tr>
86
+ <th scope="row">{% trans "Registrar" %}</th>
87
+ <td>{{ object.registrar|linkify|placeholder }}</td>
88
+ </tr>
89
+ <tr>
90
+ <th scope="row">{% trans "Registrant" %}</th>
91
+ <td>{{ object.registrant|linkify|placeholder }}</td>
92
+ </tr>
93
+ <tr>
94
+ <th scope="row">{% trans "Administrative Contact" %}</th>
95
+ <td>{{ object.admin_c|linkify|placeholder }}</td>
96
+ </tr>
97
+ <tr>
98
+ <th scope="row">{% trans "Technical Contact" %}</th>
99
+ <td>{{ object.tech_c|linkify|placeholder }}</td>
100
+ </tr>
101
+ <tr>
102
+ <th scope="row">{% trans "Billing Contact" %}</th>
103
+ <td>{{ object.billing_c|linkify|placeholder }}</td>
104
+ </tr>
105
+ </table>
106
+ </div>
107
+ </div>
108
+ </div>
109
+ {% if record_template_table %}
110
+ <div class="col col-md-12">
111
+ <div class="card">
112
+ {% if record_template_table.rows|length == 1 %}
113
+ <h2 class="card-header">{% trans "Record Template" %}</h2>
114
+ {% else %}
115
+ <h2 class="card-header">{% trans "Record Templates" %}</h2>
116
+ {% endif %}
117
+ <div class="table-responsive">
118
+ {% render_table record_template_table 'inc/table.html' %}
119
+ </div>
120
+ </div>
121
+ </div>
122
+ {% endif %}
123
+ </div>
124
+ {% endblock %}
@@ -0,0 +1,10 @@
1
+ from datetime import datetime, timezone
2
+
3
+ from django import template
4
+
5
+ register = template.Library()
6
+
7
+
8
+ @register.filter(name="epoch_to_utc")
9
+ def epoch_to_utc(epoch):
10
+ return datetime.fromtimestamp(epoch, tz=timezone.utc)