2021-03-26 20:19:19 -04:00
{% extends 'virtualization/virtualmachine/base.html' %}
2019-12-06 16:13:52 -05:00
{% load buttons %}
2020-01-06 20:18:44 +00:00
{% load static %}
2017-08-04 17:02:52 -04:00
{% load helpers %}
2020-03-15 23:45:18 -04:00
{% load plugins %}
2023-07-29 03:30:25 +07:00
{% load i18n %}
2017-08-04 17:02:52 -04:00
2018-06-14 16:15:14 -04:00
{% block content %}
2021-04-17 18:15:53 -07:00
< div class = "row my-3" >
2021-04-30 15:55:37 -07:00
< div class = "col col-md-6" >
2021-04-17 18:15:53 -07:00
< div class = "card" >
< h5 class = "card-header" >
2023-07-29 03:30:25 +07:00
{% trans "Virtual Machine" %}
2021-04-17 18:15:53 -07:00
< / h5 >
< div class = "card-body" >
< table class = "table table-hover attr-table" >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Name" %}< / th >
2021-04-17 18:15:53 -07:00
< td > {{ object }}< / td >
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Status" %}< / th >
2022-02-11 14:25:13 -05:00
< td > {% badge object.get_status_display bg_color=object.get_status_color %}< / td >
2021-04-17 18:15:53 -07:00
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Role" %}< / th >
2022-03-22 14:51:20 -04:00
< td > {{ object.role|linkify|placeholder }}< / td >
2021-04-17 18:15:53 -07:00
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Platform" %}< / th >
2022-03-22 14:51:20 -04:00
< td > {{ object.platform|linkify|placeholder }}< / td >
2021-04-17 18:15:53 -07:00
< / tr >
2022-11-04 08:28:09 -04:00
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Description" %}< / th >
2022-11-04 08:28:09 -04:00
< td > {{ object.description|placeholder }}< / td >
< / tr >
2021-04-17 18:15:53 -07:00
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Tenant" %}< / th >
2021-04-17 18:15:53 -07:00
< td >
2022-03-22 15:29:05 -04:00
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
2017-08-16 17:00:17 -04:00
{% endif %}
2022-03-22 15:29:05 -04:00
{{ object.tenant|linkify|placeholder }}
2021-04-17 18:15:53 -07:00
< / td >
< / tr >
< tr >
2023-08-15 01:13:28 +05:30
< th scope = "row" > {% trans "Config Template" %}< / th >
< td > {{ object.config_template|linkify|placeholder }}< / td >
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Primary IPv4" %}< / th >
2021-04-17 18:15:53 -07:00
< td >
2021-12-15 08:28:58 -05:00
{% if object.primary_ip4 %}
2023-07-06 23:49:55 +05:30
< a href = "{% url 'ipam:ipaddress' pk=object.primary_ip4.pk %}" id = "primary_ip4" > {{ object.primary_ip4.address.ip }}< / a >
2021-12-15 08:28:58 -05:00
{% if object.primary_ip4.nat_inside %}
2023-07-29 03:30:25 +07:00
({% trans "NAT for" %} < a href = "{{ object.primary_ip4.nat_inside.get_absolute_url }}" > {{ object.primary_ip4.nat_inside.address.ip }}< / a > )
2022-08-22 15:18:25 -05:00
{% elif object.primary_ip4.nat_outside.exists %}
2023-07-29 03:30:25 +07:00
({% trans "NAT" %}: {% for nat in object.primary_ip4.nat_outside.all %}< a href = "{{ nat.get_absolute_url }}" > {{ nat.address.ip }}< / a > {% if not forloop.last %}, {% endif %}{% endfor %})
2017-08-29 15:26:35 -04:00
{% endif %}
2023-07-06 23:49:55 +05:30
{% copy_content "primary_ip4" %}
2021-12-15 08:28:58 -05:00
{% else %}
2022-06-15 22:33:21 +02:00
{{ ''|placeholder }}
2021-12-15 08:28:58 -05:00
{% endif %}
2021-04-17 18:15:53 -07:00
< / td >
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Primary IPv6" %}< / th >
2021-04-17 18:15:53 -07:00
< td >
2021-12-15 08:28:58 -05:00
{% if object.primary_ip6 %}
2023-07-06 23:49:55 +05:30
< a href = "{% url 'ipam:ipaddress' pk=object.primary_ip6.pk %}" id = "primary_ip6" > {{ object.primary_ip6.address.ip }}< / a >
2021-12-15 08:28:58 -05:00
{% if object.primary_ip6.nat_inside %}
2023-07-29 03:30:25 +07:00
({% trans "NAT for" %} < a href = "{{ object.primary_ip6.nat_inside.get_absolute_url }}" > {{ object.primary_ip6.nat_inside.address.ip }}< / a > )
2022-08-22 15:22:53 -05:00
{% elif object.primary_ip6.nat_outside.exists %}
2023-07-29 03:30:25 +07:00
({% trans "NAT" %}: {% for nat in object.primary_ip6.nat_outside.all %}< a href = "{{ nat.get_absolute_url }}" > {{ nat.address.ip }}< / a > {% if not forloop.last %}, {% endif %}{% endfor %})
2017-08-29 15:26:35 -04:00
{% endif %}
2023-07-06 23:49:55 +05:30
{% copy_content "primary_ip6" %}
2021-12-15 08:28:58 -05:00
{% else %}
2022-06-15 22:33:21 +02:00
{{ ''|placeholder }}
2021-12-15 08:28:58 -05:00
{% endif %}
2021-04-17 18:15:53 -07:00
< / td >
< / tr >
< / table >
< / div >
2017-08-16 17:00:17 -04:00
< / div >
2021-10-19 14:21:31 -04:00
{% include 'inc/panels/custom_fields.html' %}
2021-10-21 11:23:31 -04:00
{% include 'inc/panels/tags.html' %}
2021-10-19 14:21:31 -04:00
{% include 'inc/panels/comments.html' %}
2020-11-19 12:24:52 -05:00
{% plugin_left_page object %}
2017-11-03 16:58:56 -04:00
< / div >
2021-04-30 15:55:37 -07:00
< div class = "col col-md-6" >
2021-04-17 18:15:53 -07:00
< div class = "card" >
2023-07-29 03:30:25 +07:00
< h5 class = "card-header" > {% trans "Cluster" %}< / h5 >
2021-04-17 18:15:53 -07:00
< div class = "card-body" >
< table class = "table table-hover attr-table" >
2022-05-26 14:59:49 -04:00
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Site" %}< / th >
2022-05-26 14:59:49 -04:00
< td >
{{ object.site|linkify|placeholder }}
< / td >
< / tr >
2021-04-17 18:15:53 -07:00
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Cluster" %}< / th >
2021-04-17 18:15:53 -07:00
< td >
{% if object.cluster.group %}
2022-03-22 14:51:20 -04:00
{{ object.cluster.group|linkify }} /
2021-04-17 18:15:53 -07:00
{% endif %}
2022-05-26 14:59:49 -04:00
{{ object.cluster|linkify|placeholder }}
2021-04-17 18:15:53 -07:00
< / td >
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Cluster Type" %}< / th >
2021-04-17 18:15:53 -07:00
< td > {{ object.cluster.type }}< / td >
< / tr >
2022-05-25 16:01:10 -04:00
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > {% trans "Device" %}< / th >
2022-05-25 16:01:10 -04:00
< td >
{{ object.device|linkify|placeholder }}
< / td >
< / tr >
2021-04-17 18:15:53 -07:00
< / table >
2017-09-29 11:13:41 -04:00
< / div >
< / div >
2021-04-17 18:15:53 -07:00
< div class = "card" >
2023-07-29 03:30:25 +07:00
< h5 class = "card-header" > {% trans "Resources" %}< / h5 >
2021-04-17 18:15:53 -07:00
< div class = "card-body" >
< table class = "table table-hover attr-table" >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > < i class = "mdi mdi-gauge" > < / i > {% trans "Virtual CPUs" %}< / th >
2021-04-17 18:15:53 -07:00
< td > {{ object.vcpus|placeholder }}< / td >
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > < i class = "mdi mdi-chip" > < / i > {% trans "Memory" %}< / th >
2021-04-17 18:15:53 -07:00
< td >
{% if object.memory %}
2021-08-31 09:41:54 -04:00
{{ object.memory|humanize_megabytes }}
2021-04-17 18:15:53 -07:00
{% else %}
2022-06-15 22:33:21 +02:00
{{ ''|placeholder }}
2021-04-17 18:15:53 -07:00
{% endif %}
< / td >
< / tr >
< tr >
2023-07-29 03:30:25 +07:00
< th scope = "row" > < i class = "mdi mdi-harddisk" > < / i > {% trans "Disk Space" %}< / th >
2021-04-17 18:15:53 -07:00
< td >
{% if object.disk %}
2023-07-29 03:30:25 +07:00
{{ object.disk }} {% trans "GB" context "Abbreviation for gigabyte" %}
2021-04-17 18:15:53 -07:00
{% else %}
2022-06-15 22:33:21 +02:00
{{ ''|placeholder }}
2021-04-17 18:15:53 -07:00
{% endif %}
< / td >
< / tr >
< / table >
2017-08-16 17:00:17 -04:00
< / div >
2017-08-04 17:02:52 -04:00
< / div >
2023-01-25 20:25:06 -05:00
< div class = "card" >
2023-07-29 03:30:25 +07:00
< h5 class = "card-header" > {% trans "Services" %}< / h5 >
2023-01-25 20:25:06 -05:00
< div class = "card-body htmx-container table-responsive"
hx-get="{% url 'ipam:service_list' %}?virtual_machine_id={{ object.pk }}"
hx-trigger="load"
>< / div >
{% if perms.ipam.add_service %}
< div class = "card-footer text-end noprint" >
< a href = "{% url 'ipam:service_add' %}?virtual_machine={{ object.pk }}" class = "btn btn-sm btn-primary" >
2023-07-29 03:30:25 +07:00
< span class = "mdi mdi-plus-thick" aria-hidden = "true" > < / span > {% trans "Add a service" %}
2023-01-25 20:25:06 -05:00
< / a >
< / div >
{% endif %}
< / div >
2020-11-19 12:24:52 -05:00
{% plugin_right_page object %}
2020-03-15 23:45:18 -04:00
< / div >
< / div >
< div class = "row" >
2021-04-30 15:55:37 -07:00
< div class = "col col-md-12" >
2020-11-19 12:24:52 -05:00
{% plugin_full_width_page object %}
2017-08-04 17:02:52 -04:00
< / div >
2017-11-03 16:58:56 -04:00
< / div >
2017-08-04 17:02:52 -04:00
{% endblock %}