netbox-device-view 0.1.10a0__py3-none-any.whl → 0.1.11__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.
@@ -1,11 +1,16 @@
1
1
  from netbox.plugins import PluginTemplateExtension
2
2
  from .utils import prepare
3
3
  from django.conf import settings
4
+ from dcim.models import Device
4
5
 
5
6
 
6
7
  class Ports(PluginTemplateExtension):
7
8
  def page(self):
8
9
  obj = self.context["object"]
10
+
11
+ if not isinstance(obj, Device):
12
+ return ""
13
+
9
14
  request = self.context["request"]
10
15
  url = request.build_absolute_uri(obj.get_absolute_url())
11
16
 
@@ -31,7 +36,7 @@ class DevicePorts(Ports):
31
36
  model = "dcim.device"
32
37
 
33
38
  def full_width_page(self):
34
- if settings.PLUGINS_CONFIG["netbox_device_view"]["show_on_device_tab"] == False:
39
+ if not settings.PLUGINS_CONFIG["netbox_device_view"]["show_on_device_tab"]:
35
40
  return ""
36
41
  return self.page()
37
42
 
@@ -12,7 +12,7 @@ def process_interfaces(interfaces, ports_chassis, dev):
12
12
  continue
13
13
  # Convert to lowercase and replace common separators with hyphens
14
14
  # This replaces the original regex matching and if/else block
15
- stylename = re.sub(r"[/\.\s]+", "-", itf.name.lower())
15
+ stylename = re.sub(r"[/\.\s\+]+", "-", itf.name.lower())
16
16
 
17
17
  # Clean up multiple hyphens and leading/trailing hyphens
18
18
  stylename = re.sub(r"-+", "-", stylename).strip("-")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netbox-device-view
3
- Version: 0.1.10a0
3
+ Version: 0.1.11
4
4
  Summary: NetBox Device View plugin
5
5
  Home-page: https://github.com/peterbaumert/netbox-device-view
6
6
  Author: Peter Baumert
@@ -4,9 +4,9 @@ netbox_device_view/forms.py,sha256=JABwFhv4zU08vSaO2C8rSdnbfuNGpeHGtGnLlY2X2wU,6
4
4
  netbox_device_view/models.py,sha256=MN6eThuBJ1bm-vsQF1zM6He5cgKpMfZeCBqHmAjuHTA,500
5
5
  netbox_device_view/navigation.py,sha256=EbmAxA0a8y47jbf8XjRQvz_xAvoTwTHI9ljvC6oaX9U,646
6
6
  netbox_device_view/tables.py,sha256=ejhKjD5fGo_tLUhTExqBhDL_TbYVe9TPnzF-ZWHqujY,351
7
- netbox_device_view/template_content.py,sha256=4B_aiNS6ARoAv97-I6M1-2fCSIc3UcBW0tuRhy0sDZU,1072
7
+ netbox_device_view/template_content.py,sha256=k9spY-bv_ArmRUYqyhpKtOv-MvU3NtFXVN7eWNdU0dg,1162
8
8
  netbox_device_view/urls.py,sha256=DtdIPVagp1KHwPDSlBsV_rJ16pGNi8l661RkXTq32HU,971
9
- netbox_device_view/utils.py,sha256=NPEgzyZwBMyLWf9Km2iMwJt0eOOIzUiLXRCGMw299Mc,3580
9
+ netbox_device_view/utils.py,sha256=pgqBmH_9AZLjlRXJS9yHazcb2KrPGM-m3fF7Z_IgWjc,3582
10
10
  netbox_device_view/views.py,sha256=hyz6xOt0l3l2Kh0cf-TTG84JfF810ts9_SL3SsRpbGM,2020
11
11
  netbox_device_view/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  netbox_device_view/api/serializers.py,sha256=IQEFuIh7X22MWO4jxv4MctZQxln-DgH2eo-0IbdvBl4,456
@@ -17,7 +17,7 @@ netbox_device_view/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
17
17
  netbox_device_view/static/netbox_device_view/css/device_view.css,sha256=VnvjTMPrEnUkpb_odDe6-VJKhBXZ6RuII4Ce3EnPDCc,833
18
18
  netbox_device_view/templates/netbox_device_view/deviceview.html,sha256=gnHwrEhsIHQ5Mv8KjIgUVa65rmfMy7_hLx-wgjHV6-c,2874
19
19
  netbox_device_view/templates/netbox_device_view/ports.html,sha256=H-OVDZfpa-s3NB5a3ZJmrNbir001wfYfKJss8bppBgk,1716
20
- netbox_device_view-0.1.10a0.dist-info/METADATA,sha256=NCvezhy__GrfdRnDO8l4AurMg_cWPfo7wKVfuw8vnp0,3901
21
- netbox_device_view-0.1.10a0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
22
- netbox_device_view-0.1.10a0.dist-info/top_level.txt,sha256=Cj7X6_XpLT0jnyTyX5DMqttqc8_z3uhRYCmvnXLfWOs,19
23
- netbox_device_view-0.1.10a0.dist-info/RECORD,,
20
+ netbox_device_view-0.1.11.dist-info/METADATA,sha256=b-UIBr-1Jr6QdSU0cz1rzTo_eBPAUGSFp5MaykSdNtU,3899
21
+ netbox_device_view-0.1.11.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ netbox_device_view-0.1.11.dist-info/top_level.txt,sha256=Cj7X6_XpLT0jnyTyX5DMqttqc8_z3uhRYCmvnXLfWOs,19
23
+ netbox_device_view-0.1.11.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5