1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

142 lines
5.9 KiB
HTML
Raw Normal View History

2021-03-02 15:58:33 -05:00
{% extends 'generic/object.html' %}
{% load buttons %}
2019-03-11 22:40:52 -04:00
{% load static %}
{% load helpers %}
{% load plugins %}
2019-03-11 22:40:52 -04:00
2021-03-02 15:58:33 -05:00
{% block breadcrumbs %}
2021-07-20 12:14:01 -04:00
{{ block.super }}
2021-06-16 16:27:37 -04:00
<li class="breadcrumb-item"><a href="{% url 'dcim:powerfeed_list' %}?site_id={{ object.power_panel.site.pk }}">{{ object.power_panel.site }}</a></li>
<li class="breadcrumb-item"><a href="{% url 'dcim:powerfeed_list' %}?power_panel_id={{ object.power_panel.pk }}">{{ object.power_panel }}</a></li>
2021-03-02 15:58:33 -05:00
{% if object.rack %}
2021-06-16 16:27:37 -04:00
<li class="breadcrumb-item"><a href="{% url 'dcim:powerfeed_list' %}?rack_id={{ object.rack.pk }}">{{ object.rack }}</a></li>
2021-03-02 15:58:33 -05:00
{% endif %}
2019-03-11 22:40:52 -04:00
{% endblock %}
{% block content %}
<div class="row">
2021-04-30 15:55:37 -07:00
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Power Feed
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Power Panel</th>
2022-03-22 14:51:20 -04:00
<td>{{ object.power_panel|linkify }}</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Rack</th>
2022-03-22 14:51:20 -04:00
<td>{{ object.rack|linkify|placeholder }}</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Type</th>
<td>{% badge object.get_type_display bg_color=object.get_type_color %}</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Status</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Connected Device</th>
<td>
2022-10-04 14:36:14 -04:00
{% if object.connected_endpoints %}
{{ object.connected_endpoints.0.device|linkify }} ({{ object.connected_endpoints.0|linkify:"name" }})
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Utilization (Allocated)</th>
2022-10-04 14:36:14 -04:00
{% with utilization=object.connected_endpoints.0.get_power_draw %}
{% if utilization %}
<td>
{{ utilization.allocated }}VA / {{ object.available_power }}VA
{% if object.available_power > 0 %}
{% utilization_graph utilization.allocated|percentage:object.available_power %}
{% endif %}
</td>
{% else %}
<td class="text-muted">N/A</td>
{% endif %}
{% endwith %}
</tr>
</table>
2019-03-11 22:40:52 -04:00
</div>
2019-03-22 21:58:45 -04:00
</div>
<div class="card">
<h5 class="card-header">
Electrical Characteristics
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Supply</th>
<td>{{ object.get_supply_display }}</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Voltage</th>
<td>{{ object.voltage }}V</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Amperage</th>
<td>{{ object.amperage }}A</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Phase</th>
<td>{{ object.get_phase_display }}</td>
</tr>
<tr>
2021-04-13 21:51:12 -07:00
<th scope="row">Max Utilization</th>
<td>{{ object.max_utilization }}%</td>
</tr>
</table>
2019-03-22 21:58:45 -04:00
</div>
2019-03-11 22:40:52 -04:00
</div>
2021-10-19 14:21:31 -04:00
{% include 'inc/panels/custom_fields.html' %}
{% include 'inc/panels/tags.html' %}
{% plugin_left_page object %}
2020-10-05 13:23:55 -04:00
</div>
2021-04-30 15:55:37 -07:00
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Connection</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
2020-02-20 14:16:18 -05:00
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:powerfeed_trace' %}
{% else %}
<div class="text-muted">
Not connected
2021-04-13 21:51:12 -07:00
</div>
{% endif %}
</div>
{% if not object.mark_connected and not object.cable %}
<div class="card-footer">
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerfeed&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&termination_b_site={{ object.device.site.pk }}&termination_b_rack={{ object.device.rack.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
</a>
{% endif %}
</div>
{% endif %}
</div>
{% include 'inc/panels/comments.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
2021-04-30 15:55:37 -07:00
<div class="col col-md-12">
{% plugin_full_width_page object %}
2019-03-11 22:40:52 -04:00
</div>
</div>
{% endblock %}