ipaddress.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% load i18n %}
  6. {% block content %}
  7. <div class="row">
  8. <div class="col col-12 col-md-4">
  9. <div class="card">
  10. <h2 class="card-header">{% trans "IP Address" %}</h2>
  11. <table class="table table-hover attr-table">
  12. <tr>
  13. <th scope="row">{% trans "Family" %}</th>
  14. <td>IPv{{ object.family }}</td>
  15. </tr>
  16. <tr>
  17. <th scope="row">{% trans "VRF" %}</th>
  18. <td>
  19. {% if object.vrf %}
  20. <a href="{% url 'ipam:vrf' pk=object.vrf.pk %}">{{ object.vrf }}</a>
  21. {% else %}
  22. <span>{% trans "Global" %}</span>
  23. {% endif %}
  24. </td>
  25. </tr>
  26. <tr>
  27. <th scope="row">{% trans "Tenant" %}</th>
  28. <td>
  29. {% if object.tenant.group %}
  30. {{ object.tenant.group|linkify }} /
  31. {% endif %}
  32. {{ object.tenant|linkify|placeholder }}
  33. </td>
  34. </tr>
  35. <tr>
  36. <th scope="row">{% trans "Status" %}</th>
  37. <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
  38. </tr>
  39. <tr>
  40. <th scope="row">{% trans "Role" %}</th>
  41. <td>
  42. {% if object.role %}
  43. <a href="{% url 'ipam:ipaddress_list' %}?role={{ object.role }}">{{ object.get_role_display }}</a>
  44. {% else %}
  45. {{ ''|placeholder }}
  46. {% endif %}
  47. </td>
  48. </tr>
  49. <tr>
  50. <th scope="row">{% trans "DNS Name" %}</th>
  51. <td>{{ object.dns_name|placeholder }}</td>
  52. </tr>
  53. <tr>
  54. <th scope="row">{% trans "Description" %}</th>
  55. <td>{{ object.description|placeholder }}</td>
  56. </tr>
  57. <tr>
  58. <th scope="row">{% trans "Assignment" %}</th>
  59. <td>
  60. {% if object.assigned_object %}
  61. {% if object.assigned_object.parent_object %}
  62. {{ object.assigned_object.parent_object|linkify }} /
  63. {% endif %}
  64. {{ object.assigned_object|linkify }}
  65. {% else %}
  66. {{ ''|placeholder }}
  67. {% endif %}
  68. </td>
  69. </tr>
  70. <tr>
  71. <th scope="row">{% trans "NAT (inside)" %}</th>
  72. <td>
  73. {% if object.nat_inside %}
  74. {{ object.nat_inside|linkify }}
  75. {% if object.nat_inside.assigned_object %}
  76. ({{ object.nat_inside.assigned_object.parent_object|linkify }})
  77. {% endif %}
  78. {% else %}
  79. {{ ''|placeholder }}
  80. {% endif %}
  81. </td>
  82. </tr>
  83. <tr>
  84. <th scope="row">{% trans "NAT (outside)" %}</th>
  85. <td>
  86. {% for ip in object.nat_outside.all %}
  87. {{ ip|linkify }}
  88. {% if ip.assigned_object %}
  89. ({{ ip.assigned_object.parent_object|linkify }})
  90. {% endif %}<br/>
  91. {% empty %}
  92. {{ ''|placeholder }}
  93. {% endfor %}
  94. </td>
  95. </tr>
  96. <tr>
  97. <th scope="row">Primary IP</th>
  98. <td>{% checkmark object.is_primary_ip %}</td>
  99. </tr>
  100. <tr>
  101. <th scope="row">OOB IP</th>
  102. <td>{% checkmark object.is_oob_ip %}</td>
  103. </tr>
  104. </table>
  105. </div>
  106. {% include 'inc/panels/tags.html' %}
  107. {% include 'inc/panels/custom_fields.html' %}
  108. {% include 'inc/panels/comments.html' %}
  109. {% plugin_left_page object %}
  110. </div>
  111. <div class="col col-md-8">
  112. {% include 'inc/panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
  113. {% if duplicate_ips_table.rows %}
  114. {% include 'inc/panel_table.html' with table=duplicate_ips_table heading='Duplicate IPs' panel_class='danger' %}
  115. {% endif %}
  116. <div class="card">
  117. <h2 class="card-header">{% trans "Services" %}</h2>
  118. {% htmx_table 'ipam:service_list' ip_address_id=object.pk %}
  119. </div>
  120. {% plugin_right_page object %}
  121. </div>
  122. </div>
  123. <div class="row">
  124. <div class="col col-md-12">
  125. {% plugin_full_width_page object %}
  126. </div>
  127. </div>
  128. {% endblock %}