poweroutlet.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <tr class="poweroutlet{% if po.connected_port and not po.connected_port.connection_status %} info{% endif %}">
  2. {% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %}
  3. <td class="pk">
  4. <input name="pk" type="checkbox" value="{{ po.pk }}" />
  5. </td>
  6. {% endif %}
  7. <td>
  8. <i class="fa fa-fw fa-bolt"></i> {{ po }}
  9. </td>
  10. {% if po.connected_port %}
  11. <td>
  12. <a href="{% url 'dcim:device' pk=po.connected_port.device.pk %}">{{ po.connected_port.device }}</a>
  13. </td>
  14. <td>
  15. {{ po.connected_port }}
  16. </td>
  17. {% else %}
  18. <td colspan="2">
  19. <span class="text-muted">Not connected</span>
  20. </td>
  21. {% endif %}
  22. <td class="text-right">
  23. {% if perms.dcim.change_poweroutlet %}
  24. {% if po.connected_port %}
  25. {% if po.connected_port.connection_status %}
  26. <a href="#" class="btn btn-warning btn-xs powerport-toggle connected" title="Mark planned" data="{{ po.connected_port.pk }}">
  27. <i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
  28. </a>
  29. {% else %}
  30. <a href="#" class="btn btn-success btn-xs consoleport-toggle" title="Mark installed" data="{{ po.connected_port.pk }}">
  31. <i class="fa fa-plug" aria-hidden="true"></i>
  32. </a>
  33. {% endif %}
  34. <a href="{% url 'dcim:poweroutlet_disconnect' pk=po.pk %}" title="Delete connection" class="btn btn-danger btn-xs">
  35. <i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
  36. </a>
  37. {% else %}
  38. <a href="{% url 'dcim:poweroutlet_connect' pk=po.pk %}" title="Connect" class="btn btn-success btn-xs">
  39. <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
  40. </a>
  41. {% endif %}
  42. <a href="{% url 'dcim:poweroutlet_edit' pk=po.pk %}" title="Edit outlet" class="btn btn-info btn-xs">
  43. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  44. </a>
  45. {% endif %}
  46. {% if perms.dcim.delete_poweroutlet %}
  47. {% if po.connected_port %}
  48. <button class="btn btn-danger btn-xs" disabled="disabled">
  49. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  50. </button>
  51. {% else %}
  52. <a href="{% url 'dcim:poweroutlet_delete' pk=po.pk %}" title="Delete outlet" class="btn btn-danger btn-xs">
  53. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  54. </a>
  55. {% endif %}
  56. {% endif %}
  57. </td>
  58. </tr>