From: Laura Flores Date: Wed, 22 Sep 2021 19:29:11 +0000 (+0000) Subject: mgr/dashboard: clarify comment and variable name X-Git-Tag: v17.1.0~818^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f7d6642f5e44ccc32225ac8ef22dc742164eab78;p=ceph-ci.git mgr/dashboard: clarify comment and variable name Signed-off-by: Laura Flores --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts index 17bec010cb7..2f5a07bf009 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts @@ -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;