powerport.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <tr class="powerport{% if pp.power_outlet and not pp.connection_status %} info{% endif %}">
  2. {% if selectable and perms.dcim.change_powerport or perms.dcim.delete_powerport %}
  3. <td class="pk">
  4. <input name="pk" type="checkbox" value="{{ pp.pk }}" />
  5. </td>
  6. {% endif %}
  7. <td>
  8. <i class="fa fa-fw fa-bolt"></i> {{ pp.name }}
  9. </td>
  10. {% if pp.power_outlet %}
  11. <td>
  12. <a href="{% url 'dcim:device' pk=pp.power_outlet.device.pk %}">{{ pp.power_outlet.device }}</a>
  13. </td>
  14. <td>
  15. {{ pp.power_outlet.name }}
  16. </td>
  17. {% else %}
  18. <td colspan="2">
  19. <span class="text-muted">Not connected</span>
  20. </td>
  21. {% endif %}
  22. <td colspan="2" class="text-right">
  23. {% if perms.dcim.change_powerport %}
  24. {% if pp.power_outlet %}
  25. {% if pp.connection_status %}
  26. <a href="#" class="btn btn-warning btn-xs powerport-toggle connected" data="{{ pp.pk }}">
  27. <i class="glyphicon glyphicon-ban-circle" aria-hidden="true" title="Mark planned"></i>
  28. </a>
  29. {% else %}
  30. <a href="#" class="btn btn-success btn-xs powerport-toggle" data="{{ pp.pk }}">
  31. <i class="fa fa-plug" aria-hidden="true" title="Mark connected"></i>
  32. </a>
  33. {% endif %}
  34. <a href="{% url 'dcim:powerport_disconnect' pk=pp.pk %}" class="btn btn-danger btn-xs">
  35. <i class="glyphicon glyphicon-remove" aria-hidden="true" title="Delete connection"></i>
  36. </a>
  37. {% else %}
  38. <a href="{% url 'dcim:powerport_connect' pk=pp.pk %}" class="btn btn-success btn-xs">
  39. <i class="glyphicon glyphicon-plus" aria-hidden="true" title="Connect"></i>
  40. </a>
  41. {% endif %}
  42. <a href="{% url 'dcim:powerport_edit' pk=pp.pk %}" class="btn btn-info btn-xs">
  43. <i class="glyphicon glyphicon-pencil" aria-hidden="true" title="Edit port"></i>
  44. </a>
  45. {% endif %}
  46. {% if perms.dcim.delete_powerport %}
  47. {% if pp.power_outlet %}
  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:powerport_delete' pk=pp.pk %}" class="btn btn-danger btn-xs">
  53. <i class="glyphicon glyphicon-trash" aria-hidden="true" title="Delete port"></i>
  54. </a>
  55. {% endif %}
  56. {% endif %}
  57. </td>
  58. </tr>