Skip to content

Commit 2bccefb

Browse files
authored
HDDS-14044. Handle nullish values for Deletion Progress in OM UI (#9625)
1 parent fb097af commit 2bccefb

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ <h2>Meta-Data Volume Information</h2>
9494

9595
<!-- Only display Deletion Progress on OM leader -->
9696
<div ng-show="$ctrl.role.Role.trim() === 'LEADER'">
97-
<h2>Deletion Progress [since {{$ctrl.overview.jmx.MetricsResetTimeStamp * 1000 | date:'yyyy-MM-dd HH:mm:ss'}}]
97+
<h2>Deletion Progress [{{$ctrl.overview.jmx.MetricsResetTimeStamp ? 'since ' + ($ctrl.overview.jmx.MetricsResetTimeStamp * 1000 | date:'yyyy-MM-dd HH:mm:ss') : 'Initializing'}}]
9898
&nbsp;&nbsp;•&nbsp;&nbsp;
9999
<b>Size Reclaimed:</b> {{$ctrl.formatBytes($ctrl.overview.jmx.ReclaimedSizeInInterval)}}
100100
&nbsp;&nbsp;•&nbsp;&nbsp;
101-
<b>Keys Reclaimed:</b> {{$ctrl.overview.jmx.KeysReclaimedInInterval}}
101+
<b>Keys Reclaimed:</b> {{$ctrl.overview.jmx.KeysReclaimedInInterval || 0}}
102102
</h2>
103103
<div class="mt-4">
104104
<div class="mt-3">

hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119

120120
ctrl.formatBytes = function(bytes, decimals) {
121121
if(bytes == 0) return '0 Bytes';
122+
if (!bytes) return 'N/A';
122123
var k = 1024, // or 1024 for binary
123124
dm = decimals + 1 || 3,
124125
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],

0 commit comments

Comments
 (0)