consoleserverport.html 3.6 KB

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