vlan.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {% extends 'ipam/vlan/base.html' %}
  2. {% load helpers %}
  3. {% load render_table from django_tables2 %}
  4. {% load plugins %}
  5. {% block content %}
  6. <div class="row">
  7. <div class="col col-md-6">
  8. <div class="card">
  9. <h5 class="card-header">
  10. VLAN
  11. </h5>
  12. <div class="card-body">
  13. <table class="table table-hover attr-table">
  14. <tr>
  15. <th scope="row">Site</th>
  16. <td>
  17. {% if object.site %}
  18. {% if object.site.region %}
  19. <a href="{{ object.site.region.get_absolute_url }}">{{ object.site.region }}</a> /
  20. {% endif %}
  21. <a href="{{ object.site.get_absolute_url }}">{{ object.site }}</a>
  22. {% else %}
  23. <span class="text-muted">None</span>
  24. {% endif %}
  25. </td>
  26. </tr>
  27. <tr>
  28. <th scope="row">Group</th>
  29. <td>
  30. {% if object.group %}
  31. <a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
  32. {% else %}
  33. <span class="text-muted">None</span>
  34. {% endif %}
  35. </td>
  36. </tr>
  37. <tr>
  38. <th scope="row">VLAN ID</th>
  39. <td>{{ object.vid }}</td>
  40. </tr>
  41. <tr>
  42. <th scope="row">Name</th>
  43. <td>{{ object.name }}</td>
  44. </tr>
  45. <tr>
  46. <th scope="row">Tenant</th>
  47. <td>
  48. {% if object.tenant %}
  49. {% if object.tenant.group %}
  50. <a href="{{ object.tenant.group.get_absolute_url }}">{{ object.tenant.group }}</a> /
  51. {% endif %}
  52. <a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
  53. {% else %}
  54. <span class="text-muted">None</span>
  55. {% endif %}
  56. </td>
  57. </tr>
  58. <tr>
  59. <th scope="row">Status</th>
  60. <td>
  61. <span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
  62. </td>
  63. </tr>
  64. <tr>
  65. <th scope="row">Role</th>
  66. <td>
  67. {% if object.role %}
  68. <a href="{% url 'ipam:vlan_list' %}?role={{ object.role.slug }}">{{ object.role }}</a>
  69. {% else %}
  70. <span class="text-muted">None</span>
  71. {% endif %}
  72. </td>
  73. </tr>
  74. <tr>
  75. <th scope="row">Description</th>
  76. <td>{{ object.description|placeholder }}</td>
  77. </tr>
  78. </table>
  79. </div>
  80. </div>
  81. {% plugin_left_page object %}
  82. </div>
  83. <div class="col col-md-6">
  84. {% include 'inc/panels/custom_fields.html' %}
  85. {% include 'inc/panels/tags.html' %}
  86. {% plugin_right_page object %}
  87. </div>
  88. </div>
  89. <div class="row">
  90. <div class="col col-md-12">
  91. <div class="card">
  92. <h5 class="card-header">
  93. Prefixes
  94. </h5>
  95. <div class="card-body table-responsive">
  96. {% render_table prefix_table 'inc/table.html' %}
  97. </div>
  98. {% if perms.ipam.add_prefix %}
  99. <div class="card-footer text-end noprint">
  100. <a href="{% url 'ipam:prefix_add' %}?{% if object.tenant %}tenant={{ object.tenant.pk }}&{% endif %}site={{ object.site.pk }}&vlan={{ object.pk }}" class="btn btn-primary btn-sm">
  101. <i class="mdi mdi-plus-thick" aria-hidden="true"></i>
  102. Add a Prefix
  103. </a>
  104. </div>
  105. {% endif %}
  106. </div>
  107. {% plugin_full_width_page object %}
  108. </div>
  109. </div>
  110. {% endblock %}