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

72 lines
3.1 KiB
HTML
Raw Normal View History

<tr class="consoleport{% if cp.connected_endpoint %} {% if cp.connection_status %}success{% else %}info{% endif %}{% endif %}">
{# Name #}
2016-03-01 11:23:03 -05:00
<td>
<i class="fa fa-fw fa-keyboard-o"></i> {{ cp }}
2016-03-01 11:23:03 -05:00
</td>
{# Cable #}
<td>
{% with cable=cp.get_connected_cable %}
{% if cable %}
2018-10-29 09:12:41 -04:00
Cable <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
{% if cable.far_end != cp.connected_endpoint %}
to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
{% endif %}
{% endif %}
{% endwith %}
</td>
{# Connection #}
{% if cp.connected_endpoint %}
2016-03-01 11:23:03 -05:00
<td>
<a href="{% url 'dcim:device' pk=cp.connected_endpoint.device.pk %}">{{ cp.connected_endpoint.device }}</a>
2016-03-01 11:23:03 -05:00
</td>
<td>
{{ cp.connected_endpoint }}
2016-03-01 11:23:03 -05:00
</td>
{% else %}
2016-07-06 16:01:18 -04:00
<td colspan="2">
<span class="text-muted">Not connected</span>
</td>
2016-03-01 11:23:03 -05:00
{% endif %}
{# Actions #}
<td class="text-right">
2016-03-01 11:23:03 -05:00
{% if perms.dcim.change_consoleport %}
{% if cp.connected_endpoint %}
2016-03-01 11:23:03 -05:00
{% if cp.connection_status %}
<a href="#" class="btn btn-warning btn-xs consoleport-toggle connected" title="Mark planned" data="{{ cp.pk }}">
<i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% else %}
<a href="#" class="btn btn-success btn-xs consoleport-toggle" title="Mark installed" data="{{ cp.pk }}">
<i class="fa fa-plug" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
<a href="{% url 'dcim:consoleport_disconnect' pk=cp.pk %}" title="Delete connection" class="btn btn-danger btn-xs">
<i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% else %}
<a href="{% url 'dcim:consoleport_connect' termination_a_id=cp.pk %}" title="Connect" class="btn btn-success btn-xs">
<i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
<a href="{% url 'dcim:consoleport_edit' pk=cp.pk %}" title="Edit port" class="btn btn-info btn-xs">
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
{% if perms.dcim.delete_consoleport %}
{% if cp.connected_endpoint %}
2016-03-01 11:23:03 -05:00
<button class="btn btn-danger btn-xs" disabled="disabled">
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
</button>
{% else %}
<a href="{% url 'dcim:consoleport_delete' pk=cp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
{% endif %}
</td>
</tr>