_consoleport.html 2.4 KB

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