consoleserverport.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {% load helpers %}
  2. <tr class="consoleserverport{% if csp.cable %} {{ csp.cable.get_status_class }}{% endif %}">
  3. {# Checkbox #}
  4. {% if perms.dcim.change_consoleserverport or perms.dcim.delete_consoleserverport %}
  5. <td class="pk">
  6. <input name="pk" type="checkbox" value="{{ csp.pk }}" />
  7. </td>
  8. {% endif %}
  9. {# Name #}
  10. <td>
  11. <i class="fa fa-fw fa-keyboard-o"></i> {{ csp }}
  12. </td>
  13. {# Type #}
  14. <td>
  15. {% if csp.type %}{{ csp.get_type_display }}{% else %}&mdash;{% endif %}
  16. </td>
  17. {# Description #}
  18. <td>
  19. {{ csp.description|placeholder }}
  20. </td>
  21. {# Cable #}
  22. <td class="text-nowrap">
  23. {% if csp.cable %}
  24. <a href="{{ csp.cable.get_absolute_url }}">{{ csp.cable }}</a>
  25. <a href="{% url 'dcim:consoleserverport_trace' pk=csp.pk %}" class="btn btn-primary btn-xs" title="Trace">
  26. <i class="fa fa-share-alt" aria-hidden="true"></i>
  27. </a>
  28. {% else %}
  29. <span class="text-muted">&mdash;</span>
  30. {% endif %}
  31. </td>
  32. {# Connection #}
  33. {% if csp.connected_endpoint %}
  34. <td>
  35. <a href="{% url 'dcim:device' pk=csp.connected_endpoint.device.pk %}">{{ csp.connected_endpoint.device }}</a>
  36. </td>
  37. <td>
  38. {{ csp.connected_endpoint }}
  39. </td>
  40. {% else %}
  41. <td colspan="2">
  42. <span class="text-muted">Not connected</span>
  43. </td>
  44. {% endif %}
  45. {# Actions #}
  46. <td class="text-right noprint">
  47. {% if csp.cable %}
  48. {% include 'dcim/inc/cable_toggle_buttons.html' with cable=csp.cable %}
  49. {% elif perms.dcim.add_cable %}
  50. <span class="dropdown">
  51. <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  52. <span class="glyphicon glyphicon-resize-small" aria-hidden="true"></span>
  53. </button>
  54. <ul class="dropdown-menu dropdown-menu-right">
  55. <li><a href="{% url 'dcim:consoleserverport_connect' termination_a_id=csp.pk termination_b_type='console-port' %}?return_url={{ device.get_absolute_url }}">Console Port</a></li>
  56. <li><a href="{% url 'dcim:consoleserverport_connect' termination_a_id=csp.pk termination_b_type='front-port' %}?return_url={{ device.get_absolute_url }}">Front Port</a></li>
  57. <li><a href="{% url 'dcim:consoleserverport_connect' termination_a_id=csp.pk termination_b_type='rear-port' %}?return_url={{ device.get_absolute_url }}">Rear Port</a></li>
  58. </ul>
  59. </span>
  60. {% endif %}
  61. {% if perms.dcim.change_consoleserverport %}
  62. <a href="{% url 'dcim:consoleserverport_edit' pk=csp.pk %}" title="Edit port" class="btn btn-info btn-xs">
  63. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  64. </a>
  65. {% endif %}
  66. {% if perms.dcim.delete_consoleserverport %}
  67. {% if csp.connected_endpoint %}
  68. <button class="btn btn-danger btn-xs" disabled="disabled">
  69. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  70. </button>
  71. {% else %}
  72. <a href="{% url 'dcim:consoleserverport_delete' pk=csp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
  73. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  74. </a>
  75. {% endif %}
  76. {% endif %}
  77. </td>
  78. </tr>