consoleport.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <tr class="consoleport{% if cp.cs_port and not cp.connection_status %} info{% endif %}">
  2. <td>
  3. <i class="fa fa-fw fa-keyboard-o"></i> {{ cp }}
  4. </td>
  5. {% if cp.cs_port %}
  6. <td>
  7. <a href="{% url 'dcim:device' pk=cp.cs_port.device.pk %}">{{ cp.cs_port.device }}</a>
  8. </td>
  9. <td>
  10. {{ cp.cs_port }}
  11. </td>
  12. {% else %}
  13. <td colspan="2">
  14. <span class="text-muted">Not connected</span>
  15. </td>
  16. {% endif %}
  17. <td class="text-right">
  18. {% if perms.dcim.change_consoleport %}
  19. {% if cp.cs_port %}
  20. {% if cp.connection_status %}
  21. <a href="#" class="btn btn-warning btn-xs consoleport-toggle connected" title="Mark planned" data="{{ cp.pk }}">
  22. <i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
  23. </a>
  24. {% else %}
  25. <a href="#" class="btn btn-success btn-xs consoleport-toggle" title="Mark installed" data="{{ cp.pk }}">
  26. <i class="fa fa-plug" aria-hidden="true"></i>
  27. </a>
  28. {% endif %}
  29. <a href="{% url 'dcim:consoleport_disconnect' pk=cp.pk %}" title="Delete connection" class="btn btn-danger btn-xs">
  30. <i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
  31. </a>
  32. {% else %}
  33. <a href="{% url 'dcim:consoleport_connect' pk=cp.pk %}" title="Connect" class="btn btn-success btn-xs">
  34. <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
  35. </a>
  36. {% endif %}
  37. <a href="{% url 'dcim:consoleport_edit' pk=cp.pk %}" title="Edit port" class="btn btn-info btn-xs">
  38. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  39. </a>
  40. {% endif %}
  41. {% if perms.dcim.delete_consoleport %}
  42. {% if cp.cs_port %}
  43. <button class="btn btn-danger btn-xs" disabled="disabled">
  44. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  45. </button>
  46. {% else %}
  47. <a href="{% url 'dcim:consoleport_delete' pk=cp.pk %}" title="Delete port" class="btn btn-danger btn-xs">
  48. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  49. </a>
  50. {% endif %}
  51. {% endif %}
  52. </td>
  53. </tr>