From f23f127d3ba3fdd40bd09246a3b0da1759b9def2 Mon Sep 17 00:00:00 2001 From: dreng Date: Sun, 14 May 2023 22:25:42 +0200 Subject: [PATCH] Add location topology button --- netbox_topology_views/template_content.py | 7 ++++++- .../templates/netbox_topology_views/location_button.html | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 netbox_topology_views/templates/netbox_topology_views/location_button.html diff --git a/netbox_topology_views/template_content.py b/netbox_topology_views/template_content.py index bfd4316..c2cf00c 100644 --- a/netbox_topology_views/template_content.py +++ b/netbox_topology_views/template_content.py @@ -11,5 +11,10 @@ class SiteButtons(PluginTemplateExtension): def buttons(self): return self.render('netbox_topology_views/site_button.html') +class LocationButtons(PluginTemplateExtension): + model = 'dcim.location' + def buttons(self): + return self.render('netbox_topology_views/location_button.html') -template_extensions = [SiteButtons] + +template_extensions = [SiteButtons, LocationButtons] diff --git a/netbox_topology_views/templates/netbox_topology_views/location_button.html b/netbox_topology_views/templates/netbox_topology_views/location_button.html new file mode 100644 index 0000000..64ba7c4 --- /dev/null +++ b/netbox_topology_views/templates/netbox_topology_views/location_button.html @@ -0,0 +1,4 @@ + + + Topology +