]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: clarify comment and variable name
authorLaura Flores <lflores@redhat.com>
Wed, 22 Sep 2021 19:29:11 +0000 (19:29 +0000)
committerLaura Flores <lflores@redhat.com>
Wed, 22 Sep 2021 19:29:11 +0000 (19:29 +0000)
Signed-off-by: Laura Flores <lflores@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts

index 17bec010cb75c76b15593590613104a7c1af82cd..2f5a07bf009959a69934de9d0a08d0bce4955faf 100644 (file)
@@ -88,18 +88,15 @@ export class TelemetryComponent extends CdForm implements OnInit {
     this.configForm = this.formBuilder.group(controlsConfig);
   }
 
-  // Helper function used in createPreviewForm to display the ranges and values of `osd_perf_histograms`
-  // horizontally instead of vertically.
   private replacer(key: string, value: any) {
-    // Detect either the 'ranges' or 'values' 2D array (arr_2d), both of which
-    // need to be displayed horizontally. This will be done by converting the inner arrays
-    // of the 2D array into strings.
+    // Display the arrays of keys 'ranges' and 'values' horizontally as they take up too much space
+    // and Stringify displays it in vertical by default.
     if ((key === 'ranges' || key === 'values') && Array.isArray(value)) {
-      const arr_2d = [];
+      const elements = [];
       for (let i = 0; i < value.length; i++) {
-        arr_2d.push(JSON.stringify(value[i]));
+        elements.push(JSON.stringify(value[i]));
       }
-      return arr_2d;
+      return elements;
     }
     // Else, just return the value as is, without any formatting.
     return value;