poweroutlet.html 2.8 KB

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