consoleserverport.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <tr class="consoleserverport{% if csp.cable.status %} success{% elif csp.cable %} info{% endif %}">
  2. {# Checkbox #}
  3. {% if perms.dcim.change_consoleserverport or perms.dcim.delete_consoleserverport %}
  4. <td class="pk">
  5. <input name="pk" type="checkbox" value="{{ csp.pk }}" />
  6. </td>
  7. {% endif %}
  8. {# Name #}
  9. <td>
  10. <i class="fa fa-fw fa-keyboard-o"></i> {{ csp }}
  11. </td>
  12. {# Cable #}
  13. <td>
  14. {% if csp.cable %}
  15. <a href="{{ csp.cable.get_absolute_url }}">{{ csp.cable }}</a>
  16. {% else %}
  17. &mdash;
  18. {% endif %}
  19. </td>
  20. {# Connection #}
  21. {% if csp.connected_endpoint %}
  22. <td>
  23. <a href="{% url 'dcim:device' pk=csp.connected_endpoint.device.pk %}">{{ csp.connected_endpoint.device }}</a>
  24. </td>
  25. <td>
  26. {{ csp.connected_endpoint }}
  27. </td>
  28. {% else %}
  29. <td colspan="2">
  30. <span class="text-muted">Not connected</span>
  31. </td>
  32. {% endif %}
  33. {# Actions #}
  34. <td class="text-right noprint">
  35. {% if csp.cable %}
  36. {% include 'dcim/inc/cable_toggle_buttons.html' with cable=csp.cable %}
  37. {% elif perms.dcim.add_cable %}
  38. <a href="{% url 'dcim:consoleserverport_connect' termination_a_id=csp.pk %}?return_url={{ device.get_absolute_url }}" title="Connect" class="btn btn-success btn-xs">
  39. <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
  40. </a>
  41. {% endif %}
  42. {% if perms.dcim.change_consoleserverport %}
  43. <a href="{% url 'dcim:consoleserverport_edit' pk=csp.pk %}" title="Edit port" class="btn btn-info btn-xs">
  44. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  45. </a>
  46. {% endif %}
  47. {% if perms.dcim.delete_consoleserverport %}
  48. {% if csp.connected_endpoint %}
  49. <button class="btn btn-danger btn-xs" disabled="disabled">
  50. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  51. </button>
  52. {% else %}
  53. <a href="{% url 'dcim:consoleserverport_delete' pk=csp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
  54. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  55. </a>
  56. {% endif %}
  57. {% endif %}
  58. </td>
  59. </tr>