consoleserverport.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <tr class="consoleserverport{% if csp.connected_endpoint %} {%if csp.connected_endpoint.connection_status %}success{% else %}info{% endif %}{% 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">
  35. {% if perms.dcim.change_consoleserverport %}
  36. {% if csp.connected_endpoint %}
  37. {% if csp.connected_endpoint.connection_status %}
  38. <a href="#" class="btn btn-warning btn-xs consoleport-toggle connected" title="Mark planned" data="{{ csp.connected_endpoint.pk }}">
  39. <i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
  40. </a>
  41. {% else %}
  42. <a href="#" class="btn btn-success btn-xs consoleport-toggle" title="Mark installed" data="{{ csp.connected_endpoint.pk }}">
  43. <i class="fa fa-plug" aria-hidden="true"></i>
  44. </a>
  45. {% endif %}
  46. <a href="{% url 'dcim:cable_delete' pk=csp.cable.pk %}" title="Remove cable" class="btn btn-danger btn-xs">
  47. <i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
  48. </a>
  49. {% else %}
  50. <a href="{% url 'dcim:consoleserverport_connect' termination_a_id=csp.pk %}" title="Connect" class="btn btn-success btn-xs">
  51. <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
  52. </a>
  53. {% endif %}
  54. <a href="{% url 'dcim:consoleserverport_edit' pk=csp.pk %}" title="Edit port" class="btn btn-info btn-xs">
  55. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  56. </a>
  57. {% endif %}
  58. {% if perms.dcim.delete_consoleserverport %}
  59. {% if csp.connected_endpoint %}
  60. <button class="btn btn-danger btn-xs" disabled="disabled">
  61. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  62. </button>
  63. {% else %}
  64. <a href="{% url 'dcim:consoleserverport_delete' pk=csp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
  65. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  66. </a>
  67. {% endif %}
  68. {% endif %}
  69. </td>
  70. </tr>