nautobot 2.2.0b1__py3-none-any.whl → 2.2.2__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 nautobot might be problematic. Click here for more details.

Files changed (429) hide show
  1. nautobot/__init__.py +31 -0
  2. nautobot/apps/api.py +1 -2
  3. nautobot/apps/utils.py +4 -0
  4. nautobot/apps/views.py +2 -0
  5. nautobot/circuits/api/urls.py +1 -2
  6. nautobot/circuits/api/views.py +0 -12
  7. nautobot/circuits/apps.py +1 -1
  8. nautobot/circuits/tests/test_filters.py +1 -1
  9. nautobot/core/api/routers.py +50 -3
  10. nautobot/core/api/utils.py +4 -0
  11. nautobot/core/api/views.py +21 -15
  12. nautobot/core/cli/__init__.py +18 -11
  13. nautobot/core/constants.py +85 -0
  14. nautobot/core/filters.py +7 -1
  15. nautobot/core/forms/widgets.py +1 -2
  16. nautobot/core/graphql/schema.py +1 -0
  17. nautobot/core/management/commands/generate_test_data.py +4 -4
  18. nautobot/core/models/__init__.py +1 -0
  19. nautobot/core/settings.py +24 -3
  20. nautobot/core/settings.yaml +20 -0
  21. nautobot/core/signals.py +1 -0
  22. nautobot/core/tables.py +2 -1
  23. nautobot/core/templates/admin/base.html +23 -94
  24. nautobot/core/templates/generic/object_retrieve.html +2 -2
  25. nautobot/core/templates/graphene/graphiql.html +18 -47
  26. nautobot/core/templates/inc/footer.html +5 -5
  27. nautobot/core/templates/inc/javascript.html +4 -4
  28. nautobot/core/templates/inc/media.html +2 -2
  29. nautobot/core/templates/inc/nav_menu.html +0 -7
  30. nautobot/core/templates/nautobot_config.py.j2 +14 -1
  31. nautobot/core/templates/rest_framework/api.html +12 -5
  32. nautobot/core/templatetags/helpers.py +2 -2
  33. nautobot/core/testing/__init__.py +1 -1
  34. nautobot/core/testing/filters.py +1 -1
  35. nautobot/core/testing/views.py +30 -0
  36. nautobot/core/tests/integration/test_view_authentication.py +68 -0
  37. nautobot/core/tests/test_api.py +13 -6
  38. nautobot/core/tests/test_csv.py +5 -4
  39. nautobot/core/tests/test_filters.py +2 -1
  40. nautobot/core/tests/test_graphql.py +4 -14
  41. nautobot/core/tests/test_navigations.py +3 -0
  42. nautobot/core/tests/test_views.py +45 -16
  43. nautobot/core/utils/data.py +1 -2
  44. nautobot/core/utils/lookup.py +126 -0
  45. nautobot/core/views/__init__.py +3 -7
  46. nautobot/core/views/generic.py +24 -10
  47. nautobot/core/views/mixins.py +11 -4
  48. nautobot/core/views/renderers.py +11 -6
  49. nautobot/core/wsgi.py +9 -2
  50. nautobot/dcim/api/serializers.py +4 -4
  51. nautobot/dcim/api/urls.py +2 -3
  52. nautobot/dcim/api/views.py +7 -18
  53. nautobot/dcim/apps.py +8 -4
  54. nautobot/dcim/elevations.py +5 -1
  55. nautobot/dcim/factory.py +7 -7
  56. nautobot/dcim/filters/__init__.py +16 -17
  57. nautobot/dcim/forms.py +69 -48
  58. nautobot/dcim/homepage.py +11 -3
  59. nautobot/dcim/management/commands/migrate_location_contacts.py +218 -0
  60. nautobot/dcim/migrations/0057_controller_models.py +11 -70
  61. nautobot/dcim/models/__init__.py +2 -2
  62. nautobot/dcim/models/devices.py +14 -16
  63. nautobot/dcim/models/racks.py +1 -3
  64. nautobot/dcim/navigation.py +23 -31
  65. nautobot/dcim/signals.py +6 -6
  66. nautobot/dcim/tables/__init__.py +2 -2
  67. nautobot/dcim/tables/devices.py +13 -16
  68. nautobot/dcim/tables/template_code.py +1 -1
  69. nautobot/dcim/templates/dcim/controller_create.html +70 -0
  70. nautobot/dcim/templates/dcim/controller_retrieve.html +35 -18
  71. nautobot/dcim/templates/dcim/controllermanageddevicegroup_create.html +88 -0
  72. nautobot/dcim/templates/dcim/device/lldp_neighbors.html +74 -42
  73. nautobot/dcim/templates/dcim/device.html +11 -3
  74. nautobot/dcim/templates/dcim/device_edit.html +1 -1
  75. nautobot/dcim/templates/dcim/devicefamily_retrieve.html +4 -0
  76. nautobot/dcim/templates/dcim/softwareimagefile_retrieve.html +1 -1
  77. nautobot/dcim/tests/test_api.py +47 -6
  78. nautobot/dcim/tests/test_filters.py +92 -81
  79. nautobot/dcim/tests/test_forms.py +49 -2
  80. nautobot/dcim/tests/test_graphql.py +11 -1
  81. nautobot/dcim/tests/test_models.py +15 -15
  82. nautobot/dcim/tests/test_signals.py +3 -1
  83. nautobot/dcim/tests/test_views.py +24 -12
  84. nautobot/dcim/urls.py +1 -1
  85. nautobot/dcim/views.py +25 -15
  86. nautobot/extras/api/serializers.py +20 -1
  87. nautobot/extras/api/urls.py +1 -2
  88. nautobot/extras/api/views.py +0 -10
  89. nautobot/extras/apps.py +7 -0
  90. nautobot/extras/context_managers.py +71 -4
  91. nautobot/extras/filters/__init__.py +53 -2
  92. nautobot/extras/filters/customfields.py +14 -9
  93. nautobot/extras/filters/mixins.py +6 -1
  94. nautobot/extras/forms/contacts.py +7 -0
  95. nautobot/extras/health_checks.py +1 -0
  96. nautobot/extras/jobs.py +1 -0
  97. nautobot/extras/managers.py +15 -2
  98. nautobot/extras/models/contacts.py +1 -0
  99. nautobot/extras/models/customfields.py +25 -2
  100. nautobot/extras/models/datasources.py +1 -0
  101. nautobot/extras/models/mixins.py +1 -0
  102. nautobot/extras/navigation.py +71 -65
  103. nautobot/extras/plugins/__init__.py +2 -1
  104. nautobot/extras/plugins/views.py +7 -11
  105. nautobot/extras/querysets.py +1 -2
  106. nautobot/extras/secrets/providers.py +1 -0
  107. nautobot/extras/signals.py +95 -51
  108. nautobot/extras/tasks.py +70 -17
  109. nautobot/extras/tests/test_api.py +2 -4
  110. nautobot/extras/tests/test_context_managers.py +98 -1
  111. nautobot/extras/tests/test_customfields.py +72 -9
  112. nautobot/extras/tests/test_dynamicgroups.py +2 -0
  113. nautobot/extras/tests/test_filters.py +89 -4
  114. nautobot/extras/tests/test_models.py +9 -0
  115. nautobot/extras/tests/test_relationships.py +10 -1
  116. nautobot/extras/tests/test_views.py +112 -1
  117. nautobot/extras/utils.py +37 -0
  118. nautobot/extras/views.py +18 -17
  119. nautobot/ipam/api/serializers.py +10 -0
  120. nautobot/ipam/api/urls.py +1 -2
  121. nautobot/ipam/api/views.py +0 -11
  122. nautobot/ipam/apps.py +3 -2
  123. nautobot/ipam/tables.py +3 -23
  124. nautobot/ipam/tests/test_graphql.py +2 -3
  125. nautobot/ipam/tests/test_tables.py +42 -0
  126. nautobot/ipam/tests/test_views.py +1 -0
  127. nautobot/ipam/views.py +9 -9
  128. nautobot/project-static/css/base.css +1 -0
  129. nautobot/project-static/docs/404.html +126 -73
  130. nautobot/project-static/docs/apps/index.html +127 -71
  131. nautobot/project-static/docs/apps/nautobot-apps.html +127 -71
  132. nautobot/project-static/docs/assets/javascripts/{bundle.8fd75fb4.min.js → bundle.bd41221c.min.js} +2 -2
  133. nautobot/project-static/docs/assets/javascripts/{bundle.8fd75fb4.min.js.map → bundle.bd41221c.min.js.map} +3 -3
  134. nautobot/project-static/docs/assets/stylesheets/main.bcfcd587.min.css +1 -0
  135. nautobot/project-static/docs/assets/stylesheets/main.bcfcd587.min.css.map +1 -0
  136. nautobot/project-static/docs/code-reference/nautobot/apps/__init__.html +127 -71
  137. nautobot/project-static/docs/code-reference/nautobot/apps/admin.html +127 -71
  138. nautobot/project-static/docs/code-reference/nautobot/apps/api.html +167 -73
  139. nautobot/project-static/docs/code-reference/nautobot/apps/change_logging.html +165 -72
  140. nautobot/project-static/docs/code-reference/nautobot/apps/choices.html +127 -71
  141. nautobot/project-static/docs/code-reference/nautobot/apps/config.html +127 -71
  142. nautobot/project-static/docs/code-reference/nautobot/apps/constants.html +127 -71
  143. nautobot/project-static/docs/code-reference/nautobot/apps/datasources.html +127 -71
  144. nautobot/project-static/docs/code-reference/nautobot/apps/exceptions.html +127 -71
  145. nautobot/project-static/docs/code-reference/nautobot/apps/factory.html +127 -71
  146. nautobot/project-static/docs/code-reference/nautobot/apps/filters.html +127 -71
  147. nautobot/project-static/docs/code-reference/nautobot/apps/forms.html +127 -71
  148. nautobot/project-static/docs/code-reference/nautobot/apps/graphql.html +127 -71
  149. nautobot/project-static/docs/code-reference/nautobot/apps/jobs.html +127 -71
  150. nautobot/project-static/docs/code-reference/nautobot/apps/models.html +127 -71
  151. nautobot/project-static/docs/code-reference/nautobot/apps/querysets.html +127 -71
  152. nautobot/project-static/docs/code-reference/nautobot/apps/secrets.html +127 -71
  153. nautobot/project-static/docs/code-reference/nautobot/apps/tables.html +127 -71
  154. nautobot/project-static/docs/code-reference/nautobot/apps/testing.html +128 -72
  155. nautobot/project-static/docs/code-reference/nautobot/apps/ui.html +127 -71
  156. nautobot/project-static/docs/code-reference/nautobot/apps/urls.html +127 -71
  157. nautobot/project-static/docs/code-reference/nautobot/apps/utils.html +345 -71
  158. nautobot/project-static/docs/code-reference/nautobot/apps/views.html +172 -73
  159. nautobot/project-static/docs/development/apps/api/configuration-view.html +127 -71
  160. nautobot/project-static/docs/development/apps/api/database-backend-config.html +127 -71
  161. nautobot/project-static/docs/development/apps/api/models/django-admin.html +127 -71
  162. nautobot/project-static/docs/development/apps/api/models/global-search.html +127 -71
  163. nautobot/project-static/docs/development/apps/api/models/graphql.html +127 -71
  164. nautobot/project-static/docs/development/apps/api/models/index.html +127 -71
  165. nautobot/project-static/docs/development/apps/api/nautobot-app-config.html +127 -71
  166. nautobot/project-static/docs/development/apps/api/platform-features/custom-validators.html +127 -71
  167. nautobot/project-static/docs/development/apps/api/platform-features/filter-extensions.html +127 -71
  168. nautobot/project-static/docs/development/apps/api/platform-features/git-repository-content.html +127 -71
  169. nautobot/project-static/docs/development/apps/api/platform-features/index.html +127 -71
  170. nautobot/project-static/docs/development/apps/api/platform-features/jinja2-filters.html +127 -71
  171. nautobot/project-static/docs/development/apps/api/platform-features/jobs.html +127 -71
  172. nautobot/project-static/docs/development/apps/api/platform-features/populating-extensibility-features.html +127 -71
  173. nautobot/project-static/docs/development/apps/api/platform-features/secrets-providers.html +127 -71
  174. nautobot/project-static/docs/development/apps/api/platform-features/uniquely-identify-objects.html +127 -71
  175. nautobot/project-static/docs/development/apps/api/prometheus.html +127 -71
  176. nautobot/project-static/docs/development/apps/api/setup.html +127 -71
  177. nautobot/project-static/docs/development/apps/api/testing.html +127 -71
  178. nautobot/project-static/docs/development/apps/api/ui-extensions/banners.html +127 -71
  179. nautobot/project-static/docs/development/apps/api/ui-extensions/home-page.html +127 -71
  180. nautobot/project-static/docs/development/apps/api/ui-extensions/index.html +127 -71
  181. nautobot/project-static/docs/development/apps/api/ui-extensions/navigation.html +127 -71
  182. nautobot/project-static/docs/development/apps/api/ui-extensions/object-views.html +127 -71
  183. nautobot/project-static/docs/development/apps/api/views/base-template.html +127 -71
  184. nautobot/project-static/docs/development/apps/api/views/core-view-overrides.html +141 -80
  185. nautobot/project-static/docs/development/apps/api/views/django-generic-views.html +144 -83
  186. nautobot/project-static/docs/development/apps/api/views/help-documentation.html +127 -71
  187. nautobot/project-static/docs/development/apps/api/views/index.html +127 -71
  188. nautobot/project-static/docs/development/apps/api/views/nautobot-generic-views.html +127 -71
  189. nautobot/project-static/docs/development/apps/api/views/nautobotuiviewset.html +127 -71
  190. nautobot/project-static/docs/development/apps/api/views/nautobotuiviewsetrouter.html +127 -71
  191. nautobot/project-static/docs/development/apps/api/views/notes.html +127 -71
  192. nautobot/project-static/docs/development/apps/api/views/rest-api.html +127 -71
  193. nautobot/project-static/docs/development/apps/api/views/urls.html +127 -71
  194. nautobot/project-static/docs/development/apps/index.html +127 -71
  195. nautobot/project-static/docs/development/apps/migration/code-updates.html +127 -71
  196. nautobot/project-static/docs/development/apps/migration/dependency-updates.html +127 -71
  197. nautobot/project-static/docs/development/apps/migration/from-v1.html +127 -71
  198. nautobot/project-static/docs/development/apps/migration/model-updates/dcim.html +127 -71
  199. nautobot/project-static/docs/development/apps/migration/model-updates/extras.html +127 -71
  200. nautobot/project-static/docs/development/apps/migration/model-updates/global.html +127 -71
  201. nautobot/project-static/docs/development/apps/migration/model-updates/ipam.html +127 -71
  202. nautobot/project-static/docs/development/apps/porting-from-netbox.html +127 -71
  203. nautobot/project-static/docs/development/core/application-registry.html +127 -71
  204. nautobot/project-static/docs/development/core/best-practices.html +145 -79
  205. nautobot/project-static/docs/development/core/bootstrap-ui.html +127 -71
  206. nautobot/project-static/docs/development/core/caching.html +127 -71
  207. nautobot/project-static/docs/development/core/controllers.html +141 -275
  208. nautobot/project-static/docs/development/core/docker-compose-advanced-use-cases.html +127 -71
  209. nautobot/project-static/docs/development/core/extending-models.html +13 -8166
  210. nautobot/project-static/docs/development/core/generic-views.html +142 -86
  211. nautobot/project-static/docs/development/core/getting-started.html +146 -81
  212. nautobot/project-static/docs/development/core/homepage.html +145 -89
  213. nautobot/project-static/docs/development/core/index.html +127 -71
  214. nautobot/project-static/docs/development/core/model-checklist.html +8354 -0
  215. nautobot/project-static/docs/development/core/model-features.html +130 -74
  216. nautobot/project-static/docs/development/core/natural-keys.html +127 -71
  217. nautobot/project-static/docs/development/core/navigation-menu.html +127 -71
  218. nautobot/project-static/docs/development/core/release-checklist.html +127 -71
  219. nautobot/project-static/docs/development/core/role-internals.html +127 -71
  220. nautobot/project-static/docs/development/core/settings.html +127 -71
  221. nautobot/project-static/docs/development/core/style-guide.html +127 -71
  222. nautobot/project-static/docs/development/core/templates.html +127 -71
  223. nautobot/project-static/docs/development/core/testing.html +127 -71
  224. nautobot/project-static/docs/development/core/user-preferences.html +127 -71
  225. nautobot/project-static/docs/development/extending-models.html +3 -3
  226. nautobot/project-static/docs/development/index.html +127 -71
  227. nautobot/project-static/docs/development/jobs/index.html +128 -72
  228. nautobot/project-static/docs/development/jobs/migration/from-v1.html +127 -71
  229. nautobot/project-static/docs/index.html +126 -73
  230. nautobot/project-static/docs/models/dcim/{controllerdevicegroup.html → controllermanageddevicegroup.html} +3 -3
  231. nautobot/project-static/docs/objects.inv +0 -0
  232. nautobot/project-static/docs/release-notes/index.html +127 -71
  233. nautobot/project-static/docs/release-notes/version-1.0.html +127 -71
  234. nautobot/project-static/docs/release-notes/version-1.1.html +127 -71
  235. nautobot/project-static/docs/release-notes/version-1.2.html +127 -71
  236. nautobot/project-static/docs/release-notes/version-1.3.html +127 -71
  237. nautobot/project-static/docs/release-notes/version-1.4.html +127 -71
  238. nautobot/project-static/docs/release-notes/version-1.5.html +127 -71
  239. nautobot/project-static/docs/release-notes/version-1.6.html +663 -304
  240. nautobot/project-static/docs/release-notes/version-2.0.html +127 -71
  241. nautobot/project-static/docs/release-notes/version-2.1.html +538 -254
  242. nautobot/project-static/docs/release-notes/version-2.2.html +711 -125
  243. nautobot/project-static/docs/requirements.txt +3 -3
  244. nautobot/project-static/docs/search/search_index.json +1 -1
  245. nautobot/project-static/docs/sitemap.xml +264 -259
  246. nautobot/project-static/docs/sitemap.xml.gz +0 -0
  247. nautobot/project-static/docs/user-guide/administration/configuration/authentication/ldap.html +127 -71
  248. nautobot/project-static/docs/user-guide/administration/configuration/authentication/remote.html +127 -71
  249. nautobot/project-static/docs/user-guide/administration/configuration/authentication/sso.html +127 -71
  250. nautobot/project-static/docs/user-guide/administration/configuration/index.html +127 -71
  251. nautobot/project-static/docs/user-guide/administration/configuration/optional-settings.html +192 -71
  252. nautobot/project-static/docs/user-guide/administration/configuration/required-settings.html +127 -71
  253. nautobot/project-static/docs/user-guide/administration/configuration/time-zones.html +127 -71
  254. nautobot/project-static/docs/user-guide/administration/guides/caching.html +127 -71
  255. nautobot/project-static/docs/user-guide/administration/guides/celery-queues.html +127 -71
  256. nautobot/project-static/docs/user-guide/administration/guides/healthcheck.html +127 -71
  257. nautobot/project-static/docs/user-guide/administration/guides/permissions.html +127 -71
  258. nautobot/project-static/docs/user-guide/administration/guides/prometheus-metrics.html +131 -71
  259. nautobot/project-static/docs/user-guide/administration/guides/replicating-nautobot.html +127 -71
  260. nautobot/project-static/docs/user-guide/administration/guides/request-profiling.html +127 -71
  261. nautobot/project-static/docs/user-guide/administration/guides/s3-django-storage.html +130 -74
  262. nautobot/project-static/docs/user-guide/administration/installation/app-install.html +127 -71
  263. nautobot/project-static/docs/user-guide/administration/installation/docker.html +134 -74
  264. nautobot/project-static/docs/user-guide/administration/installation/external-authentication.html +127 -71
  265. nautobot/project-static/docs/user-guide/administration/installation/health-checks.html +8616 -0
  266. nautobot/project-static/docs/user-guide/administration/installation/http-server.html +127 -71
  267. nautobot/project-static/docs/user-guide/administration/installation/index.html +127 -71
  268. nautobot/project-static/docs/user-guide/administration/installation/install_system.html +127 -71
  269. nautobot/project-static/docs/user-guide/administration/installation/nautobot.html +127 -71
  270. nautobot/project-static/docs/user-guide/administration/installation/selinux-troubleshooting.html +130 -74
  271. nautobot/project-static/docs/user-guide/administration/installation/services.html +127 -71
  272. nautobot/project-static/docs/user-guide/administration/migration/migrating-from-netbox.html +127 -71
  273. nautobot/project-static/docs/user-guide/administration/migration/migrating-from-postgresql.html +127 -71
  274. nautobot/project-static/docs/user-guide/administration/tools/nautobot-server.html +127 -71
  275. nautobot/project-static/docs/user-guide/administration/tools/nautobot-shell.html +127 -71
  276. nautobot/project-static/docs/user-guide/administration/upgrading/database-backup.html +127 -71
  277. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/after-you-upgrade.html +127 -71
  278. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/before-you-upgrade.html +127 -71
  279. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/for-developers.html +127 -71
  280. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/index.html +127 -71
  281. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/whats-changed.html +127 -71
  282. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/region-and-site-data-migration-guide.html +127 -71
  283. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/upgrading-from-nautobot-v1.html +127 -71
  284. nautobot/project-static/docs/user-guide/administration/upgrading/upgrading.html +127 -71
  285. nautobot/project-static/docs/user-guide/core-data-model/circuits/circuit.html +127 -71
  286. nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittermination.html +127 -71
  287. nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittype.html +127 -71
  288. nautobot/project-static/docs/user-guide/core-data-model/circuits/provider.html +127 -71
  289. nautobot/project-static/docs/user-guide/core-data-model/circuits/providernetwork.html +127 -71
  290. nautobot/project-static/docs/user-guide/core-data-model/dcim/cable.html +127 -71
  291. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleport.html +127 -71
  292. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleporttemplate.html +127 -71
  293. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverport.html +127 -71
  294. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverporttemplate.html +127 -71
  295. nautobot/project-static/docs/user-guide/core-data-model/dcim/controller.html +362 -79
  296. nautobot/project-static/docs/user-guide/core-data-model/dcim/{controllerdevicegroup.html → controllermanageddevicegroup.html} +210 -85
  297. nautobot/project-static/docs/user-guide/core-data-model/dcim/device.html +127 -71
  298. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebay.html +127 -71
  299. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebaytemplate.html +127 -71
  300. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicefamily.html +127 -71
  301. nautobot/project-static/docs/user-guide/core-data-model/dcim/deviceredundancygroup.html +127 -71
  302. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicetype.html +127 -71
  303. nautobot/project-static/docs/user-guide/core-data-model/dcim/frontport.html +127 -71
  304. nautobot/project-static/docs/user-guide/core-data-model/dcim/frontporttemplate.html +127 -71
  305. nautobot/project-static/docs/user-guide/core-data-model/dcim/interface.html +127 -71
  306. nautobot/project-static/docs/user-guide/core-data-model/dcim/interfaceredundancygroup.html +127 -71
  307. nautobot/project-static/docs/user-guide/core-data-model/dcim/interfacetemplate.html +127 -71
  308. nautobot/project-static/docs/user-guide/core-data-model/dcim/inventoryitem.html +127 -71
  309. nautobot/project-static/docs/user-guide/core-data-model/dcim/location.html +127 -71
  310. nautobot/project-static/docs/user-guide/core-data-model/dcim/locationtype.html +127 -71
  311. nautobot/project-static/docs/user-guide/core-data-model/dcim/manufacturer.html +127 -71
  312. nautobot/project-static/docs/user-guide/core-data-model/dcim/platform.html +127 -71
  313. nautobot/project-static/docs/user-guide/core-data-model/dcim/powerfeed.html +127 -71
  314. nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlet.html +127 -71
  315. nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlettemplate.html +127 -71
  316. nautobot/project-static/docs/user-guide/core-data-model/dcim/powerpanel.html +127 -71
  317. nautobot/project-static/docs/user-guide/core-data-model/dcim/powerport.html +127 -71
  318. nautobot/project-static/docs/user-guide/core-data-model/dcim/powerporttemplate.html +127 -71
  319. nautobot/project-static/docs/user-guide/core-data-model/dcim/rack.html +127 -71
  320. nautobot/project-static/docs/user-guide/core-data-model/dcim/rackgroup.html +127 -71
  321. nautobot/project-static/docs/user-guide/core-data-model/dcim/rackreservation.html +127 -71
  322. nautobot/project-static/docs/user-guide/core-data-model/dcim/rearport.html +127 -71
  323. nautobot/project-static/docs/user-guide/core-data-model/dcim/rearporttemplate.html +127 -71
  324. nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareimagefile.html +127 -71
  325. nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareversion.html +127 -71
  326. nautobot/project-static/docs/user-guide/core-data-model/dcim/virtualchassis.html +127 -71
  327. nautobot/project-static/docs/user-guide/core-data-model/extras/configcontext.html +130 -74
  328. nautobot/project-static/docs/user-guide/core-data-model/extras/configcontextschema.html +127 -71
  329. nautobot/project-static/docs/user-guide/core-data-model/extras/contact.html +138 -71
  330. nautobot/project-static/docs/user-guide/core-data-model/extras/team.html +138 -71
  331. nautobot/project-static/docs/user-guide/core-data-model/ipam/ipaddress.html +127 -71
  332. nautobot/project-static/docs/user-guide/core-data-model/ipam/namespace.html +127 -71
  333. nautobot/project-static/docs/user-guide/core-data-model/ipam/prefix.html +127 -71
  334. nautobot/project-static/docs/user-guide/core-data-model/ipam/rir.html +127 -71
  335. nautobot/project-static/docs/user-guide/core-data-model/ipam/routetarget.html +127 -71
  336. nautobot/project-static/docs/user-guide/core-data-model/ipam/service.html +127 -71
  337. nautobot/project-static/docs/user-guide/core-data-model/ipam/vlan.html +127 -71
  338. nautobot/project-static/docs/user-guide/core-data-model/ipam/vlangroup.html +127 -71
  339. nautobot/project-static/docs/user-guide/core-data-model/ipam/vrf.html +127 -71
  340. nautobot/project-static/docs/user-guide/core-data-model/overview/introduction.html +127 -71
  341. nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenant.html +127 -71
  342. nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenantgroup.html +127 -71
  343. nautobot/project-static/docs/user-guide/core-data-model/virtualization/cluster.html +127 -71
  344. nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustergroup.html +127 -71
  345. nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustertype.html +127 -71
  346. nautobot/project-static/docs/user-guide/core-data-model/virtualization/virtualmachine.html +127 -71
  347. nautobot/project-static/docs/user-guide/core-data-model/virtualization/vminterface.html +127 -71
  348. nautobot/project-static/docs/user-guide/feature-guides/{contact-and-team.html → contacts-and-teams.html} +128 -72
  349. nautobot/project-static/docs/user-guide/feature-guides/custom-fields.html +129 -73
  350. nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-devices.html +127 -71
  351. nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-location-types-and-locations.html +127 -71
  352. nautobot/project-static/docs/user-guide/feature-guides/getting-started/index.html +127 -71
  353. nautobot/project-static/docs/user-guide/feature-guides/getting-started/interfaces.html +127 -71
  354. nautobot/project-static/docs/user-guide/feature-guides/getting-started/ipam.html +127 -71
  355. nautobot/project-static/docs/user-guide/feature-guides/getting-started/platforms.html +127 -71
  356. nautobot/project-static/docs/user-guide/feature-guides/getting-started/search-bar.html +129 -73
  357. nautobot/project-static/docs/user-guide/feature-guides/getting-started/tenants.html +127 -71
  358. nautobot/project-static/docs/user-guide/feature-guides/getting-started/vlans-and-vlan-groups.html +127 -71
  359. nautobot/project-static/docs/user-guide/feature-guides/git-data-source.html +127 -71
  360. nautobot/project-static/docs/user-guide/feature-guides/graphql.html +127 -71
  361. nautobot/project-static/docs/user-guide/feature-guides/ip-address-merge-tool.html +127 -71
  362. nautobot/project-static/docs/user-guide/feature-guides/relationships.html +127 -71
  363. nautobot/project-static/docs/user-guide/feature-guides/software-image-files-and-versions.html +127 -71
  364. nautobot/project-static/docs/user-guide/index.html +127 -71
  365. nautobot/project-static/docs/user-guide/platform-functionality/change-logging.html +127 -71
  366. nautobot/project-static/docs/user-guide/platform-functionality/computedfield.html +127 -71
  367. nautobot/project-static/docs/user-guide/platform-functionality/customfield.html +127 -71
  368. nautobot/project-static/docs/user-guide/platform-functionality/customlink.html +127 -71
  369. nautobot/project-static/docs/user-guide/platform-functionality/dynamicgroup.html +127 -71
  370. nautobot/project-static/docs/user-guide/platform-functionality/exporttemplate.html +127 -71
  371. nautobot/project-static/docs/user-guide/platform-functionality/externalintegration.html +127 -71
  372. nautobot/project-static/docs/user-guide/platform-functionality/gitrepository.html +127 -71
  373. nautobot/project-static/docs/user-guide/platform-functionality/graphql.html +127 -71
  374. nautobot/project-static/docs/user-guide/platform-functionality/graphqlquery.html +127 -71
  375. nautobot/project-static/docs/user-guide/platform-functionality/imageattachment.html +127 -71
  376. nautobot/project-static/docs/user-guide/platform-functionality/jobs/index.html +127 -71
  377. nautobot/project-static/docs/user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html +127 -71
  378. nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobbutton.html +127 -71
  379. nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobhook.html +127 -71
  380. nautobot/project-static/docs/user-guide/platform-functionality/jobs/models.html +127 -71
  381. nautobot/project-static/docs/user-guide/platform-functionality/napalm.html +127 -71
  382. nautobot/project-static/docs/user-guide/platform-functionality/note.html +127 -71
  383. nautobot/project-static/docs/user-guide/platform-functionality/relationship.html +127 -71
  384. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/authentication.html +127 -71
  385. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/filtering.html +127 -71
  386. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/overview.html +127 -71
  387. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/ui-related-endpoints.html +127 -71
  388. nautobot/project-static/docs/user-guide/platform-functionality/role.html +127 -71
  389. nautobot/project-static/docs/user-guide/platform-functionality/secret.html +127 -71
  390. nautobot/project-static/docs/user-guide/platform-functionality/status.html +127 -71
  391. nautobot/project-static/docs/user-guide/platform-functionality/tag.html +127 -71
  392. nautobot/project-static/docs/user-guide/platform-functionality/template-filters.html +127 -71
  393. nautobot/project-static/docs/user-guide/platform-functionality/users/objectpermission.html +127 -71
  394. nautobot/project-static/docs/user-guide/platform-functionality/users/token.html +127 -71
  395. nautobot/project-static/docs/user-guide/platform-functionality/webhook.html +127 -71
  396. nautobot/project-static/jquery/jquery-3.7.1.min.js +2 -0
  397. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/images/ui-icons_444444_256x240.png +0 -0
  398. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/images/ui-icons_555555_256x240.png +0 -0
  399. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/images/ui-icons_777620_256x240.png +0 -0
  400. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/images/ui-icons_777777_256x240.png +0 -0
  401. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/images/ui-icons_cc0000_256x240.png +0 -0
  402. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/images/ui-icons_ffffff_256x240.png +0 -0
  403. nautobot/project-static/jquery-ui-1.13.2/jquery-ui.min.css +7 -0
  404. nautobot/project-static/jquery-ui-1.13.2/jquery-ui.min.js +6 -0
  405. nautobot/project-static/jquery-ui-1.13.2/jquery-ui.structure.min.css +5 -0
  406. nautobot/project-static/{jquery-ui-1.13.1 → jquery-ui-1.13.2}/jquery-ui.theme.min.css +1 -1
  407. nautobot/tenancy/api/urls.py +1 -2
  408. nautobot/tenancy/api/views.py +0 -12
  409. nautobot/tenancy/tables.py +1 -1
  410. nautobot/tenancy/tests/test_views.py +1 -0
  411. nautobot/users/api/urls.py +1 -2
  412. nautobot/users/api/views.py +2 -65
  413. nautobot/users/views.py +8 -8
  414. nautobot/virtualization/api/urls.py +1 -2
  415. nautobot/virtualization/api/views.py +0 -12
  416. {nautobot-2.2.0b1.dist-info → nautobot-2.2.2.dist-info}/METADATA +24 -24
  417. {nautobot-2.2.0b1.dist-info → nautobot-2.2.2.dist-info}/RECORD +422 -416
  418. nautobot/dcim/templates/dcim/controllerdevicegroup_create.html +0 -43
  419. nautobot/project-static/docs/assets/stylesheets/main.f2e4d321.min.css +0 -1
  420. nautobot/project-static/docs/assets/stylesheets/main.f2e4d321.min.css.map +0 -1
  421. nautobot/project-static/jquery/jquery-3.6.0.min.js +0 -2
  422. nautobot/project-static/jquery-ui-1.13.1/jquery-ui.min.css +0 -7
  423. nautobot/project-static/jquery-ui-1.13.1/jquery-ui.min.js +0 -6
  424. nautobot/project-static/jquery-ui-1.13.1/jquery-ui.structure.min.css +0 -5
  425. /nautobot/dcim/templates/dcim/{controllerdevicegroup_retrieve.html → controllermanageddevicegroup_retrieve.html} +0 -0
  426. {nautobot-2.2.0b1.dist-info → nautobot-2.2.2.dist-info}/LICENSE.txt +0 -0
  427. {nautobot-2.2.0b1.dist-info → nautobot-2.2.2.dist-info}/NOTICE +0 -0
  428. {nautobot-2.2.0b1.dist-info → nautobot-2.2.2.dist-info}/WHEEL +0 -0
  429. {nautobot-2.2.0b1.dist-info → nautobot-2.2.2.dist-info}/entry_points.txt +0 -0
