From 8997e4317b0f5e7c4874c0f8c1d6cfc871192785 Mon Sep 17 00:00:00 2001 From: Laura Flores Date: Thu, 2 Sep 2021 22:09:49 +0000 Subject: [PATCH] mgr/dashboard: improve formatting of histograms in Telemetry preview form Histogram data in the Telemetry dashboard preview is displayed horizontally instead of vertically to improve readability. Fixes: https://tracker.ceph.com/issues/52505 Signed-off-by: Laura Flores --- .../ceph/cluster/telemetry/telemetry.component.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 4e7336a6d56..bee61022e2a 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,9 +88,20 @@ export class TelemetryComponent extends CdForm implements OnInit { this.configForm = this.formBuilder.group(controlsConfig); } + private replacer(key: string, value: any) { + if (key === 'ranges' || key === 'values') { + const x = []; + for (let i = 0; i < value.length; i++) { + x.push(JSON.stringify(value[i])); + } + return x; + } + return value; + } + private createPreviewForm() { const controls = { - report: JSON.stringify(this.report, null, 2), + report: JSON.stringify(this.report, this.replacer, 2), reportId: this.reportId, licenseAgrmt: [this.licenseAgrmt, Validators.requiredTrue] }; -- 2.39.5