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
@@ -3,16 +3,28 @@
3
3
  {% load plugins %}
4
4
  {% load render_table from django_tables2 %}
5
5
  {% load perms %}
6
+ {% load i18n %}
6
7
 
7
- {% block controls %}
8
+ {% block control-buttons %}
9
+ {% if perms.netbox_dns.add_record and object.type != "CNAME" %}
10
+ <a href="{% url 'plugins:netbox_dns:record_add' %}?view={{ object.zone.view.pk }}&zone={{ object.zone.pk }}&value={{ object.fqdn }}&type=CNAME&return_url={{ object.get_absolute_url }}">
11
+ <button type="submit" class="btn btn-primary" name="add-record">
12
+ <i class="mdi mdi-plus-thick" aria-hidden="true"></i>{% trans "Add CNAME" %}
13
+ </button>
14
+ </a>
15
+ {% endif %}
8
16
  {% if object.managed %}
9
17
  {% else %}
10
18
  {{ block.super }}
11
19
  {% endif %}
12
- {% endblock controls %}
20
+ {% endblock control-buttons %}
13
21
 
14
22
  {% block breadcrumbs %}
15
- {% if not object.managed %}
23
+ {% if object.managed %}
24
+ <li class="breadcrumb-item">
25
+ <a href="{% url 'plugins:netbox_dns:record_list_managed' %}">{% trans "Managed Records" %}</a>
26
+ </li>
27
+ {% else %}
16
28
  {{ block.super }}
17
29
  {% endif %}
18
30
  {% endblock %}
@@ -32,99 +44,134 @@
32
44
  <div class="col col-md-8">
33
45
  {% endif %}
34
46
  <div class="card">
35
- <h5 class="card-header">Record</h5>
36
- <div class="card-body">
37
- <table class="table table-hover attr-table">
38
- <tr>
39
- <th scope="row">Name</th>
40
- <td style="word-break:break-all;">{{ object.name }}</td>
41
- </tr>
42
- {% if unicode_name %}
43
- <tr>
44
- <th scope="row">IDN</th>
45
- <td style="word-break:break-all;">{{ unicode_name }}</td>
46
- </tr>
47
- {% endif %}
48
- <tr>
49
- <th scope="row">Zone</th>
50
- {% if object.managed %}
51
- <td><a href="{% url 'plugins:netbox_dns:zone_managed_records' pk=object.zone.pk %}">{{ object.zone }}</a></td>
52
- {% else %}
53
- <td><a href="{% url 'plugins:netbox_dns:zone_records' pk=object.zone.pk %}">{{ object.zone }}</a></td>
54
- {% endif %}
55
- </tr>
56
- {% if not object.managed %}
57
- <tr>
58
- <th scope="row">Tenant</th>
59
- <td>
60
- {% if object.tenant.group %}
61
- {{ object.tenant.group|linkify }} /
62
- {% endif %}
63
- {{ object.tenant|linkify|placeholder }}
64
- </td>
65
- </tr>
66
- {% endif %}
67
- <tr>
68
- <th scope="row">Type</th>
69
- <td>{{ object.type }}</td>
70
- </tr>
71
- <tr>
72
- <th scope="row">Value</th>
73
- <td style="word-break:break-all;">{{ object.value }}</td>
74
- </tr>
75
- {% if unicode_value %}
76
- <tr>
77
- <th scope="row">Unicode Value</th>
78
- <td style="word-break:break-all;">{{ unicode_value }}</td>
79
- </tr>
80
- {% endif %}
81
- <tr>
82
- <th scope="row">TTL</th>
83
- <td>{{ object.ttl }}</td>
84
- </tr>
85
- {% if object.type == 'A' or object.type == 'AAAA' %}
86
- <tr>
87
- <th scope="row">Disable PTR</th>
88
- <td>{{ object.disable_ptr }}</td>
89
- </tr>
90
- {% endif %}
91
- {% if object.ptr_record %}
92
- <tr>
93
- <th scope="row">PTR Record</th>
94
- <td><a href="{% url 'plugins:netbox_dns:record' pk=object.ptr_record.pk %}">{{ object.ptr_record }}</td>
95
- </tr>
47
+ <h5 class="card-header">{% trans "Record" %}</h5>
48
+ <table class="table table-hover attr-table">
49
+ <tr>
50
+ <th scope="row">{% trans "Name" %}</th>
51
+ <td style="word-break:break-all;">{{ object.name }}</td>
52
+ </tr>
53
+ {% if mask_warning %}
54
+ <tr class="text-warning">
55
+ <th scope="row">{% trans "Warning" %}</th>
56
+ <td>{{ mask_warning }}</td>
57
+ </tr>
58
+ {% endif %}
59
+ {% if unicode_name %}
60
+ <tr>
61
+ <th scope="row">{% trans "IDN" %}</th>
62
+ <td style="word-break:break-all;">{{ unicode_name }}</td>
63
+ </tr>
64
+ {% endif %}
65
+ <tr>
66
+ <th scope="row">{% trans "Zone" %}</th>
67
+ {% if object.managed %}
68
+ <td><a href="{% url 'plugins:netbox_dns:zone_managed_records' pk=object.zone.pk %}">{{ object.zone }}</a></td>
69
+ {% else %}
70
+ <td><a href="{% url 'plugins:netbox_dns:zone_records' pk=object.zone.pk %}">{{ object.zone }}</a></td>
96
71
  {% endif %}
