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

Fixes #4914: Fix toggling cable status under device view

Jeremy Stretch 5 лет назад
Родитель
Сommit
d1a505d07f

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -6,6 +6,7 @@
 
 * [#4905](https://github.com/netbox-community/netbox/issues/4905) - Fix front port count on device type view
 * [#4912](https://github.com/netbox-community/netbox/issues/4912) - Fix image attachment API endpoint
+* [#4914](https://github.com/netbox-community/netbox/issues/4914) - Fix toggling cable status under device view
 
 ---
 

+ 4 - 2
netbox/templates/dcim/cable.html

@@ -49,11 +49,13 @@
                 <table class="table table-hover panel-body attr-table">
                     <tr>
                         <td>Type</td>
-                        <td>{{ cable.get_type_display }}</td>
+                        <td>{{ cable.get_type_display|placeholder }}</td>
                     </tr>
                     <tr>
                         <td>Status</td>
-                        <td>{{ cable.get_status_display }}</td>
+                        <td>
+                            <span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span>
+                        </td>
                     </tr>
                     <tr>
                         <td>Label</td>

+ 2 - 2
netbox/templates/dcim/device.html

@@ -975,7 +975,7 @@ function toggleConnection(elem) {
                 xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
             },
             data: {
-                'status': 'False'
+                'status': 'planned'
             },
             context: this,
             success: function() {
@@ -994,7 +994,7 @@ function toggleConnection(elem) {
                 xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
             },
             data: {
-                'status': 'True'
+                'status': 'connected'
             },
             context: this,
             success: function() {