virtualchassis.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {% extends 'generic/object.html' %}
  2. {% load buttons %}
  3. {% load helpers %}
  4. {% load plugins %}
  5. {% load i18n %}
  6. {% block buttons %}
  7. {% if perms.dcim.change_virtualchassis %}
  8. {% edit_button object %}
  9. {% endif %}
  10. {% if perms.dcim.delete_virtualchassis %}
  11. {% delete_button object %}
  12. {% endif %}
  13. {% endblock %}
  14. {% block content %}
  15. <div class="row">
  16. <div class="col col-12 col-md-4">
  17. <div class="card">
  18. <h2 class="card-header">{% trans "Virtual Chassis" %}</h2>
  19. <table class="table table-hover attr-table">
  20. <tr>
  21. <th scope="row">{% trans "Domain" %}</th>
  22. <td>{{ object.domain|placeholder }}</td>
  23. </tr>
  24. <tr>
  25. <th scope="row">{% trans "Master" %}</th>
  26. <td>{{ object.master|linkify }}</td>
  27. </tr>
  28. <tr>
  29. <th scope="row">{% trans "Description" %}</th>
  30. <td>{{ object.description|placeholder }}</td>
  31. </tr>
  32. <tr>
  33. <th scope="row">Members</th>
  34. <td>
  35. {% if object.member_count %}
  36. <a href="{% url 'dcim:device_list' %}?virtual_chassis_id={{ object.pk }}">{{ object.member_count }}</a>
  37. {% else %}
  38. {{ object.member_count }}
  39. {% endif %}
  40. </td>
  41. </tr>
  42. </table>
  43. </div>
  44. {% include 'inc/panels/tags.html' %}
  45. {% include 'inc/panels/custom_fields.html' %}
  46. {% plugin_left_page object %}
  47. </div>
  48. <div class="col col-12 col-md-8">
  49. <div class="card">
  50. <h2 class="card-header">
  51. {% trans "Members" %}
  52. {% if perms.dcim.change_virtualchassis %}
  53. <div class="card-actions">
  54. <a href="{% url 'dcim:virtualchassis_add_member' pk=object.pk %}?site={{ object.master.site.pk }}&rack={{ object.master.rack.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-ghost-primary btn-sm">
  55. <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Member" %}
  56. </a>
  57. </div>
  58. {% endif %}
  59. </h2>
  60. <table class="table table-hover object-list">
  61. <thead>
  62. <tr>
  63. <th>{% trans "Device" %}</th>
  64. <th>{% trans "Position" %}</th>
  65. <th>{% trans "Master" %}</th>
  66. <th>{% trans "Priority" %}</th>
  67. </tr>
  68. </thead>
  69. {% for vc_member in members %}
  70. <tr{% if vc_member == device %} class="info"{% endif %}>
  71. <td>
  72. {{ vc_member|linkify }}
  73. </td>
  74. <td>
  75. {% badge vc_member.vc_position show_empty=True %}
  76. </td>
  77. <td>
  78. {% if object.master == vc_member %}
  79. {% checkmark True %}
  80. {% endif %}
  81. </td>
  82. <td>
  83. {{ vc_member.vc_priority|placeholder }}
  84. </td>
  85. </tr>
  86. {% endfor %}
  87. </table>
  88. </div>
  89. {% include 'inc/panels/comments.html' %}
  90. {% plugin_right_page object %}
  91. </div>
  92. </div>
  93. <div class="row">
  94. <div class="col col-md-12">
  95. {% plugin_full_width_page object %}
  96. </div>
  97. </div>
  98. {% endblock %}