97
- {% if object.address_record %}
98
- <tr>
99
- <th scope="row">Address Record</th>
100
- <td><a href="{% url 'plugins:netbox_dns:record' pk=object.address_record.pk %}">{{ object.address_record }}</td>
101
- </tr>
102
- {% if object.address_record.ipam_ip_address %}
103
- <tr>
104
- <th scope="row">IPAM IP Address</th>
105
- <td><a href="{% url 'ipam:ipaddress' pk=object.address_record.ipam_ip_address.pk %}">{{ object.address_record.ipam_ip_address }}</td>
106
- </tr>
72
+ </tr>
73
+ <tr>
74
+ <th scope="row">{% trans "Type" %}</th>
75
+ <td>{{ object.type }}</td>
76
+ </tr>
77
+ <tr>
78
+ <th scope="row">{% trans "Value" %}</th>
79
+ <td style="word-break:break-all;">{{ object.value }}</td>
80
+ </tr>
81
+ {% if unicode_value %}
82
+ <tr>
83
+ <th scope="row">{% trans "Unicode Value" %}</th>
84
+ <td style="word-break:break-all;">{{ unicode_value }}</td>
85
+ </tr>
86
+ {% endif %}
87
+ {% if cname_warning %}
88
+ <tr class="text-warning">
89
+ <th scope="row">{% trans "Warning" %}</th>
90
+ <td>{{ cname_warning }}</td>
91
+ </tr>
92
+ {% endif %}
93
+ {% if object.description %}
94
+ <tr>
95
+ <th scope="row">{% trans "Description" %}</th>
96
+ <td style="word-break:break-all;">{{ object.description }}</td>
97
+ </tr>
98
+ {% endif %}
99
+ {% if object.tenant %}
100
+ <tr>
101
+ <th scope="row">{% trans "Tenant" %}</th>
102
+ <td>
103
+ {% if object.tenant.group %}
104
+ {{ object.tenant.group|linkify }} /
107
105
  {% endif %}
