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.
- netbox_device_view/template_content.py +6 -1
- netbox_device_view/utils.py +1 -1
- {netbox_device_view-0.1.10a0.dist-info → netbox_device_view-0.1.11.dist-info}/METADATA +1 -1
- {netbox_device_view-0.1.10a0.dist-info → netbox_device_view-0.1.11.dist-info}/RECORD +6 -6
- {netbox_device_view-0.1.10a0.dist-info → netbox_device_view-0.1.11.dist-info}/WHEEL +1 -1
- {netbox_device_view-0.1.10a0.dist-info → netbox_device_view-0.1.11.dist-info}/top_level.txt +0 -0
|
@@ -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"]
|
|
39
|
+
if not settings.PLUGINS_CONFIG["netbox_device_view"]["show_on_device_tab"]:
|
|
35
40
|
return ""
|
|
36
41
|
return self.page()
|
|
37
42
|
|
netbox_device_view/utils.py
CHANGED
|
@@ -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("-")
|
|
@@ -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=
|
|
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=
|
|
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.
|
|
21
|
-
netbox_device_view-0.1.
|
|
22
|
-
netbox_device_view-0.1.
|
|
23
|
-
netbox_device_view-0.1.
|
|
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,,
|
|
File without changes
|