Просмотр исходного кода

Adds dimensions card to device view (#12509)

* adds dimensions card to device view #12286

* Update netbox/templates/dcim/device.html

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
Abhimanyu Saharan 2 лет назад
Родитель
Сommit
259d0e96f2
1 измененных файлов с 23 добавлено и 0 удалено
  1. 23 0
      netbox/templates/dcim/device.html

+ 23 - 0
netbox/templates/dcim/device.html

@@ -300,6 +300,29 @@
             </div>
             {% include 'inc/panels/contacts.html' %}
             {% include 'inc/panels/image_attachments.html' %}
+            <div class="card">
+                <h5 class="card-header">Dimensions</h5>
+                <div class="card-body table-responsive">
+                    <table class="table table-hover attr-table">
+                        <tr>
+                            <th scope="row">Height</th>
+                            <td>
+                                {{ object.device_type.u_height }}U
+                            </td>
+                        </tr>
+                        <tr>
+                            <th scope="row">Weight</th>
+                            <td>
+                                {% if object.device_type.weight %}
+                                    {{ object.device_type.weight|floatformat }} {{ object.device_type.get_weight_unit_display }}
+                                {% else %}
+                                    {{ ''|placeholder }}
+                                {% endif %}
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
             {% if object.rack and object.position %}
               <div class="row" style="margin-bottom: 20px">
                 <div class="col col-md-6 col-sm-6 col-xs-12 text-center">