@@ -8,7 +8,7 @@ from .cables import CableTable
8
8
  from .devices import (
9
9
  ConsolePortTable,
10
10
  ConsoleServerPortTable,
11
- ControllerDeviceGroupTable,
11
+ ControllerManagedDeviceGroupTable,
12
12
  ControllerTable,
13
13
  DeviceBayTable,
14
14
  DeviceConsolePortTable,
@@ -66,7 +66,7 @@ __all__ = (
66
66
  "ConsoleServerPortTable",
67
67
  "ConsoleServerPortTemplateTable",
68
68
  "ControllerTable",
69
- "ControllerDeviceGroupTable",
69
+ "ControllerManagedDeviceGroupTable",
70
70
  "DeviceBayTable",
71
71
  "DeviceBayTemplateTable",
72
72
  "DeviceConsolePortTable",
@@ -14,7 +14,7 @@ from nautobot.dcim.models import (
14
14
  ConsolePort,
15
15
  ConsoleServerPort,
16
16
  Controller,
17
- ControllerDeviceGroup,
17
+ ControllerManagedDeviceGroup,
18
18
  Device,
19
19
  DeviceBay,
20
20
  DeviceRedundancyGroup,
@@ -60,7 +60,7 @@ __all__ = (
60
60
  "ConsolePortTable",
61
61
  "ConsoleServerPortTable",
62
62
  "ControllerTable",
63
- "ControllerDeviceGroupTable",
63
+ "ControllerManagedDeviceGroupTable",
64
64
  "DeviceBayTable",
65
65
  "DeviceConsolePortTable",
66
66
  "DeviceConsoleServerPortTable",
@@ -164,7 +164,7 @@ class DeviceTable(StatusTableMixin, RoleTableMixin, BaseTable):
164
164
  device_redundancy_group_priority = tables.TemplateColumn(
165
165
  template_code="""{% if record.device_redundancy_group %}<span class="badge badge-default">{{ record.device_redundancy_group_priority|default:'None' }}</span>{% else %}—{% endif %}"""
166
166
  )
167
- controller_device_group = tables.Column(linkify=True)
167
+ controller_managed_device_group = tables.Column(linkify=True)
168
168
  secrets_group = tables.Column(linkify=True)
169
169
  tags = TagColumn(url_name="dcim:device_list")
170
170
 
@@ -193,7 +193,7 @@ class DeviceTable(StatusTableMixin, RoleTableMixin, BaseTable):
193
193
  "vc_priority",
194
194
  "device_redundancy_group",
195
195
  "device_redundancy_group_priority",
196
- "controller_device_group",
196
+ "controller_managed_device_group",
197
197
  "secrets_group",
198
198
  "tags",
199
199
  )
@@ -919,7 +919,7 @@ class VirtualChassisTable(BaseTable):
919
919
  master = tables.Column(linkify=True)
920
920
  member_count = LinkedCountColumn(
921
921
  viewname="dcim:device_list",
922
- url_params={"virtual_chassis_id": "pk"},
922
+ url_params={"virtual_chassis": "pk"},
923
923
  verbose_name="Members",
924
924
  )
925
925
  tags = TagColumn(url_name="dcim:virtualchassis_list")
@@ -1142,8 +1142,8 @@ class ControllerTable(BaseTable):
1142
1142
  role = tables.Column(linkify=True)
1143
1143
  tenant = TenantColumn()
1144
1144
  external_integration = tables.Column(linkify=True)
1145
- deployed_controller_device = tables.Column(linkify=True)
1146
- deployed_controller_group = tables.Column(linkify=True)
1145
+ controller_device = tables.Column(linkify=True)
1146
+ controller_device_redundancy_group = tables.Column(linkify=True)
1147
1147
  tags = TagColumn(url_name="dcim:controller_list")
1148
1148
  actions = ButtonsColumn(Controller)
1149
1149
 
@@ -1160,8 +1160,8 @@ class ControllerTable(BaseTable):
1160
1160
  "role",
1161
1161
  "tenant",
1162
1162
  "external_integration",
1163
- "deployed_controller_device",
1164
- "deployed_controller_group",
1163
+ "controller_device",
1164
+ "controller_device_redundancy_group",
1165
1165
  "tags",
1166
1166
  "actions",
1167
1167
  )
@@ -1173,28 +1173,25 @@ class ControllerTable(BaseTable):
1173
1173
  "platform",
1174
1174
  "role",
1175
1175
  "tenant",
1176
- "external_integration",
1177
- "deployed_controller_device",
1178
- "deployed_controller_group",
1179
1176
  "actions",
1180
1177
  )
1181
1178
 
1182
1179
 
1183
- class ControllerDeviceGroupTable(BaseTable):
1180
+ class ControllerManagedDeviceGroupTable(BaseTable):
1184
1181
  """Table for list view."""
1185
1182
 
1186
1183
  pk = ToggleColumn()
1187
1184
  name = tables.TemplateColumn(template_code=TREE_LINK, attrs={"td": {"class": "text-nowrap"}})
1188
1185
  weight = tables.Column()
1189
1186
  controller = tables.Column(linkify=True)
1190
- tags = TagColumn(url_name="dcim:controllerdevicegroup_list")
1191
- actions = ButtonsColumn(ControllerDeviceGroup)
1187
+ tags = TagColumn(url_name="dcim:controllermanageddevicegroup_list")
1188
+ actions = ButtonsColumn(ControllerManagedDeviceGroup)
1192
1189
  device_count = tables.TemplateColumn(template_code=LINKED_RECORD_COUNT, verbose_name="Devices")
1193
1190
 
1194
1191
  class Meta(BaseTable.Meta):
1195
1192
  """Meta attributes."""
1196
1193
 
1197
- model = ControllerDeviceGroup
1194
+ model = ControllerManagedDeviceGroup
1198
1195
  fields = (
1199
1196
  "pk",
1200
1197
  "name",
@@ -91,7 +91,7 @@ LINKED_RECORD_COUNT = """
91
91
 
92
92
  TREE_LINK = """
93
93
  {% load helpers %}
94
- {% tree_hierarchy_ui_representation record.tree_depth|as_range table.order_by %}
94
+ {% tree_hierarchy_ui_representation record.tree_depth|as_range table.hide_hierarchy_ui %}
95
95
  <a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
96
96
  """
97
97
 
@@ -0,0 +1,70 @@
1
+ {% extends 'generic/object_create.html' %}
2
+ {% load form_helpers %}
3
+
4
+ {% block form %}
5
+ <div class="panel panel-default">
6
+ <div class="panel-heading"><strong>Controller</strong></div>
7
+ <div class="panel-body">
8
+ {% render_field form.name %}
9
+ {% render_field form.status %}
10
+ {% render_field form.role %}
11
+ {% render_field form.location %}
12
+ {% render_field form.platform %}
13
+ {% render_field form.description %}
14
+ </div>
15
+ </div>
16
+ <div class="panel panel-default">
17
+ <div class="panel-heading"><strong>Integration</strong></div>
18
+ <div class="panel-body">
19
+ {% render_field form.external_integration %}
20
+ {% with controllerdevice_tab_active=form.initial.controller_device %}
21
+ <ul class="nav nav-tabs" role="tablist">
22
+ <li role="presentation"{% if controllerdevice_tab_active %} class="active"{% endif %}><a href="#controllerdevice" role="tab" data-toggle="tab">Controller Device</a></li>
23
+ <li role="presentation"{% if not controllerdevice_tab_active %} class="active"{% endif %}><a href="#controller_device_redundancy_group" role="tab" data-toggle="tab">Controller Device Redundancy Group</a></li>
24
+ </ul>
25
+ <div class="tab-content">
26
+ <div class="tab-pane{% if not controllerdevice_tab_active %} active{% endif %}" id="controller_device_redundancy_group">
27
+ {% render_field form.controller_device_redundancy_group %}
28
+ </div>
29
+ <div class="tab-pane{% if controllerdevice_tab_active %} active{% endif %}" id="controllerdevice">
30
+ {% render_field form.controller_device %}
31
+ </div>
32
+ </div>
33
+ {% endwith %}
34
+ </div>
35
+ </div>
36
+ <div class="panel panel-default">
37
+ <div class="panel-heading"><strong>Tenancy</strong></div>
38
+ <div class="panel-body">
39
+ {% render_field form.tenant_group %}
40
+ {% render_field form.tenant %}
41
+ </div>
42
+ </div>
43
+ {% include 'inc/extras_features_edit_form_fields.html' %}
44
+ {% endblock form %}
45
+
46
+ {% block javascript %}
47
+ <script type="text/javascript">
48
+ const controllerDevice = $('#id_controller_device');
49
+ const controllerDeviceRedundancyGroup = $('#id_controller_device_redundancy_group');
50
+
51
+ const controllerUpdated = function() {
52
+ if (controllerDevice.val()) {
53
+ controllerDeviceRedundancyGroup.val('');
54
+ controllerDeviceRedundancyGroup.trigger('change');
55
+ }
56
+ };
57
+
58
+ const controllerDeviceRedundancyGroupUpdated = function() {
59
+ if (controllerDeviceRedundancyGroup.val()) {
60
+ controllerDevice.val('');
61
+ controllerDevice.trigger('change');
62
+ }
63
+ };
64
+
65
+ controllerDevice.on('select2:select', controllerUpdated);
66
+ controllerDevice.on('select2:unselect', controllerUpdated);
67
+ controllerDeviceRedundancyGroup.on('select2:select', controllerDeviceRedundancyGroupUpdated);
68
+ controllerDeviceRedundancyGroup.on('select2:unselect', controllerDeviceRedundancyGroupUpdated);
69
+ </script>
70
+ {% endblock %}
@@ -22,10 +22,6 @@
22
22
  <td>Role</td>
23
23
  <td>{{ object.role|hyperlinked_object }}</td>
24
24
  </tr>
25
- <tr>
26
- <td>Description</td>
27
- <td>{{ object.description|placeholder }}</td>
28
- </tr>
29
25
  <tr>
30
26
  <td>Location</td>
31
27
  <td>{{ object.location|hyperlinked_object }}</td>
@@ -35,34 +31,55 @@
35
31
  <td>{{ object.platform|hyperlinked_object }}</td>
36
32
  </tr>
37
33
  <tr>
38
- <td>Role</td>
39
- <td>{{ object.role|hyperlinked_object }}</td>
34
+ <td>Tenant</td>
35
+ <td>
36
+ {% if object.tenant and object.tenant.tenant_group %}
37
+ {{ object.tenant.tenant_group|hyperlinked_object }} /
38
+ {% endif %}
39
+ {{ object.tenant|hyperlinked_object }}
40
+ </td>
40
41
  </tr>
41
42
  <tr>
42
- <td>Tenant</td>
43
- <td>{{ object.tenant|hyperlinked_object }}</td>
43
+ <td>Description</td>
44
+ <td>{{ object.description|placeholder }}</td>
44
45
  </tr>
46
+ </table>
47
+ </div>
48
+ </div>
49
+ {% endblock content_left_page %}
50
+
51
+ {% block content_right_page %}
52
+ <div class="panel panel-default">
53
+ <div class="panel-heading">
54
+ <strong>Integration</strong>
55
+ </div>
56
+ <div class="table-responsive">
57
+ <table class="table table-hover panel-body attr-table">
45
58
  <tr>
46
59
  <td>External Integration</td>
47
60
  <td>{{ object.external_integration|hyperlinked_object }}</td>
48
61
  </tr>
49
- <tr>
50
- <td>Deployed Controller Device</td>
51
- <td>{{ object.deployed_controller_device|hyperlinked_object }}</td>
52
- </tr>
53
- <tr>
54
- <td>Deployed Controller Group</td>
55
- <td>{{ object.deployed_controller_group|hyperlinked_object }}</td>
56
- </tr>
62
+ {% if object.controller_device %}
63
+ <tr>
64
+ <td>Controller Device</td>
65
+ <td>{{ object.controller_device|hyperlinked_object }}</td>
66
+ </tr>
67
+ {% endif %}
68
+ {% if object.controller_device_redundancy_group %}
69
+ <tr>
70
+ <td>Controller Device Redundancy Group</td>
71
+ <td>{{ object.controller_device_redundancy_group|hyperlinked_object }}</td>
72
+ </tr>
73
+ {% endif %}
57
74
  </table>
58
75
  </div>
59
76
  </div>
60
- {% endblock content_left_page %}
77
+ {% endblock content_right_page %}
61
78
 
62
79
  {% block content_full_width_page %}
63
80
  <div class="panel panel-default">
64
81
  <div class="panel-heading">
65
- <strong>Devices</strong>
82
+ <strong>Managed Devices</strong>
66
83
  </div>
67
84
  {% include 'responsive_table.html' with table=devices_table %}
68
85
  </div>
@@ -0,0 +1,88 @@
1
+ {% extends 'generic/object_create.html' %}
2
+ {% load form_helpers %}
3
+ {% load helpers %}
4
+ {% load static %}
5
+
6
+ {% block form %}
7
+ <div class="panel panel-default">
8
+ <div class="panel-heading"><strong>Controller</strong></div>
9
+ <div class="panel-body">
10
+ {% render_field form.controller.as_hidden %}
11
+ {% render_field form.controller %}
12
+ {% render_field form.name %}
13
+ {% render_field form.devices %}
14
+ {% render_field form.parent %}
15
+ {% render_field form.weight %}
16
+ </div>
17
+ </div>
18
+ {% include 'inc/extras_features_edit_form_fields.html' %}
19
+ {% endblock form %}
20
+
21
+ {% block javascript %}
22
+ <script type="text/javascript">
23
+ const controllerUrl = '{% url 'dcim-api:controller-list' %}';
24
+ const controllerGroupUrl = '{% url 'dcim-api:controllermanageddevicegroup-list' %}';
25
+
26
+ const parentInput = $('select#id_parent');
27
+ const controllerInput = $('select#id_controller');
28
+ const hiddenControllerInput = $('input#id_controller');
29
+
30
+ const request = (url, calback) => {
31
+ $.ajax({
32
+ url,
33
+ method: "GET",
34
+ success: calback,
35
+ error: (error) => {
36
+ const message = `Error in request. URL: ${url}`;
37
+ console.error(message, error);
38
+ alert(message);
39
+ },
40
+ });
41
+ };
42
+
43
+ const setController = (uid) => {
44
+ console.log('Set controller:', uid);
45
+ if (controllerInput.find(`option[value=${uid}]`).length) {
46
+ controllerInput.val(uid);
47
+ hiddenControllerInput.val(uid);
48
+ } else {
49
+ request(`${controllerUrl}${uid}/`, (data) => {
50
+ console.log('Controller data:', data);
51
+ controllerInput.append(new Option(data.name, uid));
52
+ setController(uid);
53
+ });
54
+ }
55
+ };
56
+
57
+ const updateControllerFromParent = (parentUid) => {
58
+ request(
59
+ `${controllerGroupUrl}${parentUid}/`,
60
+ (data) => data.controller && setController(data.controller.id),
61
+ );
62
+ };
63
+
64
+ const onParentInput = (event) => {
65
+ const parentUid = parentInput.val();
66
+ if (parentUid) {
67
+ controllerInput.prop("disabled", true);
68
+ if (event) {
69
+ updateControllerFromParent(parentUid);
70
+ }
71
+ } else {
72
+ controllerInput.prop("disabled", false);
73
+ }
74
+ };
75
+
76
+ const onControllerInput = () => {
77
+ hiddenControllerInput.val(controllerInput.val());
78
+ };
79
+
80
+ parentInput.on('select2:select', onParentInput);
81
+ parentInput.on('select2:unselect', onParentInput);
82
+
83
+ controllerInput.on('select2:select', onControllerInput);
84
+ controllerInput.on('select2:unselect', onControllerInput);
85
+
86
+ onParentInput();
87
+ </script>
88
+ {% endblock %}
@@ -15,6 +15,7 @@
15
15
  <th>Interface</th>
16
16
  <th>Configured Device</th>
17
17
  <th>Configured Interface</th>
18
+ <th>Configured MAC Address</th>
18
19
  <th>LLDP Device</th>
19
20
  <th>LLDP Interface</th>
20
21
  </tr>
@@ -27,18 +28,21 @@
27
28
  <td class="configured_device" data="{{ iface.connected_endpoint.device }}" data-chassis="{{ iface.connected_endpoint.device.virtual_chassis.name }}">
28
29
  {{ iface.connected_endpoint.device|hyperlinked_object }}
29
30
  </td>
30
- <td class="configured_interface" data="{{ iface.connected_endpoint }}">
31
+ <td class="configured_interface" data-interface-name="{{ iface.connected_endpoint }}">
31
32
  <span title="{{ iface.connected_endpoint.get_type_display }}">{{ iface.connected_endpoint }}</span>
32
33
  </td>
34
+ <td class="configured_mac" data-mac-address="{{ iface.connected_endpoint.mac_address }}">
35
+ <span>{{ iface.connected_endpoint.mac_address }}</span>
36
+ </td>
33
37
  {% elif iface.connected_endpoint.circuit %}
34
38
  {% with circuit=iface.connected_endpoint.circuit %}
35
- <td colspan="2">
39
+ <td colspan="3">
36
40
  <i class="mdi mdi-lightning-bolt" title="Circuit"></i>
37
41
  <a href="{{ circuit.get_absolute_url }}">{{ circuit.provider }} {{ circuit }}</a>
38
42
  </td>
39
43
  {% endwith %}
40
44
  {% else %}
41
- <td colspan="2">None</td>
45
+ <td colspan="3">None</td>
42
46
  {% endif %}
43
47
  <td class="device"></td>
44
48
  <td class="interface"></td>
@@ -52,51 +56,79 @@
52
56
  {% block javascript %}
53
57
  {{ block.super }}
54
58
  <script type="text/javascript">
55
- $(document).ready(function() {
56
- $.ajax({
57
- url: "{% url 'dcim-api:device-napalm' pk=object.pk %}?method=get_lldp_neighbors_detail",
58
- dataType: 'json',
59
- success: function(json) {
60
- $.each(json['get_lldp_neighbors_detail'], function(iface, neighbors) {
61
- var neighbor = neighbors[0];
62
- var row = $('*[data-interface-name="' + iface.split(".")[0].replace(/([\/:])/g, "\\$1") + '"]');
59
+ var ready = (callback) => {
60
+ if (document.readyState != "loading") {
61
+ callback();
62
+ } else {
63
+ document.addEventListener("DOMContentLoaded", callback);
64
+ }
65
+ };
66
+
67
+ function getAttribute(node, querySelector, attribute) {
68
+ if (node === null || node.querySelector(querySelector) === null) {
69
+ return "";
70
+ }
71
+ return node.querySelector(querySelector).getAttribute(attribute) || "";
72
+ }
73
+
74
+ ready(() => {
75
+ fetch("{% url 'dcim-api:device-napalm' pk=object.pk %}?method=get_lldp_neighbors_detail")
76
+ .then((response) => {
77
+ if (!response.ok) {
78
+ throw Error(response.statusText);
79
+ }
80
+ return response.json();
81
+ })
82
+ .then((data) => {
83
+ const interfaces = data["get_lldp_neighbors_detail"];
84
+ for (var iface of Object.keys(interfaces)) {
85
+ const neighbor = interfaces[iface][0];
86
+ const row = document.querySelector('*[data-interface-name="'+ iface.split(".")[0].replace(/([\/:])/g, "\\$1") + '"]');
87
+ // var row = $('*[data-interface-name="' + iface.split(".")[0].replace(/([\/:])/g, "\\$1") + '"]');
63
88
 
64
- // Glean configured hostnames/interfaces from the DOM
65
- var configured_device = row.children('td.configured_device').attr('data');
66
- var configured_chassis = row.children('td.configured_device').attr('data-chassis');
67
- var configured_interface = row.children('td.configured_interface').attr('data');
68
- var configured_interface_short = null;
69
- if (configured_interface) {
70
- // Match long-form IOS names against short ones (e.g. Gi0/1 == GigabitEthernet0/1).
71
- configured_interface_short = configured_interface.replace(/^([A-Z][a-z])[^0-9]*([0-9\/]+)$/, "$1$2");
72
- }
89
+ // Glean configured hostnames/interfaces from the DOM
90
+ const configured_device = getAttribute(row, 'td.configured_device', 'data');
91
+ const configured_chassis = getAttribute(row, 'td.configured_device', 'data-chassis');
92
+ const configured_interface = getAttribute(row, 'td.configured_interface', 'data-interface-name').toLowerCase();
93
+ const configured_mac_address = getAttribute(row, 'td.configured_mac', 'data-mac-address').toLowerCase();
94
+ let configured_interface_short = null;
95
+ if (configured_interface) {
96
+ // Match long-form IOS names against short ones (e.g. Gi0/1 == GigabitEthernet0/1).
97
+ configured_interface_short = configured_interface.replace(/^([A-Z][a-z])[^0-9]*([0-9\/]+)$/, "$1$2");
98
+ }
73
99
 
74
- // Clean up hostnames/interfaces learned via LLDP
75
- var neighbor_host = neighbor['remote_system_name'] || ""; // sanitize hostname if it's null to avoid breaking the split func
76
- var neighbor_port = neighbor['remote_port'] || ""; // sanitize port if it's null to avoid breaking the split func
77
- var lldp_device = neighbor_host.split(".")[0]; // Strip off any trailing domain name
78
- var lldp_interface = neighbor_port.split(".")[0]; // Strip off any trailing subinterface ID
100
+ // Clean up hostnames/interfaces learned via LLDP
101
+ const neighbor_host = neighbor['remote_system_name'] || ""; // sanitize hostname if it's null to avoid breaking the split func
102
+ const neighbor_port = neighbor['remote_port'] || ""; // sanitize port if it's null to avoid breaking the split func
103
+ const lldp_device = neighbor_host.split(".")[0]; // Strip off any trailing domain name
104
+ const lldp_interface = neighbor_port.split(".")[0].toLowerCase(); // Strip off any trailing subinterface ID
79
105
 
80
- // Add LLDP neighbors to table
81
- row.children('td.device').html(lldp_device);
82
- row.children('td.interface').html(lldp_interface);
106
+ // Add LLDP neighbors to table
107
+ row.querySelector('td.device').textContent = lldp_device;
108
+ row.querySelector('td.interface').textContent = lldp_interface;
83
109
 
84
- // Apply colors to rows
85
- if (!configured_device && lldp_device) {
86
- row.addClass('info');
87
- } else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_interface == lldp_interface) {
88
- row.addClass('success');
89
- } else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_interface_short == lldp_interface) {
90
- row.addClass('success');
91
- } else {
92
- row.addClass('danger');
93
- }
94
- });
95
- },
96
- error: function(xhr) {
97
- alert(xhr.responseText);
110
+ // Apply colors to rows
111
+ if (!configured_device && lldp_device) {
112
+ row.classList.add('info');
113
+ } else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_interface == lldp_interface) {
114
+ row.classList.add('success');
115
+ } else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_interface_short == lldp_interface) {
116
+ row.classList.add('success');
117
+ } else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_mac_address == lldp_interface) {
118
+ row.classList.add('success');
119
+ } else {
120
+ row.classList.add('danger');
121
+ }
122
+ }
123
+ })
124
+ .catch((error) => {
125
+ if (error.responseText) {
126
+ alert(error.responseText);
127
+ } else {
128
+ throw error;
98
129
  }
99
130
  });
100
131
  });
132
+
101
133
  </script>
102
134
  {% endblock %}
@@ -206,11 +206,19 @@
206
206
  </td>
207
207
  </tr>
208
208
  <tr>
209
- <td>Controller Device Group</td>
209
+ <td>Controller Managed Device Group</td>
210
210
  <td>
211
- {{ object.controller_device_group|hyperlinked_object }}
211
+ {{ object.controller_managed_device_group|hyperlinked_object }}
212
212
  </td>
213
213
  </tr>
214
+ {% if object.controller_managed_device_group %}
215
+ <tr>
216
+ <td>Managed by Controller</td>
217
+ <td>
218
+ {{ object.controller_managed_device_group.controller|hyperlinked_object }}
219
+ </td>
220
+ </tr>
221
+ {% endif %}
214
222
  {% if object.cluster %}
215
223
  <tr>
216
224
  <td>Cluster</td>
@@ -352,7 +360,7 @@
352
360
  </div>
353
361
  </div>
354
362
  </div>
355
- {% if is_contact_associatable_model %}
363
+ {% if object.is_contact_associable_model %}
356
364
  <div id="contacts" role="tabpanel" class="tab-pane {% if request.GET.tab == 'contacts' %}active{% else %}fade{% endif %}">
357
365
  <div class="row">
358
366
  <div class="col-md-12">
@@ -90,7 +90,7 @@
90
90
  {% render_field form.secrets_group %}
91
91
  {% render_field form.device_redundancy_group %}
92
92
  {% render_field form.device_redundancy_group_priority %}
93
- {% render_field form.controller_device_group %}
93
+ {% render_field form.controller_managed_device_group %}
94
94
  </div>
95
95
  </div>
96
96
  <div class="panel panel-default">
@@ -18,6 +18,10 @@
18
18
  <td>Device Types</td>
19
19
  <td><a href="{% url 'dcim:devicetype_list' %}?device_family={{ object.name }}">{{ object.device_type_count }}</a></td>
20
20
  </tr>
21
+ <tr>
22
+ <td>Total Devices</td>
23
+ <td><a href="{% url 'dcim:device_list' %}?device_family={{ object.name }}">{{ total_devices }}</a></td>
24
+ </tr>
21
25
  </table>
22
26
  </div>
23
27
  {% endblock %}
@@ -169,7 +169,7 @@
169
169
  </div>
170
170
  </div>
171
171
  </div>
172
- {% if is_contact_associatable_model %}
172
+ {% if object.is_contact_associable_model %}
173
173
  <div id="contacts" role="tabpanel" class="tab-pane {% if request.GET.tab == 'contacts' %}active{% else %}fade{% endif %}">
174
174
  <div class="row">
175
175
  <div class="col-md-12">