Skip to content

Commit 633279b

Browse files
authored
Merge pull request ceph#51562 from rhcs-dashboard/fix-nan-undefined-values
mgr/dashboard: fix Nan undefined values and add empty pipe on expand-cluster Reviewed-by: Aashish Sharma <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents a658356 + 764a1b6 commit 633279b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
<tr>
3030
<td i18n
3131
class="bold">CPUs</td>
32-
<td>{{ totalCPUs }}</td>
32+
<td>{{ totalCPUs | empty }}</td>
3333
</tr>
3434
<tr>
3535
<td i18n
3636
class="bold">Memory</td>
37-
<td>{{ totalMemory }}</td>
37+
<td>{{ totalMemory | empty }}</td>
3838
</tr>
3939
</table>
4040
</fieldset>

src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export class FormatterService {
1313
if (!_.isNumber(n)) {
1414
return '-';
1515
}
16+
if (_.isNaN(n)) {
17+
return 'N/A';
18+
}
1619
let unit = n < 1 ? 0 : Math.floor(Math.log(n) / Math.log(divisor));
1720
unit = unit >= units.length ? units.length - 1 : unit;
1821
let result = _.round(n / Math.pow(divisor, unit), decimals).toString();

0 commit comments

Comments
 (0)