Add/update device component templates

This commit is contained in:
Jeremy Stretch 2020-06-25 11:00:25 -04:00
parent 909ddd653c
commit ecf40e1525
9 changed files with 679 additions and 57 deletions

View File

@ -0,0 +1,95 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Console Port</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.get_type_display }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Connection</strong>
</div>
{% if instance.cable %}
<table class="table table-hover panel-body attr-table">
{% if instance.connected_endpoint %}
<tr>
<td>Device</td>
<td>
<a href="{{ instance.connected_endpoint.device.get_absolute_url }}">{{ instance.connected_endpoint.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>
<a href="{{ instance.connected_endpoint.get_absolute_url }}">{{ instance.connected_endpoint.name }}</a>
</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.connected_endpoint.description|placeholder }}</td>
</tr>
{% endif %}
<tr>
<td>Cable</td>
<td>
<a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:consoleport_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<td>Connection Status</td>
<td>
{% if instance.connection_status %}
<span class="label label-success">{{ instance.get_connection_status_display }}</span>
{% else %}
<span class="label label-info">{{ instance.get_connection_status_display }}</span>
{% endif %}
</td>
</tr>
</table>
{% else %}
<div class="panel-body text-muted">
Not connected
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,95 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Console Server Port</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.get_type_display }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Connection</strong>
</div>
{% if instance.cable %}
<table class="table table-hover panel-body attr-table">
{% if instance.connected_endpoint %}
<tr>
<td>Device</td>
<td>
<a href="{{ instance.connected_endpoint.device.get_absolute_url }}">{{ instance.connected_endpoint.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>
<a href="{{ instance.connected_endpoint.get_absolute_url }}">{{ instance.connected_endpoint.name }}</a>
</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.connected_endpoint.description|placeholder }}</td>
</tr>
{% endif %}
<tr>
<td>Cable</td>
<td>
<a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:consoleserverport_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<td>Connection Status</td>
<td>
{% if instance.connection_status %}
<span class="label label-success">{{ instance.get_connection_status_display }}</span>
{% else %}
<span class="label label-info">{{ instance.get_connection_status_display }}</span>
{% endif %}
</td>
</tr>
</table>
{% else %}
<div class="panel-body text-muted">
Not connected
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,39 @@
{% extends 'base.html' %}
{% load helpers %}
{% load perms %}
{% block header %}
<div class="row noprint">
<div class="col-md-12">
<ol class="breadcrumb">
<li><a href="{% url 'dcim:device_list' %}">Devices</a></li>
<li><a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a></li>
<li><a href="{% url instance|url_name:"list" %}?device_id={{ instance.device.pk }}">{{ instance|meta:"verbose_name_plural"|bettertitle }}</a></li>
<li>{{ instance }}</li>
</ol>
</div>
</div>
<div class="pull-right noprint">
{% if request.user|can_change:instance %}
<a href="{% url instance|url_name:"edit" pk=instance.pk %}" class="btn btn-warning">
<span class="fa fa-pencil" aria-hidden="true"></span> Edit
</a>
{% endif %}
{% if request.user|can_delete:instance %}
<a href="{% url instance|url_name:"delete" pk=instance.pk %}" class="btn btn-danger">
<span class="fa fa-trash" aria-hidden="true"></span> Delete
</a>
{% endif %}
</div>
<h1>{% block title %}{{ instance.device }} / {{ instance }}{% endblock %}</h1>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ instance.get_absolute_url }}">{{ instance|meta:"verbose_name"|bettertitle }}</a>
</li>
{% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
<a href="{% url instance|url_name:"changelog" pk=instance.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock %}

View File

@ -0,0 +1,62 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Device Bay</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Installed Device</strong>
</div>
{% if instance.installed_device %}
{% with device=instance.installed_device %}
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ device.get_absolute_url }}">{{ device }}</a>
</td>
</tr>
<tr>
<td>Device Type</td>
<td>{{ device.device_type }}</td>
</tr>
</table>
{% endwith %}
{% else %}
<div class="panel-body text-muted">
None
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,83 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Front Port</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.get_type_display }}</td>
</tr>
<tr>
<td>Rear Port</td>
<td>
<a href="{{ instance.rear_port.get_absolute_url }}">{{ instance.rear_port }}</a>
</td>
</tr>
<tr>
<td>Rear Port Position</td>
<td>{{ instance.rear_port_position }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Connection</strong>
</div>
{% if instance.cable %}
<table class="table table-hover panel-body attr-table">
<tr>
<td>Cable</td>
<td>
<a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:frontport_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<td>Connection Status</td>
<td>
{% if instance.cable.status %}
<span class="label label-success">{{ instance.cable.get_status_display }}</span>
{% else %}
<span class="label label-info">{{ instance.cable.get_status_display }}</span>
{% endif %}
</td>
</tr>
</table>
{% else %}
<div class="panel-body text-muted">
Not connected
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,41 +1,6 @@
{% extends 'base.html' %} {% extends 'dcim/device_component.html' %}
{% load helpers %} {% load helpers %}
{% block header %}
<div class="row noprint">
<div class="col-md-12">
<ol class="breadcrumb">
<li><a href="{% url 'dcim:device_list' %}">Devices</a></li>
<li><a href="{{ interface.device.get_absolute_url }}">{{ interface.device }}</a></li>
<li>{{ interface }}</li>
</ol>
</div>
</div>
<div class="pull-right noprint">
{% if perms.dcim.change_interface %}
<a href="{% url 'dcim:interface_edit' pk=interface.pk %}" class="btn btn-warning">
<span class="fa fa-pencil" aria-hidden="true"></span> Edit
</a>
{% endif %}
{% if perms.dcim.delete_interface %}
<a href="{% url 'dcim:interface_delete' pk=interface.pk %}" class="btn btn-danger">
<span class="fa fa-trash" aria-hidden="true"></span> Delete
</a>
{% endif %}
</div>
<h1>{% block title %}{{ interface.device }} / {{ interface.name }}{% endblock %}</h1>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ interface.get_absolute_url }}">Interface</a>
</li>
{% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
<a href="{% url 'dcim:interface_changelog' pk=interface.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@ -47,25 +12,25 @@
<tr> <tr>
<td>Device</td> <td>Device</td>
<td> <td>
<a href="{{ interface.device.get_absolute_url }}">{{ interface.device }}</a> <a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Name</td> <td>Name</td>
<td>{{ interface.name }}</td> <td>{{ instance.name }}</td>
</tr> </tr>
<tr> <tr>
<td>Label</td> <td>Label</td>
<td>{{ interface.label|placeholder }}</td> <td>{{ instance.label|placeholder }}</td>
</tr> </tr>
<tr> <tr>
<td>Type</td> <td>Type</td>
<td>{{ interface.get_type_display }}</td> <td>{{ instance.get_type_display }}</td>
</tr> </tr>
<tr> <tr>
<td>Enabled</td> <td>Enabled</td>
<td> <td>
{% if interface.enabled %} {% if instance.enabled %}
<span class="text-success"><i class="fa fa-check"></i></span> <span class="text-success"><i class="fa fa-check"></i></span>
{% else %} {% else %}
<span class="text-danger"><i class="fa fa-close"></i></span> <span class="text-danger"><i class="fa fa-close"></i></span>
@ -75,8 +40,8 @@
<tr> <tr>
<td>LAG</td> <td>LAG</td>
<td> <td>
{% if interface.lag%} {% if instance.lag%}
<a href="{{ interface.lag.get_absolute_url }}">{{ interface.lag }}</a> <a href="{{ instance.lag.get_absolute_url }}">{{ instance.lag }}</a>
{% else %} {% else %}
<span class="text-muted">None</span> <span class="text-muted">None</span>
{% endif %} {% endif %}
@ -84,31 +49,31 @@
</tr> </tr>
<tr> <tr>
<td>Description</td> <td>Description</td>
<td>{{ interface.description|placeholder }} </td> <td>{{ instance.description|placeholder }} </td>
</tr> </tr>
<tr> <tr>
<td>MTU</td> <td>MTU</td>
<td>{{ interface.mtu|placeholder }}</td> <td>{{ instance.mtu|placeholder }}</td>
</tr> </tr>
<tr> <tr>
<td>MAC Address</td> <td>MAC Address</td>
<td><span class="text-monospace">{{ interface.mac_address|placeholder }}</span></td> <td><span class="text-monospace">{{ instance.mac_address|placeholder }}</span></td>
</tr> </tr>
<tr> <tr>
<td>802.1Q Mode</td> <td>802.1Q Mode</td>
<td>{{ interface.get_mode_display }}</td> <td>{{ instance.get_mode_display }}</td>
</tr> </tr>
</table> </table>
</div> </div>
{% include 'extras/inc/tags_panel.html' with tags=interface.tags.all %} {% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{% if interface.is_connectable %} {% if instance.is_connectable %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<strong>Connection</strong> <strong>Connection</strong>
</div> </div>
{% if interface.cable %} {% if instance.cable %}
<table class="table table-hover panel-body attr-table"> <table class="table table-hover panel-body attr-table">
{% if connected_interface %} {% if connected_interface %}
<tr> <tr>
@ -182,8 +147,8 @@
<tr> <tr>
<td>Cable</td> <td>Cable</td>
<td> <td>
<a href="{{ interface.cable.get_absolute_url }}">{{ interface.cable }}</a> <a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:interface_trace' pk=interface.pk %}" class="btn btn-primary btn-xs" title="Trace"> <a href="{% url 'dcim:interface_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i> <i class="fa fa-share-alt" aria-hidden="true"></i>
</a> </a>
</td> </td>
@ -191,10 +156,10 @@
<tr> <tr>
<td>Connection Status</td> <td>Connection Status</td>
<td> <td>
{% if interface.connection_status %} {% if instance.connection_status %}
<span class="label label-success">{{ interface.get_connection_status_display }}</span> <span class="label label-success">{{ instance.get_connection_status_display }}</span>
{% else %} {% else %}
<span class="label label-info">{{ interface.get_connection_status_display }}</span> <span class="label label-info">{{ instance.get_connection_status_display }}</span>
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
@ -206,7 +171,7 @@
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
{% if interface.is_lag %} {% if instance.is_lag %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><strong>LAG Members</strong></div> <div class="panel-heading"><strong>LAG Members</strong></div>
<table class="table table-hover table-headings panel-body"> <table class="table table-hover table-headings panel-body">
@ -218,7 +183,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for member in interface.member_interfaces.all %} {% for member in instance.member_interfaces.all %}
<tr> <tr>
<td> <td>
<a href="{{ member.device.get_absolute_url }}">{{ member.device }}</a> <a href="{{ member.device.get_absolute_url }}">{{ member.device }}</a>

View File

@ -0,0 +1,103 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Power Outlet</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.get_type_display }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
<tr>
<td>Power Port</td>
<td>{{ instance.power_port }}</td>
</tr>
<tr>
<td>Feed Leg</td>
<td>{{ instance.get_feed_leg_display }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Connection</strong>
</div>
{% if instance.cable %}
<table class="table table-hover panel-body attr-table">
{% if instance.connected_endpoint %}
<tr>
<td>Device</td>
<td>
<a href="{{ instance.connected_endpoint.device.get_absolute_url }}">{{ instance.connected_endpoint.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>
<a href="{{ instance.connected_endpoint.get_absolute_url }}">{{ instance.connected_endpoint.name }}</a>
</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.connected_endpoint.description|placeholder }}</td>
</tr>
{% endif %}
<tr>
<td>Cable</td>
<td>
<a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:poweroutlet_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<td>Connection Status</td>
<td>
{% if instance.connection_status %}
<span class="label label-success">{{ instance.get_connection_status_display }}</span>
{% else %}
<span class="label label-info">{{ instance.get_connection_status_display }}</span>
{% endif %}
</td>
</tr>
</table>
{% else %}
<div class="panel-body text-muted">
Not connected
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,103 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Power Port</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.get_type_display }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
<tr>
<td>Maximum Draw</td>
<td>{{ instance.maximum_draw|placeholder }}</td>
</tr>
<tr>
<td>Allocated Draw</td>
<td>{{ instance.allocated_draw|placeholder }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Connection</strong>
</div>
{% if instance.cable %}
<table class="table table-hover panel-body attr-table">
{% if instance.connected_endpoint %}
<tr>
<td>Device</td>
<td>
<a href="{{ instance.connected_endpoint.device.get_absolute_url }}">{{ instance.connected_endpoint.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>
<a href="{{ instance.connected_endpoint.get_absolute_url }}">{{ instance.connected_endpoint.name }}</a>
</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.connected_endpoint.get_type_display|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.connected_endpoint.description|placeholder }}</td>
</tr>
{% endif %}
<tr>
<td>Cable</td>
<td>
<a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:powerport_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<td>Connection Status</td>
<td>
{% if instance.connection_status %}
<span class="label label-success">{{ instance.get_connection_status_display }}</span>
{% else %}
<span class="label label-info">{{ instance.get_connection_status_display }}</span>
{% endif %}
</td>
</tr>
</table>
{% else %}
<div class="panel-body text-muted">
Not connected
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,77 @@
{% extends 'dcim/device_component.html' %}
{% load helpers %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Rear Port</strong>
</div>
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>
<a href="{{ instance.device.get_absolute_url }}">{{ instance.device }}</a>
</td>
</tr>
<tr>
<td>Name</td>
<td>{{ instance.name }}</td>
</tr>
<tr>
<td>Label</td>
<td>{{ instance.label|placeholder }}</td>
</tr>
<tr>
<td>Type</td>
<td>{{ instance.get_type_display }}</td>
</tr>
<tr>
<td>Positions</td>
<td>{{ instance.positions }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ instance.description|placeholder }}</td>
</tr>
</table>
</div>
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Connection</strong>
</div>
{% if instance.cable %}
<table class="table table-hover panel-body attr-table">
<tr>
<td>Cable</td>
<td>
<a href="{{ instance.cable.get_absolute_url }}">{{ instance.cable }}</a>
<a href="{% url 'dcim:rearport_trace' pk=instance.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<td>Connection Status</td>
<td>
{% if instance.cable.status %}
<span class="label label-success">{{ instance.cable.get_status_display }}</span>
{% else %}
<span class="label label-info">{{ instance.cable.get_status_display }}</span>
{% endif %}
</td>
</tr>
</table>
{% else %}
<div class="panel-body text-muted">
Not connected
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}