From: Pedro Gonzalez Gomez Date: Thu, 18 May 2023 11:47:16 +0000 (+0200) Subject: mgr/dashboard: fix Nan undefined values and add empty pipe on expand-cluster X-Git-Tag: v18.1.2~81^2~28 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3524be227158f05f406679d409862832f68c7a87;p=ceph-ci.git mgr/dashboard: fix Nan undefined values and add empty pipe on expand-cluster Fixes: https://tracker.ceph.com/issues/61207 Signed-off-by: Pedro Gonzalez Gomez (cherry picked from commit 764a1b67392f09a288a6f38d9d4f89d2a203cf57) --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html index 750fef894fb..a2ae23b2c2b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html @@ -29,12 +29,12 @@ CPUs - {{ totalCPUs }} + {{ totalCPUs | empty }} Memory - {{ totalMemory }} + {{ totalMemory | empty }} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts index a4b6d427b01..790d78d21c1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts @@ -13,6 +13,9 @@ export class FormatterService { if (!_.isNumber(n)) { return '-'; } + if (_.isNaN(n)) { + return 'N/A'; + } let unit = n < 1 ? 0 : Math.floor(Math.log(n) / Math.log(divisor)); unit = unit >= units.length ? units.length - 1 : unit; let result = _.round(n / Math.pow(divisor, unit), decimals).toString();