netbox-device-view 0.1.13__py3-none-any.whl → 0.1.14__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.
@@ -28,14 +28,38 @@
28
28
  {% for int in interfaces %}
29
29
  <a
30
30
  href="{{int.get_absolute_url}}trace/"
31
- class="{% if int.enabled and int.connected_endpoints|length > 0 %}bg-success{% elif int.enabled %}bg-secondary{% else %}bg-danger{% endif %}"
32
- title="{{ int.name }}{% if int.connected_endpoints|length > 0 %}<hr>{{ int.connected_endpoints.0.device }} | {{ int.connected_endpoints.0.name }}{% endif %}"
33
- style="grid-area: {{ int.stylename }}"
31
+ class="device-view-port
32
+ {% if cable_colors == "on" and int.cable.color == "" or cable_colors == "on" and int.cable == None %}
33
+ nocolor
34
+ {% elif cable_colors == "on" %}
35
+ {% elif int.enabled and int.connected_endpoints|length > 0 or int.is_port and int.link_peers|length > 0 %}
36
+ bg-success
37
+ {% elif int.enabled %}
38
+ bg-secondary
39
+ {% else %}
40
+ bg-danger
41
+ {% endif %}"
42
+ title="{{ int.name }}
43
+ {% if int.connected_endpoints|length > 0 %}<hr>
44
+ {% for ce in int.connected_endpoints %}
45
+ {{ ce.device }} | {{ ce.name }}
46
+ {% endfor %}
47
+ {% elif int.link_peers|length > 0 %}<hr>
48
+ {% for lp in int.link_peers %}
49
+ {% if lp.device %}
50
+ {{ lp.device }} | {{ lp.name }}
51
+ {% elif lp.circuit %}
52
+ {{ lp }}
53
+ {% endif %}
54
+ {% endfor %}
55
+ {% endif %}
56
+ "
57
+ style="grid-area: {{ int.stylename }}{% if cable_colors == 'on' and int.cable.color != '' %}; background-color: #{{ int.cable.color }}{% endif %}"
34
58
  data-bs-toggle="tooltip"
35
59
  data-bs-html="true"
36
60
  data-bs-custom-class="device-view-tooltip"
37
61
  >
38
- {% if int.enabled and int.connected_endpoints|length > 0 %}
62
+ {% if int.enabled and int.connected_endpoints|length > 0 or int.is_port and int.link_peers|length > 0 %}
39
63
  <span class="text-white"><i class="mdi mdi-check-bold"></i></span>
40
64
  {% elif int.enabled %}
41
65
  <span class="text-white"><i class="mdi mdi-check-bold"></i></span>
@@ -13,12 +13,15 @@ def process_interfaces(interfaces, ports_chassis, dev):
13
13
  regex = r"^(?P<type>([a-zA-Z\-_]*))(\/|(?P<dev>[0-9]+).|\s)?((?P<module>[0-9]+).|\s)?((?P<port>[0-9]+))$"
14
14
  matches = re.search(regex, itf.name.lower())
15
15
  if matches:
16
- itf.stylename = (
17
- (matches["type"] or "")
18
- + (matches["module"] or "")
19
- + "-"
20
- + matches["port"]
21
- )
16
+ if not matches["type"] and not matches["type"]:
17
+ stylename = matches["port"]
18
+ else:
19
+ stylename = (
20
+ (matches["type"] or "")
21
+ + (matches["module"] or "")
22
+ + "-"
23
+ + matches["port"]
24
+ )
22
25
  else:
23
26
  itf.stylename = re.sub(r"[^.a-zA-Z\d]", "-", itf.name.lower())
24
27
  if itf.stylename.isdigit():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netbox-device-view
3
- Version: 0.1.13
3
+ Version: 0.1.14
4
4
  Summary: NetBox Device View plugin
5
5
  Home-page: https://github.com/peterbaumert/netbox-device-view
6
6
  Author: Peter Baumert
@@ -6,7 +6,7 @@ netbox_device_view/navigation.py,sha256=EbmAxA0a8y47jbf8XjRQvz_xAvoTwTHI9ljvC6oa
6
6
  netbox_device_view/tables.py,sha256=ejhKjD5fGo_tLUhTExqBhDL_TbYVe9TPnzF-ZWHqujY,351
7
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=yD91QIXvNlUBA4lV7Q_qqAoTpF69nIRf4YVZu8Iw4ac,3208
9
+ netbox_device_view/utils.py,sha256=scsxke3x9jnrhJMYZGlDhIXnfbaC683kfGc9h6feapI,3362
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
@@ -16,8 +16,8 @@ netbox_device_view/migrations/0001_initial.py,sha256=2maF1lEro3LuqdQqKwrBs1ABpw7
16
16
  netbox_device_view/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
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
- netbox_device_view/templates/netbox_device_view/ports.html,sha256=H-OVDZfpa-s3NB5a3ZJmrNbir001wfYfKJss8bppBgk,1716
20
- netbox_device_view-0.1.13.dist-info/METADATA,sha256=qGL4ONJMnKgNNV0bBFcelLUxzyIhe5ba-Y8JjlaH8Do,3899
21
- netbox_device_view-0.1.13.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
- netbox_device_view-0.1.13.dist-info/top_level.txt,sha256=Cj7X6_XpLT0jnyTyX5DMqttqc8_z3uhRYCmvnXLfWOs,19
23
- netbox_device_view-0.1.13.dist-info/RECORD,,
19
+ netbox_device_view/templates/netbox_device_view/ports.html,sha256=_7RvZJ5FBKPmYnn6Qd1OXL2uBN3wwXTQ1Z_R96q-QU0,2379
20
+ netbox_device_view-0.1.14.dist-info/METADATA,sha256=W0HXOxnRd0od56rUaViaYn7lpjk2Vamf8V6wFxOVbeM,3899
21
+ netbox_device_view-0.1.14.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ netbox_device_view-0.1.14.dist-info/top_level.txt,sha256=Cj7X6_XpLT0jnyTyX5DMqttqc8_z3uhRYCmvnXLfWOs,19
23
+ netbox_device_view-0.1.14.dist-info/RECORD,,