ipaddress.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% block breadcrumbs %}
  6. {{ block.super }}
  7. {% if object.vrf %}
  8. <li class="breadcrumb-item"><a href="{% url 'ipam:ipaddress_list' %}?vrf_id={{ object.vrf.pk }}">{{ object.vrf }}</a></li>
  9. {% endif %}
  10. {% endblock %}
  11. {% block content %}
  12. <div class="row">
  13. <div class="col col-md-4">
  14. <div class="card">
  15. <h5 class="card-header">
  16. IP Address
  17. </h5>
  18. <div class="card-body">
  19. <table class="table table-hover attr-table">
  20. <tr>
  21. <th scope="row">Family</th>
  22. <td>IPv{{ object.family }}</td>
  23. </tr>
  24. <tr>
  25. <th scope="row">VRF</th>
  26. <td>
  27. {% if object.vrf %}
  28. <a href="{% url 'ipam:vrf' pk=object.vrf.pk %}">{{ object.vrf }}</a>
  29. {% else %}
  30. <span>Global</span>
  31. {% endif %}
  32. </td>
  33. </tr>
  34. <tr>
  35. <th scope="row">Tenant</th>
  36. <td>
  37. {% if object.tenant.group %}
  38. {{ object.tenant.group|linkify }} /
  39. {% endif %}
  40. {{ object.tenant|linkify|placeholder }}
  41. </td>
  42. </tr>
  43. <tr>
  44. <th scope="row">Status</th>
  45. <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
  46. </tr>
  47. <tr>
  48. <th scope="row">Role</th>
  49. <td>
  50. {% if object.role %}
  51. <a href="{% url 'ipam:ipaddress_list' %}?role={{ object.role }}">{{ object.get_role_display }}</a>
  52. {% else %}
  53. <span class="text-muted">None</span>
  54. {% endif %}
  55. </td>
  56. </tr>
  57. <tr>
  58. <th scope="row">DNS Name</th>
  59. <td>{{ object.dns_name|placeholder }}</td>
  60. </tr>
  61. <tr>
  62. <th scope="row">Description</th>
  63. <td>{{ object.description|placeholder }}</td>
  64. </tr>
  65. <tr>
  66. <th scope="row">Assignment</th>
  67. <td>
  68. {% if object.assigned_object %}
  69. {% if object.assigned_object.parent_object %}
  70. {{ object.assigned_object.parent_object|linkify }} /
  71. {% endif %}
  72. {{ object.assigned_object|linkify }}
  73. {% else %}
  74. <span class="text-muted">&mdash;</span>
  75. {% endif %}
  76. </td>
  77. </tr>
  78. <tr>
  79. <th scope="row">NAT (inside)</th>
  80. <td>
  81. {% if object.nat_inside %}
  82. {{ object.nat_inside|linkify }}
  83. {% if object.nat_inside.assigned_object %}
  84. ({{ object.nat_inside.assigned_object.parent_object|linkify }})
  85. {% endif %}
  86. {% else %}
  87. <span class="text-muted">None</span>
  88. {% endif %}
  89. </td>
  90. </tr>
  91. <tr>
  92. <th scope="row">Outside NAT IPs</th>
  93. <td>
  94. {% for ip in object.nat_outside.all %}
  95. {{ ip|linkify }}<br/>
  96. {% empty %}
  97. {{ ''|placeholder }}
  98. {% endfor %}
  99. </td>
  100. </tr>
  101. </table>
  102. </div>
  103. </div>
  104. {% include 'inc/panels/tags.html' %}
  105. {% include 'inc/panels/custom_fields.html' %}
  106. {% plugin_left_page object %}
  107. </div>
  108. <div class="col col-md-8">
  109. {% include 'inc/panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
  110. {% if duplicate_ips_table.rows %}
  111. {# Custom version of panel_table.html #}
  112. <div class="card border-danger">
  113. <h5 class="card-header">
  114. <span class="text-danger">Duplicate IP Addresses</span>
  115. {% if more_duplicate_ips %}
  116. <div class="float-end">
  117. <a type="button" class="btn btn-primary btn-sm"
  118. {% if object.vrf %}
  119. href="{% url 'ipam:ipaddress_list' %}?address={{ object.address.ip }}&vrf_id={{ object.vrf.pk }}"
  120. {% else %}
  121. href="{% url 'ipam:ipaddress_list' %}?address={{ object.address.ip }}&vrf_id=null"
  122. {% endif %}
  123. >Show all</a>
  124. </div>
  125. {% endif %}
  126. </h5>
  127. <div class="card-body table-responsive">
  128. {% render_table duplicate_ips_table 'inc/table.html' %}
  129. </div>
  130. </div>
  131. {% endif %}
  132. <div class="my-3">
  133. {% include 'inc/panel_table.html' with table=related_ips_table heading='Related IP Addresses' %}
  134. </div>
  135. <div class="card">
  136. <h5 class="card-header">
  137. Services
  138. </h5>
  139. <div class="card-body">
  140. {% if services %}
  141. <table class="table table-hover">
  142. {% for service in services %}
  143. {% include 'ipam/inc/service.html' %}
  144. {% endfor %}
  145. </table>
  146. {% else %}
  147. <div class="text-muted">
  148. None
  149. </div>
  150. {% endif %}
  151. </div>
  152. </div>
  153. {% plugin_right_page object %}
  154. </div>
  155. </div>
  156. <div class="row">
  157. <div class="col col-md-12">
  158. {% plugin_full_width_page object %}
  159. </div>
  160. </div>
  161. {% endblock %}