netbox-device-view 0.1.13__tar.gz → 0.1.14__tar.gz

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.
Files changed (29) hide show
  1. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/PKG-INFO +1 -1
  2. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/templates/netbox_device_view/ports.html +28 -4
  3. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/utils.py +9 -6
  4. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view.egg-info/PKG-INFO +1 -1
  5. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/setup.py +1 -1
  6. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/MANIFEST.in +0 -0
  7. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/README.md +0 -0
  8. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/__init__.py +0 -0
  9. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/api/__init__.py +0 -0
  10. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/api/serializers.py +0 -0
  11. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/api/urls.py +0 -0
  12. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/api/views.py +0 -0
  13. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/filtersets.py +0 -0
  14. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/forms.py +0 -0
  15. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/migrations/0001_initial.py +0 -0
  16. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/migrations/__init__.py +0 -0
  17. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/models.py +0 -0
  18. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/navigation.py +0 -0
  19. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/static/netbox_device_view/css/device_view.css +0 -0
  20. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/tables.py +0 -0
  21. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/template_content.py +0 -0
  22. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/templates/netbox_device_view/deviceview.html +0 -0
  23. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/urls.py +0 -0
  24. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view/views.py +0 -0
  25. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view.egg-info/SOURCES.txt +0 -0
  26. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view.egg-info/dependency_links.txt +0 -0
  27. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view.egg-info/not-zip-safe +0 -0
  28. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/netbox_device_view.egg-info/top_level.txt +0 -0
  29. {netbox_device_view-0.1.13 → netbox_device_view-0.1.14}/setup.cfg +0 -0
@@ -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
@@ -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
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="netbox-device-view",
8
- version="0.1.13",
8
+ version="0.1.14",
9
9
  description="NetBox Device View plugin",
10
10
  packages=find_packages(),
11
11
  author="Peter Baumert",