interface.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <tr class="interface{% if not iface.enabled %} danger{% endif %}">
  2. {% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %}
  3. <td class="pk">
  4. <input name="pk" type="checkbox" value="{{ iface.pk }}" />
  5. </td>
  6. {% endif %}
  7. <td>
  8. <i class="fa fa-fw fa-square"></i> <span>{{ iface.name }}</span>
  9. {% if iface.description %}
  10. <i class="fa fa-fw fa-comment-o" title="{{ iface.description }}"></i>
  11. {% endif %}
  12. </td>
  13. <td>{{ iface.mtu|default:"" }}</td>
  14. <td>{{ iface.mac_address|default:"" }}</td>
  15. <td class="text-right">
  16. {% if perms.ipam.add_ipaddress %}
  17. <a href="{% url 'ipam:ipaddress_add' %}?interface={{ iface.pk }}&return_url={{ vm.get_absolute_url }}" class="btn btn-xs btn-success" title="Add IP address">
  18. <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
  19. </a>
  20. {% endif %}
  21. {% if perms.dcim.change_interface %}
  22. <a href="{% url 'virtualization:interface_edit' pk=iface.pk %}" class="btn btn-info btn-xs" title="Edit interface">
  23. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  24. </a>
  25. {% endif %}
  26. {% if perms.dcim.delete_interface %}
  27. <a href="{% url 'virtualization:interface_delete' pk=iface.pk %}" class="btn btn-danger btn-xs" title="Delete interface">
  28. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  29. </a>
  30. {% endif %}
  31. </td>
  32. </tr>
  33. {% for ip in iface.ip_addresses.all %}
  34. <tr class="ipaddress">
  35. {% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %}
  36. <td></td>
  37. {% endif %}
  38. <td>
  39. <a href="{% url 'ipam:ipaddress' pk=ip.pk %}">{{ ip }}</a>
  40. {% if ip.description %}
  41. <i class="fa fa-fw fa-comment-o" title="{{ ip.description }}"></i>
  42. {% endif %}
  43. {% if vm.primary_ip4 == ip or vm.primary_ip6 == ip %}
  44. <span class="label label-success">Primary</span>
  45. {% endif %}
  46. </td>
  47. <td class="text-right">
  48. {% if ip.vrf %}
  49. <a href="{% url 'ipam:vrf' pk=ip.vrf.pk %}">{{ ip.vrf }}</a>
  50. {% else %}
  51. <span class="text-muted">Global</span>
  52. {% endif %}
  53. </td>
  54. <td>
  55. <span class="label label-{{ ip.get_status_class }}">{{ ip.get_status_display }}</span>
  56. </td>
  57. <td class="text-right">
  58. {% if perms.ipam.change_ipaddress %}
  59. <a href="{% url 'ipam:ipaddress_edit' pk=ip.pk %}?return_url={{ vm.get_absolute_url }}" class="btn btn-info btn-xs">
  60. <i class="glyphicon glyphicon-pencil" aria-hidden="true" title="Edit IP address"></i>
  61. </a>
  62. {% endif %}
  63. {% if perms.ipam.delete_ipaddress %}
  64. <a href="{% url 'ipam:ipaddress_delete' pk=ip.pk %}?return_url={{ vm.get_absolute_url }}" class="btn btn-danger btn-xs">
  65. <i class="glyphicon glyphicon-trash" aria-hidden="true" title="Delete IP address"></i>
  66. </a>
  67. {% endif %}
  68. </td>
  69. </tr>
  70. {% endfor %}