consoleport.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <tr class="consoleport{% if cp.cable.status %} success{% elif cp.cable %} info{% endif %}">
  2. {# Name #}
  3. <td>
  4. <i class="fa fa-fw fa-keyboard-o"></i> {{ cp }}
  5. </td>
  6. <td></td>
  7. {# Description #}
  8. <td>
  9. {{ cp.description }}
  10. </td>
  11. {# Cable #}
  12. <td>
  13. {% if cp.cable %}
  14. <a href="{{ cp.cable.get_absolute_url }}">{{ cp.cable }}</a>
  15. {% else %}
  16. &mdash;
  17. {% endif %}
  18. </td>
  19. {# Connection #}
  20. {% if cp.connected_endpoint %}
  21. <td>
  22. <a href="{% url 'dcim:device' pk=cp.connected_endpoint.device.pk %}">{{ cp.connected_endpoint.device }}</a>
  23. </td>
  24. <td>
  25. {{ cp.connected_endpoint }}
  26. </td>
  27. {% else %}
  28. <td colspan="2">
  29. <span class="text-muted">Not connected</span>
  30. </td>
  31. {% endif %}
  32. {# Actions #}
  33. <td class="text-right noprint">
  34. {% if cp.cable %}
  35. {% include 'dcim/inc/cable_toggle_buttons.html' with cable=cp.cable %}
  36. {% elif perms.dcim.add_cable %}
  37. <span class="dropdown">
  38. <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  39. <span class="glyphicon glyphicon-resize-small" aria-hidden="true"></span>
  40. </button>
  41. <ul class="dropdown-menu dropdown-menu-right">
  42. <li><a href="{% url 'dcim:consoleport_connect' termination_a_id=cp.pk termination_b_type='console-server-port' %}?return_url={{ device.get_absolute_url }}">Console Server Port</a></li>
  43. <li><a href="{% url 'dcim:consoleport_connect' termination_a_id=cp.pk termination_b_type='front-port' %}?return_url={{ device.get_absolute_url }}">Front Port</a></li>
  44. <li><a href="{% url 'dcim:consoleport_connect' termination_a_id=cp.pk termination_b_type='rear-port' %}?return_url={{ device.get_absolute_url }}">Rear Port</a></li>
  45. </ul>
  46. </span>
  47. {% endif %}
  48. {% if perms.dcim.change_consoleport %}
  49. <a href="{% url 'dcim:consoleport_edit' pk=cp.pk %}" title="Edit port" class="btn btn-info btn-xs">
  50. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  51. </a>
  52. {% endif %}
  53. {% if perms.dcim.delete_consoleport %}
  54. {% if cp.connected_endpoint %}
  55. <button class="btn btn-danger btn-xs" disabled="disabled">
  56. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  57. </button>
  58. {% else %}
  59. <a href="{% url 'dcim:consoleport_delete' pk=cp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
  60. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  61. </a>
  62. {% endif %}
  63. {% endif %}
  64. </td>
  65. </tr>