From c035af54098ef56efe059d13a78bf78ec26f60f2 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sat, 17 Apr 2021 18:15:53 -0700 Subject: [PATCH] migrate virtual machine & vm interface to bootstrap 5 --- .../virtualization/virtualmachine.html | 307 +++++++++--------- .../virtualization/virtualmachine/base.html | 31 +- .../virtualmachine/interfaces.html | 37 ++- netbox/virtualization/tables.py | 2 +- 4 files changed, 192 insertions(+), 185 deletions(-) diff --git a/netbox/templates/virtualization/virtualmachine.html b/netbox/templates/virtualization/virtualmachine.html index 517c48675..b820e91f4 100644 --- a/netbox/templates/virtualization/virtualmachine.html +++ b/netbox/templates/virtualization/virtualmachine.html @@ -6,95 +6,97 @@ {% load plugins %} {% block content %} -
+
-
-
- Virtual Machine +
+
+ Virtual Machine +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name{{ object }}
Status + {{ object.get_status_display }} +
Role + {% if object.role %} + {{ object.role }} + {% else %} + None + {% endif %} +
Platform + {% if object.platform %} + {{ object.platform }} + {% else %} + None + {% endif %} +
Tenant + {% if object.tenant %} + {% if object.tenant.group %} + {{ object.tenant.group }} / + {% endif %} + {{ object.tenant }} + {% else %} + None + {% endif %} +
Primary IPv4 + {% if object.primary_ip4 %} + {{ object.primary_ip4.address.ip }} + {% if object.primary_ip4.nat_inside %} + (NAT for {{ object.primary_ip4.nat_inside.address.ip }}) + {% elif object.primary_ip4.nat_outside %} + (NAT: {{ object.primary_ip4.nat_outside.address.ip }}) + {% endif %} + {% else %} + + {% endif %} +
Primary IPv6 + {% if object.primary_ip6 %} + {{ object.primary_ip6.address.ip }} + {% if object.primary_ip6.nat_inside %} + (NAT for {{ object.primary_ip6.nat_inside.address.ip }}) + {% elif object.primary_ip6.nat_outside %} + (NAT: {{ object.primary_ip6.nat_outside.address.ip }}) + {% endif %} + {% else %} + + {% endif %} +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name{{ object }}
Status - {{ object.get_status_display }} -
Role - {% if object.role %} - {{ object.role }} - {% else %} - None - {% endif %} -
Platform - {% if object.platform %} - {{ object.platform }} - {% else %} - None - {% endif %} -
Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group }} / - {% endif %} - {{ object.tenant }} - {% else %} - None - {% endif %} -
Primary IPv4 - {% if object.primary_ip4 %} - {{ object.primary_ip4.address.ip }} - {% if object.primary_ip4.nat_inside %} - (NAT for {{ object.primary_ip4.nat_inside.address.ip }}) - {% elif object.primary_ip4.nat_outside %} - (NAT: {{ object.primary_ip4.nat_outside.address.ip }}) - {% endif %} - {% else %} - - {% endif %} -
Primary IPv6 - {% if object.primary_ip6 %} - {{ object.primary_ip6.address.ip }} - {% if object.primary_ip6.nat_inside %} - (NAT for {{ object.primary_ip6.nat_inside.address.ip }}) - {% elif object.primary_ip6.nat_outside %} - (NAT: {{ object.primary_ip6.nat_outside.address.ip }}) - {% endif %} - {% else %} - - {% endif %} -
{% include 'inc/custom_fields_panel.html' %} {% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='virtualization:virtualmachine_list' %} -
-
- Comments -
-
+
+
+ Comments +
+
{% if object.comments %} {{ object.comments|render_markdown }} {% else %} @@ -105,91 +107,97 @@ {% plugin_left_page object %}
-
-
- Cluster +
+
+ Cluster +
+
+ + + + + + + + + +
Cluster + {% if object.cluster.group %} + {{ object.cluster.group }} / + {% endif %} + {{ object.cluster }} +
Cluster Type{{ object.cluster.type }}
- - - - - - - - - -
Cluster - {% if object.cluster.group %} - {{ object.cluster.group }} / - {% endif %} - {{ object.cluster }} -
Cluster Type{{ object.cluster.type }}
-
-
- Resources +
+
+ Resources +
+
+ + + + + + + + + + + + + +
Virtual CPUs{{ object.vcpus|placeholder }}
Memory + {% if object.memory %} + {{ object.memory }} MB + {% else %} + + {% endif %} +
Disk Space + {% if object.disk %} + {{ object.disk }} GB + {% else %} + + {% endif %} +
- - - - - - - - - - - - - -
Virtual CPUs{{ object.vcpus|placeholder }}
Memory - {% if object.memory %} - {{ object.memory }} MB - {% else %} - - {% endif %} -
Disk Space - {% if object.disk %} - {{ object.disk }} GB - {% else %} - - {% endif %} -
{% if perms.secrets.view_secret %} -
-
- Secrets +
+
+ Secrets +
+
+ {% include 'secrets/inc/assigned_secrets.html' %}
- {% include 'secrets/inc/assigned_secrets.html' %} {% if perms.secrets.add_secret %} - {% endif %} -
-
- Services -
+
+
+ Services +
+
{% if services %} - +
{% for service in services %} {% include 'ipam/inc/service.html' %} {% endfor %}
{% else %} -
- None -
+ None {% endif %} +
{% if perms.ipam.add_service %} -