2020-11-13 15:00:12 -05:00
{% extends 'dcim/device/base.html' %}
{% load render_table from django_tables2 %}
{% load buttons %}
{% load static %}
{% load helpers %}
{% load plugins %}
2023-07-29 03:30:25 +07:00
{% load i18n %}
2023-11-30 02:50:59 +05:30
{% load mptt %}
2020-11-13 15:00:12 -05:00
{% block content %}
2021-07-21 11:20:35 -04:00
< div class = "row" >
2022-10-03 10:55:05 -07:00
< div class = "col col-12 col-xl-6" >
2021-07-21 11:20:35 -04:00
< div class = "card" >
2023-07-29 03:30:25 +07:00
< h5 class = "card-header" > {% trans "Device" %}< / h5 >
2024-01-17 16:25:42 -05:00
< table class = "table table-hover attr-table" >
< tr >
< th scope = "row" > {% trans "Region" %}< / th >
< td > {% nested_tree object.site.region %}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Site" %}< / th >
< td > {{ object.site|linkify }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Location" %}< / th >
< td > {% nested_tree object.location %}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Rack" %}< / th >
2024-01-23 10:30:23 -05:00
< td class = "d-flex justify-content-between" >
2024-01-17 16:25:42 -05:00
{% if object.rack %}
{{ object.rack|linkify }}
2024-01-23 10:30:23 -05:00
< a href = "{{ object.rack.get_absolute_url }}?device={{ object.pk }}" class = "btn btn-primary btn-sm d-print-none" title = "{% trans " Highlight device in rack " % } " >
< i class = "mdi mdi-view-day-outline" > < / i >
< / a >
2023-06-14 11:18:50 -07:00
{% else %}
2024-01-17 16:25:42 -05:00
{{ ''|placeholder }}
2023-06-14 11:18:50 -07:00
{% endif %}
2024-01-17 16:25:42 -05:00
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Position" %}< / th >
< td >
{% if object.parent_bay %}
{% with object.parent_bay.device as parent %}
{{ parent|linkify }} / {{ object.parent_bay }}
{% if parent.position %}
(U{{ parent.position|floatformat }} / {{ parent.get_face_display }})
{% endif %}
{% endwith %}
{% elif object.rack and object.position %}
< span > U{{ object.position|floatformat }} / {{ object.get_face_display }}< / span >
{% elif object.rack and object.device_type.u_height %}
< span class = "badge text-bg-warning" > {% trans "Not racked" %}< / span >
{% else %}
{{ ''|placeholder }}
{% endif %}
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "GPS Coordinates" %}< / th >
< td class = "position-relative" >
{% if object.latitude and object.longitude %}
{% if config.MAPS_URL %}
< div class = "position-absolute top-50 end-0 translate-middle-y d-print-none" >
< a href = "{{ config.MAPS_URL }}{{ object.latitude }},{{ object.longitude }}" target = "_blank" class = "btn btn-primary" >
< i class = "mdi mdi-map-marker" > < / i > {% trans "Map It" %}
< / a >
< / div >
{% endif %}
< span > {{ object.latitude }}, {{ object.longitude }}< / span >
{% else %}
{{ ''|placeholder }}
{% endif %}
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Tenant" %}< / th >
< td >
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
{% endif %}
{{ object.tenant|linkify|placeholder }}
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Device Type" %}< / th >
< td >
{{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height|floatformat }}U)
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Description" %}< / th >
< td > {{ object.description|placeholder }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Airflow" %}< / th >
< td >
{{ object.get_airflow_display|placeholder }}
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Serial Number" %}< / th >
< td class = "font-monospace" > {{ object.serial|placeholder }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Asset Tag" %}< / th >
< td class = "font-monospace" > {{ object.asset_tag|placeholder }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Config Template" %}< / th >
< td > {{ object.config_template|linkify|placeholder }}< / td >
< / tr >
< / table >
2021-07-21 11:20:35 -04:00
< / div >
{% if vc_members %}
< div class = "card" >
2024-01-30 20:55:28 -05:00
< h5 class = "card-header" >
{% trans "Virtual Chassis" %}
< div class = "card-actions" >
< a href = "{{ object.virtual_chassis.get_absolute_url }}" class = "btn btn-ghost-primary btn-sm" >
< span class = "mdi mdi-arrow-right-bold" aria-hidden = "true" > < / span > {% trans "View Virtual Chassis" %}
< / a >
< / div >
< / h5 >
2024-01-17 16:25:42 -05:00
< table class = "table table-hover attr-table" >
< tr >
< th > {% trans "Device" %}< / th >
< th > {% trans "Position" %}< / th >
< th > {% trans "Master" %}< / th >
< th > {% trans "Priority" %}< / th >
< / tr >
{% for vc_member in vc_members %}
< tr { % if vc_member = = object % } class = "info" { % endif % } >
< td >
{{ vc_member|linkify }}
< / td >
< td >
{% badge vc_member.vc_position show_empty=True %}
< / td >
< td >
{% if object.virtual_chassis.master == vc_member %}< i class = "mdi mdi-check-bold" > < / i > {% endif %}
< / td >
< td >
{{ vc_member.vc_priority|placeholder }}
< / td >
2021-07-21 11:20:35 -04:00
< / tr >
2024-01-17 16:25:42 -05:00
{% endfor %}
< / table >
2021-07-21 11:20:35 -04:00
< / div >
{% endif %}
2021-12-18 14:30:28 -05:00
{% include 'inc/panels/custom_fields.html' %}
{% include 'inc/panels/tags.html' %}
{% include 'inc/panels/comments.html' %}
2022-11-15 11:24:36 -05:00
< div class = "card" >
2024-01-30 20:55:28 -05:00
< h5 class = "card-header" >
{% trans "Virtual Device Contexts" %}
{% if perms.dcim.add_virtualdevicecontext %}
< div class = "card-actions" >
< a href = "{% url 'dcim:virtualdevicecontext_add' %}?device={{ object.pk }}" class = "btn btn-ghost-primary btn-sm" >
< span class = "mdi mdi-plus-thick" aria-hidden = "true" > < / span > {% trans "Create VDC" %}
< / a >
< / div >
{% endif %}
< / h5 >
2024-01-30 15:21:44 -05:00
{% htmx_table 'dcim:virtualdevicecontext_list' device_id=object.pk %}
2022-11-15 11:24:36 -05:00
< / div >
2021-12-18 14:30:28 -05:00
{% plugin_left_page object %}
< / div >
2022-10-03 10:55:05 -07:00
< div class = "col col-12 col-xl-6" >
2021-07-21 11:20:35 -04:00
< div class = "card" >
2023-07-29 03:30:25 +07:00
< h5 class = "card-header" > {% trans "Management" %}< / h5 >
2024-01-17 16:25:42 -05:00
< table class = "table table-hover attr-table" >
< tr >
< th scope = "row" > {% trans "Status" %}< / th >
< td > {% badge object.get_status_display bg_color=object.get_status_color %}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Role" %}< / th >
< td > {{ object.role|linkify }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Platform" %}< / th >
< td > {{ object.platform|linkify|placeholder }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Primary IPv4" %}< / th >
< td >
{% if object.primary_ip4 %}
< a href = "{{ object.primary_ip4.get_absolute_url }}" id = "primary_ip4" > {{ object.primary_ip4.address.ip }}< / a >
{% if object.primary_ip4.nat_inside %}
({% trans "NAT for" %} < a href = "{{ object.primary_ip4.nat_inside.get_absolute_url }}" > {{ object.primary_ip4.nat_inside.address.ip }}< / a > )
{% elif object.primary_ip4.nat_outside.exists %}
({% 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 %})
{% endif %}
{% copy_content "primary_ip4" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Primary IPv6" %}< / th >
< td >
{% if object.primary_ip6 %}
< a href = "{{ object.primary_ip6.get_absolute_url }}" id = "primary_ip6" > {{ object.primary_ip6.address.ip }}< / a >
{% if object.primary_ip6.nat_inside %}
({% trans "NAT for" %} < a href = "{{ object.primary_ip6.nat_inside.get_absolute_url }}" > {{ object.primary_ip6.nat_inside.address.ip }}< / a > )
{% elif object.primary_ip6.nat_outside.exists %}
({% 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 %})
{% endif %}
{% copy_content "primary_ip6" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
< / td >
< / tr >
< tr >
< th scope = "row" > Out-of-band IP< / th >
< td >
{% if object.oob_ip %}
< a href = "{{ object.oob_ip.get_absolute_url }}" id = "oob_ip" > {{ object.oob_ip.address.ip }}< / a >
{% copy_content "oob_ip" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
< / td >
< / tr >
{% if object.cluster %}
2021-07-21 11:20:35 -04:00
< tr >
2024-01-17 16:25:42 -05:00
< th > {% trans "Cluster" %}< / th >
2021-07-21 11:20:35 -04:00
< td >
2024-01-17 16:25:42 -05:00
{% if object.cluster.group %}
{{ object.cluster.group|linkify }} /
2021-07-21 11:20:35 -04:00
{% endif %}
2024-01-17 16:25:42 -05:00
{{ object.cluster|linkify }}
2023-07-25 19:40:40 +01:00
< / td >
< / tr >
2024-01-17 16:25:42 -05:00
{% endif %}
< / table >
2021-07-21 11:20:35 -04:00
< / div >
{% if object.powerports.exists and object.poweroutlets.exists %}
< div class = "card" >
2024-01-17 16:25:42 -05:00
< h5 class = "card-header" > {% trans "Power Utilization" %}< / h5 >
< table class = "table table-hover" >
< thead >
< tr >
< th > {% trans "Input" %}< / th >
< th > {% trans "Outlets" %}< / th >
< th > {% trans "Allocated" %}< / th >
< th > {% trans "Available" %}< / th >
< th > {% trans "Utilization" %}< / th >
< / tr >
< / thead >
{% for powerport in object.powerports.all %}
{% with utilization=powerport.get_power_draw powerfeed=powerport.connected_endpoints.0 %}
< tr >
< td > {{ powerport }}< / td >
< td > {{ utilization.outlet_count }}< / td >
< td > {{ utilization.allocated }}{% trans "VA" %}< / td >
{% if powerfeed.available_power %}
< td > {{ powerfeed.available_power }}{% trans "VA" %}< / td >
< td > {% utilization_graph utilization.allocated|percentage:powerfeed.available_power %}< / td >
{% else %}
< td class = "text-muted" > — < / td >
< td class = "text-muted" > — < / td >
{% endif %}
< / tr >
{% for leg in utilization.legs %}
2021-04-21 13:20:09 -07:00
< tr >
2024-01-17 16:25:42 -05:00
< td style = "padding-left: 20px" >
{% trans "Leg" context "Leg of a power feed" %} {{ leg.name }}
< / td >
< td > {{ leg.outlet_count }}< / td >
< td > {{ leg.allocated }}< / td >
2021-07-21 11:20:35 -04:00
{% if powerfeed.available_power %}
2024-01-17 16:25:42 -05:00
{% with phase_available=powerfeed.available_power|divide:3 %}
< td > {{ phase_available }}{% trans "VA" %}< / td >
< td > {% utilization_graph leg.allocated|percentage:phase_available %}< / td >
{% endwith %}
2021-07-21 11:20:35 -04:00
{% else %}
< td class = "text-muted" > — < / td >
< td class = "text-muted" > — < / td >
{% endif %}
2021-04-21 13:20:09 -07:00
< / tr >
2024-01-17 16:25:42 -05:00
{% endfor %}
{% endwith %}
{% endfor %}
< / table >
2021-04-21 13:20:09 -07:00
< / div >
2021-07-21 11:20:35 -04:00
{% endif %}
2023-01-25 20:25:06 -05:00
< div class = "card" >
2024-01-30 20:55:28 -05:00
< h5 class = "card-header" >
{% trans "Services" %}
{% if perms.ipam.add_service %}
< div class = "card-actions" >
< a href = "{% url 'ipam:service_add' %}?device={{ object.pk }}" class = "btn btn-ghost-primary btn-sm" >
< span class = "mdi mdi-plus-thick" aria-hidden = "true" > < / span > {% trans "Add a service" %}
< / a >
< / div >
{% endif %}
< / h5 >
2024-01-30 15:21:44 -05:00
{% htmx_table 'ipam:service_list' device_id=object.pk %}
2023-01-25 20:25:06 -05:00
< / div >
2021-10-19 14:21:31 -04:00
{% include 'inc/panels/image_attachments.html' %}
2023-05-08 18:26:28 +05:30
< div class = "card" >
2023-07-29 03:30:25 +07:00
< h5 class = "card-header" > {% trans "Dimensions" %}< / h5 >
2024-01-17 16:25:42 -05:00
< table class = "table table-hover attr-table" >
< tr >
< th scope = "row" > {% trans "Height" %}< / th >
< td >
{{ object.device_type.u_height }}U
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Weight" %}< / th >
< td >
{% if object.total_weight %}
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
< / td >
< / tr >
< / table >
2023-05-08 18:26:28 +05:30
< / div >
2022-10-03 10:55:05 -07:00
{% if object.rack and object.position %}
2022-11-15 11:24:36 -05:00
< div class = "row" style = "margin-bottom: 20px" >
2022-10-03 10:55:05 -07:00
< div class = "col col-md-6 col-sm-6 col-xs-12 text-center" >
< div style = "margin-left: 30px" >
2023-07-29 03:30:25 +07:00
< h4 > {% trans "Front" %}< / h4 >
2022-10-03 10:55:05 -07:00
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='front' extra_params=svg_extra %}
< / div >
< / div >
< div class = "col col-md-6 col-sm-6 col-xs-12 text-center" >
< div style = "margin-left: 30px" >
2023-07-29 03:30:25 +07:00
< h4 > {% trans "Rear" %}< / h4 >
2022-10-03 10:55:05 -07:00
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='rear' extra_params=svg_extra %}
< / div >
< / div >
2022-11-15 11:24:36 -05:00
< / div >
2022-10-03 10:55:05 -07:00
{% endif %}
2021-07-21 11:20:35 -04:00
{% plugin_right_page object %}
< / div >
< / div >
< div class = "row" >
< div class = "col col-md-12" >
{% plugin_full_width_page object %}
2020-11-13 15:00:12 -05:00
< / div >
< / div >
{% endblock %}