108
- {% endif %}
109
- {% if object.ipam_ip_address %}
110
- <tr>
111
- <th scope="row">IPAM IP Address</th>
112
- <td><a href="{% url 'ipam:ipaddress' pk=object.ipam_ip_address.pk %}">{{ object.ipam_ip_address }}</td>
113
- </tr>
114
- {% endif %}
115
- {% if not object.managed %}
116
- <tr>
117
- <th scope="row">Status</th>
118
- <td>{{ object.status }}</td>
119
- </tr>
120
- <tr>
121
- <th scope="row">Description</th>
122
- <td style="word-break:break-all;">{{ object.description }}</td>
123
- </tr>
124
- {% endif %}
125
- </table>
126
- </div>
106
+ {{ object.tenant|linkify|placeholder }}
107
+ </td>
108
+ </tr>
109
+ {% endif %}
110
+ <tr>
111
+ <th scope="row">{% trans "TTL" %}</th>
112
+ <td>{{ object.ttl|placeholder }}</td>
113
+ </tr>
114
+ {% if object.type == 'A' or object.type == 'AAAA' %}
115
+ <tr>
116
+ <th scope="row">{% trans "Disable PTR" %}</th>
117
+ <td>{% checkmark object.disable_ptr %}</td>
118
+ </tr>
119
+ {% endif %}
120
+ {% if object.ptr_record %}
121
+ <tr>
122
+ <th scope="row">{% trans "PTR Record" %}</th>
123
+ <td>{{ object.ptr_record|linkify }}</td>
124
+ </tr>
125
+ {% endif %}
126
+ {% if object.address_records.exists %}
127
+ <tr>
128
+ <th scope="row">{% trans "Address Records" %}</th>
129
+ <td>
130
+ <table>
131
+ {% for address_record in object.address_records.all %}
132
+ <tr>
133
+ <td>{{ address_record|linkify:"name" }}.{{ address_record.zone|linkify:"name" }}</td>
134
+ </tr>
135
+ {% endfor %}
136
+ </table>
137
+ </td>
138
+ </tr>
139
+ {% endif %}
140
+ {% if ipam_ip_address %}
141
+ <tr>
142
+ <th scope="row">{% trans "IPAM IP Address" %}</th>
143
+ <td>{{ ipam_ip_address|linkify }}</td>
144
+ </tr>
145
+ {% endif %}
146
+ <tr>
147
+ <th scope="row">Status</th>
148
+ <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
149
+ </tr>
150
+ </table>
127
151
  </div>
152
+ {% if cname_target_table %}
153
+ <div class="card">
154
+ {% if cname_target_table.rows|length == 1 %}
155
+ <h2 class="card-header">{% trans "CNAME Target" %}</h2>
156
+ {% else %}
157
+ <h2 class="card-header">{% trans "CNAME Targets" %}</h2>
158
+ {% endif %}
159
+ <div class="table-responsive">
160
+ {% render_table cname_target_table 'inc/table.html' %}
161
+ </div>
162
+ </div>
163
+ {% elif cname_table %}
164
+ <div class="card">
165
+ {% if cname_table.rows|length == 1 %}
166
+ <h2 class="card-header">{% trans "CNAME" %}</h2>
167
+ {% else %}
168
+ <h2 class="card-header">{% trans "CNAMEs" %}</h2>
169
+ {% endif %}
170
+ <div class="table-responsive">
171
+ {% render_table cname_table 'inc/table.html' %}
172
+ </div>
173
+ </div>
174
+ {% endif %}
128
175
  {% if not object.managed %}
129
176
  {% include 'inc/panels/custom_fields.html' %}
130
177
  {% endif %}
