ipaddress.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {% extends '_base.html' %}
  2. {% load buttons %}
  3. {% load custom_links %}
  4. {% load helpers %}
  5. {% block header %}
  6. <div class="row noprint">
  7. <div class="col-sm-8 col-md-9">
  8. <ol class="breadcrumb">
  9. <li><a href="{% url 'ipam:ipaddress_list' %}">IP Addresses</a></li>
  10. {% if ipaddress.vrf %}
  11. <li><a href="{% url 'ipam:vrf' pk=ipaddress.vrf.pk %}">{{ ipaddress.vrf }}</a></li>
  12. {% endif %}
  13. <li>{{ ipaddress }}</li>
  14. </ol>
  15. </div>
  16. <div class="col-sm-4 col-md-3">
  17. <form action="{% url 'ipam:ipaddress_list' %}" method="get">
  18. <div class="input-group">
  19. <input type="text" name="q" class="form-control" placeholder="Search IPs" />
  20. <span class="input-group-btn">
  21. <button type="submit" class="btn btn-primary">
  22. <span class="fa fa-search" aria-hidden="true"></span>
  23. </button>
  24. </span>
  25. </div>
  26. </form>
  27. </div>
  28. </div>
  29. <div class="pull-right noprint">
  30. {% if perms.ipam.add_ipaddress %}
  31. {% clone_button ipaddress %}
  32. {% endif %}
  33. {% if perms.ipam.change_ipaddress %}
  34. {%edit_button ipaddress %}
  35. {% endif %}
  36. {% if perms.ipam.delete_ipaddress %}
  37. {% delete_button ipaddress %}
  38. {% endif %}
  39. </div>
  40. <h1>{% block title %}{{ ipaddress }}{% endblock %}</h1>
  41. {% include 'inc/created_updated.html' with obj=ipaddress %}
  42. <div class="pull-right noprint">
  43. {% custom_links ipaddress %}
  44. </div>
  45. <ul class="nav nav-tabs">
  46. <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
  47. <a href="{{ ipaddress.get_absolute_url }}">IP Address</a>
  48. </li>
  49. {% if perms.extras.view_objectchange %}
  50. <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
  51. <a href="{% url 'ipam:ipaddress_changelog' pk=ipaddress.pk %}">Changelog</a>
  52. </li>
  53. {% endif %}
  54. </ul>
  55. {% endblock %}
  56. {% block content %}
  57. <div class="row">
  58. <div class="col-md-4">
  59. <div class="panel panel-default">
  60. <div class="panel-heading">
  61. <strong>IP Address</strong>
  62. </div>
  63. <table class="table table-hover panel-body attr-table">
  64. <tr>
  65. <td>Family</td>
  66. <td>IPv{{ ipaddress.family }}</td>
  67. </tr>
  68. <tr>
  69. <td>VRF</td>
  70. <td>
  71. {% if ipaddress.vrf %}
  72. <a href="{% url 'ipam:vrf' pk=ipaddress.vrf.pk %}">{{ ipaddress.vrf }}</a>
  73. {% else %}
  74. <span>Global</span>
  75. {% endif %}
  76. </td>
  77. </tr>
  78. <tr>
  79. <td>Tenant</td>
  80. <td>
  81. {% if ipaddress.tenant %}
  82. {% if ipaddress.tenant.group %}
  83. <a href="{{ ipaddress.tenant.group.get_absolute_url }}">{{ ipaddress.tenant.group }}</a>
  84. <i class="fa fa-angle-right"></i>
  85. {% endif %}
  86. <a href="{{ ipaddress.tenant.get_absolute_url }}">{{ ipaddress.tenant }}</a>
  87. {% else %}
  88. <span class="text-muted">None</span>
  89. {% endif %}
  90. </td>
  91. </tr>
  92. <tr>
  93. <td>Status</td>
  94. <td>
  95. <span class="label label-{{ ipaddress.get_status_class }}">{{ ipaddress.get_status_display }}</span>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td>Role</td>
  100. <td>
  101. {% if ipaddress.role %}
  102. <a href="{% url 'ipam:ipaddress_list' %}?role={{ ipaddress.role }}">{{ ipaddress.get_role_display }}</a>
  103. {% else %}
  104. <span class="text-muted">None</span>
  105. {% endif %}
  106. </td>
  107. </tr>
  108. <tr>
  109. <td>DNS Name</td>
  110. <td>{{ ipaddress.dns_name|placeholder }}</td>
  111. </tr>
  112. <tr>
  113. <td>Description</td>
  114. <td>{{ ipaddress.description|placeholder }}</td>
  115. </tr>
  116. <tr>
  117. <td>Assignment</td>
  118. <td>
  119. {% if ipaddress.interface %}
  120. <span><a href="{{ ipaddress.interface.parent.get_absolute_url }}">{{ ipaddress.interface.parent }}</a> ({{ ipaddress.interface }})</span>
  121. {% else %}
  122. <span class="text-muted">&mdash;</span>
  123. {% endif %}
  124. </td>
  125. </tr>
  126. <tr>
  127. <td>NAT (inside)</td>
  128. <td>
  129. {% if ipaddress.nat_inside %}
  130. <a href="{% url 'ipam:ipaddress' pk=ipaddress.nat_inside.pk %}">{{ ipaddress.nat_inside }}</a>
  131. {% if ipaddress.nat_inside.interface %}
  132. (<a href="{{ ipaddress.nat_inside.interface.parent.get_absolute_url }}">{{ ipaddress.nat_inside.interface.parent }}</a>)
  133. {% endif %}
  134. {% else %}
  135. <span class="text-muted">None</span>
  136. {% endif %}
  137. </td>
  138. </tr>
  139. <tr>
  140. <td>NAT (outside)</td>
  141. <td>
  142. {% if ipaddress.nat_outside %}
  143. <a href="{% url 'ipam:ipaddress' pk=ipaddress.nat_outside.pk %}">{{ ipaddress.nat_outside }}</a>
  144. {% else %}
  145. <span class="text-muted">None</span>
  146. {% endif %}
  147. </td>
  148. </tr>
  149. </table>
  150. </div>
  151. {% include 'inc/custom_fields_panel.html' with obj=ipaddress %}
  152. {% include 'extras/inc/tags_panel.html' with tags=ipaddress.tags.all url='ipam:ipaddress_list' %}
  153. </div>
  154. <div class="col-md-8">
  155. {% include 'panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
  156. {% if duplicate_ips_table.rows %}
  157. {% include 'panel_table.html' with table=duplicate_ips_table heading='Duplicate IP Addresses' panel_class='danger' %}
  158. {% endif %}
  159. {% include 'utilities/obj_table.html' with table=related_ips_table table_template='panel_table.html' heading='Related IP Addresses' panel_class='default noprint' %}
  160. </div>
  161. </div>
  162. {% endblock %}