@@ -0,0 +1,96 @@
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-8">
11
+ <div class="card">
12
+ <h5 class="card-header">{% trans "Record Template" %}</h5>
13
+ <table class="table table-hover attr-table">
14
+ <tr>
15
+ <th scope="row">{% trans "Template Name" %}</th>
16
+ <td style="word-break:break-all;">{{ object.name }}</td>
17
+ </tr>
18
+ <tr>
19
+ <th scope="row">{% trans "Name" %}</th>
20
+ <td style="word-break:break-all;">{{ object.record_name }}</td>
21
+ </tr>
22
+ {% if unicode_name %}
23
+ <tr>
24
+ <th scope="row">{% trans "IDN" %}</th>
25
+ <td style="word-break:break-all;">{{ unicode_name }}</td>
26
+ </tr>
27
+ {% endif %}
28
+ {% if object.description %}
29
+ <tr>
30
+ <th scope="row">{% trans "Description" %}</th>
31
+ <td style="word-break:break-all;">{{ object.description }}</td>
32
+ </tr>
33
+ {% endif %}
34
+ {% if object.tenant %}
35
+ <tr>
36
+ <th scope="row">{% trans "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
+ {% endif %}
45
+ <tr>
46
+ <th scope="row">{% trans "Type" %}</th>
47
+ <td>{{ object.type }}</td>
48
+ </tr>
49
+ <tr>
50
+ <th scope="row">{% trans "Value" %}</th>
51
+ <td style="word-break:break-all;">{{ object.value }}</td>
52
+ </tr>
53
+ {% if unicode_value %}
54
+ <tr>
55
+ <th scope="row">{% trans "Unicode Value" %}/th>
56
+ <td style="word-break:break-all;">{{ unicode_value }}</td>
57
+ </tr>
58
+ {% endif %}
59
+ <tr>
60
+ <th scope="row">{% trans "TTL" %}</th>
61
+ <td>{{ object.ttl|placeholder }}</td>
62
+ </tr>
63
+ {% if object.type == 'A' or object.type == 'AAAA' %}
64
+ <tr>
65
+ <th scope="row">{% trans "Disable PTR" %}</th>
66
+ <td>{% checkmark object.disable_ptr %}</td>
67
+ </tr>
68
+ {% endif %}
69
+ <tr>
70
+ <th scope="row">{% trans "Status" %}</th>
71
+ <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ {% include 'inc/panels/custom_fields.html' %}
76
+ </div>
77
+ <div class="col col-md-4">
78
+ {% include 'inc/panels/tags.html' %}
79
+ </div>
80
+ {% if zone_template_table %}
81
+ <div class="col col-md-12">
82
+ <div class="card">
83
+ {% if zone_template_table.rows|length == 1 %}
84
+ <h2 class="card-header">{% trans "Zone Template" %}</h2>
85
+ {% else %}
86
+ <h2 class="card-header">{% trans "Zone Templates" %}</h2>
87
+ {% endif %}
88
+ <div class="table-responsive">
89
+ {% render_table zone_template_table 'inc/table.html' %}
90
+ </div>
91
+ </div>
92
+ </div>
93
+ {% endif %}
94
+ </div>
95
+
96
+ {% endblock %}
@@ -1,45 +1,52 @@
1
1
  {% extends 'generic/object.html' %}
2
+ {% load i18n %}
2
3
 
3
4
  {% block content %}
4
5
  <div class="row">
5
6
  <div class="col col-md-6">
6
7
  <div class="card">
7
- <h5 class="card-header">Registrar</h5>
8
- <div class="card-body">
9
- <table class="table table-hover attr-table">
10
- <tr>
11
- <th scope="row">Name</th>
12
- <td>{{ object.name }}</td>
13
- </tr>
14
- <tr>
15
- <th scope="row">IANA ID</th>
16
- <td>{{ object.iana_id }}</td>
17
- </tr>
18
- </table>
19
- </div>
8
+ <h5 class="card-header">{% trans "Registrar" %}</h5>
9
+ <table class="table table-hover attr-table">
10
+ <tr>
11
+ <th scope="row">{% trans "Name" %}</th>
12
+ <td>{{ object.name }}</td>
13
+ </tr>
14
+ {% if object.description %}
15
+ <tr>
16
+ <th scope="row">{% trans "Description" %}</th>
17
+ <td style="word-break:break-all;">{{ object.description }}</td>
18
+ </tr>
19
+ {% endif %}
20
+ <tr>
21
+ <th scope="row">{% trans "IANA ID" %}</th>
22
+ <td>{{ object.iana_id }}</td>
23
+ </tr>
24
+ </table>
20
25
  </div>
21
26
  <div class="card">
22
- <h5 class="card-header">Contact Details</h5>
23
- <div class="card-body">
24
- <table class="table table-hover attr-table">
25
- <tr>
26
- <th scope="row">Referral URL</th>
27
- <td><a href="{{ object.referral_url }}">{{ object.referral_url }}</a></td>
28
- </tr>
29
- <tr>
30
- <th scope="row">WHOIS Server</th>
31
- <td>{{ object.whois_server }}</td>
32
- </tr>
33
- <tr>
34
- <th scope="row">Abuse Email</th>
35
- <td>{{ object.abuse_email }}</td>
36
- </tr>
37
- <tr>
38
- <th scope="row">Abuse Phone</th>
39
- <td>{{ object.abuse_phone }}</td>
40
- </tr>
41
- </table>
42
- </div>
27
+ <h5 class="card-header">{% trans "Contact Details" %}</h5>
28
+ <table class="table table-hover attr-table">
29
+ <tr>
30
+ <th scope="row">{% trans "Address" %}</th>
31
+ <td>{{ object.address }}</td>
32
+ </tr>
33
+ <tr>
34
+ <th scope="row">{% trans "Referral URL" %}</th>
35
+ <td><a href="{{ object.referral_url }}">{{ object.referral_url }}</a></td>
36
+ </tr>
37
+ <tr>
38
+ <th scope="row">{% trans "WHOIS Server" %}</th>
39
+ <td>{{ object.whois_server }}</td>
40
+ </tr>
41
+ <tr>
42
+ <th scope="row">{% trans "Abuse Email" %}</th>
43
+ <td>{{ object.abuse_email }}</td>
44
+ </tr>
45
+ <tr>
46
+ <th scope="row">{% trans "Abuse Phone" %}</th>
47
+ <td>{{ object.abuse_phone }}</td>
48
+ </tr>
49
+ </table>
43
50
  </div>
44
51
  {% include 'inc/panels/custom_fields.html' %}
45
52
  </div>
@@ -0,0 +1,76 @@
1
+ {% extends 'generic/object.html' %}
2
+ {% load i18n %}
3
+
4
+ {% block content %}
5
+ <div class="row">
6
+ <div class="col col-md-6">
7
+ <div class="card">
8
+ <h5 class="card-header">{% trans "Registration Contact" %}</h5>
9
+ <table class="table table-hover attr-table">
10
+ <tr>
11
+ <th scope="row">{% trans "Name" %}</th>
12
+ <td>{{ object.name }}</td>
13
+ </tr>
14
+ {% if object.description %}
15
+ <tr>
16
+ <th scope="row">{% trans "Description" %}</th>
17
+ <td style="word-break:break-all;">{{ object.description }}</td>
18
+ </tr>
19
+ {% endif %}
20
+ <tr>
21
+ <th scope="row">{% trans "Contact ID" %}</th>
22
+ <td>{{ object.contact_id }}</td>
23
+ </tr>
24
+ <tr>
25
+ <th scope="row">{% trans "Organization" %}</th>
26
+ <td>{{ object.organization }}</td>
27
+ </tr>
28
+ <tr>
29
+ <th scope="row">{% trans "Street" %}</th>
30
+ <td>{{ object.street }}</td>
31
+ </tr>
32
+ <tr>
33
+ <th scope="row">{% trans "City" %}</th>
34
+ <td>{{ object.city }}</td>
35
+ </tr>
36
+ <tr>
37
+ <th scope="row">{% trans "State/Province" %}</th>
38
+ <td>{{ object.state_province }}</td>
39
+ </tr>
40
+ <tr>
41
+ <th scope="row">{% trans "Postal Code" %}</th>
42
+ <td>{{ object.postal_code }}</td>
43
+ </tr>
44
+ <tr>
45
+ <th scope="row">{% trans "Country" %}</th>
46
+ <td>{{ object.country }}</td>
47
+ </tr>
48
+ <tr>
49
+ <th scope="row">{% trans "Phone" %}</th>
50
+ <td>{{ object.phone }}</td>
51
+ </tr>
52
+ <tr>
53
+ <th scope="row">{% trans "Phone Extension" %}</th>
54
+ <td>{{ object.phone_ext }}</td>
55
+ </tr>
56
+ <tr>
57
+ <th scope="row">{% trans "Fax" %}</th>
58
+ <td>{{ object.fax }}</td>
59
+ </tr>
60
+ <tr>
61
+ <th scope="row">{% trans "Fax Extension" %}</th>
62
+ <td>{{ object.fax_ext }}</td>
63
+ </tr>
64
+ <tr>
65
+ <th scope="row">{% trans "Email" %}</th>
66
+ <td>{{ object.email }}</td>
67
+ </tr>
68
+ </table>
69
+ </div>
70
+ {% include 'inc/panels/custom_fields.html' %}
71
+ </div>
72
+ <div class="col col-md-6">
73
+ {% include 'inc/panels/tags.html' %}
74
+ </div>
75
+ </div>
76
+ {% endblock %}
@@ -0,0 +1,10 @@
1
+ {% load perms %}
2
+ {% load i18n %}
3
+
4
+ {% if perms.netbox_dns.change_view %}
5
+ <a href="{{ url }}?return_url={{ object.get_absolute_url }}">
6
+ <button type="submit" class="btn btn-primary" name="assign-view">
7
+ <i class="mdi mdi-eye-outline" aria-hidden="true"></i> {% trans "DNS Views" %}
8
+ </button>
9
+ </a>
10
+ {% endif %}
@@ -0,0 +1,44 @@
1
+ {% extends 'generic/_base.html' %}
2
+ {% load i18n %}
3
+
4
+ {% block title %}
5
+ {% blocktrans trimmed with type=object|meta:"verbose_name" name=object vrf=object.vrf|default:"" %}
6
+ Configure DNS views for {{ type }} {{ name }} {{ vrf }}
7
+ {% endblocktrans %}
8
+ {% endblock title %}
9
+
10
+ {% block content %}
11
+ <div class="tab-pane show active" id="edit-form" role="tabpanel" aria-labelledby="object-list-tab">
12
+
13
+ <form action="" method="post" enctype="multipart/form-data" class="object-edit mt-5">
14
+ {% csrf_token %}
15
+
16
+ <div id="form_fields" hx-disinherit="hx-select hx-swap">
17
+ {% if inherited_from %}
18
+ <div class="card">
19
+ <table class="table table-hover attr-table">
20
+ <th>{% trans "Views inherited from prefix" %} {{ inherited_from }} {% if inherited_from.vrf %}[{{ inherited_from.vrf }}] {% endif %}</th>
21
+ {% for view in inherited_views %}
22
+ <tr><td>{{ view|linkify }}</td><td>{{ view.description }}</td></tr>
23
+ {% endfor %}
24
+ </table>
25
+ </div>
26
+ {% endif %}
27
+ {% block form %}
28
+ {% include 'htmx/form.html' %}
29
+ {% endblock form %}
30
+ </div>
31
+
32
+ <div class="text-end my-3">
33
+ {% block buttons %}
34
+ <a href="{{ return_url }}" class="btn btn-outline-secondary">{% trans "Cancel" %}</a>
35
+ <button type="submit" name="_update" class="btn btn-primary">{% trans "Save" %}</button>
36
+ {% endblock buttons %}
37
+ </div>
38
+ </form>
39
+ </div>
40
+ {% endblock content %}
41
+
42
+ {% block modals %}
43
+ {% include 'inc/htmx_modal.html' with size='lg' %}
44
+ {% endblock %}
@@ -0,0 +1,33 @@
1
+ {% load render_table from django_tables2 %}
2
+ {% load perms %}
3
+ {% load i18n %}
4
+
5
+ {% if perms.netbox_dns.view_view %}
6
+ {% if assigned_views %}
7
+ <div class="col col-md-12">
8
+ <div class="card">
9
+ {% if assigned_views.rows|length == 1 %}
10
+ <h2 class="card-header">{% trans "Assigned DNS View" %}</h2>
11
+ {% else %}
12
+ <h2 class="card-header">{% trans "Assigned DNS Views" %}</h2>
13
+ {% endif %}
14
+ <div class="table-responsive">
15
+ {% render_table assigned_views 'inc/table.html' %}
16
+ </div>
17
+ </div>
18
+ </div>
19
+ {% elif inherited_views %}
20
+ <div class="col col-md-12">
21
+ <div class="card">
22
+ {% if inherited_views.rows|length == 1 %}
23
+ <h2 class="card-header">{% trans "Inherited DNS View" %}</h2>
24
+ {% else %}
25
+ <h2 class="card-header">{% trans "Inherited DNS Views" %}</h2>
26
+ {% endif %}
27
+ <div class="table-responsive">
28
+ {% render_table inherited_views 'inc/table.html' %}
29
+ </div>
30
+ </div>
31
+ </div>
32
+ {% endif %}
33
+ {% endif %}