This repository was archived by the owner on Oct 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -265,9 +265,20 @@ class FilesystemDisplay {
265
265
</div>` ;
266
266
} ) ;
267
267
this . filesContainer . innerHTML = filesDOM ;
268
-
269
- this . space_bar . text . innerHTML = `Mount <strong>${ this . fsBlock . mount } </strong> used <strong>${ Math . round ( this . fsBlock . use ) } %</strong>` ;
270
- this . space_bar . bar . value = Math . round ( this . fsBlock . use ) ;
268
+
269
+ // See #226
270
+ if ( ! isNaN ( this . fsBlock . use ) ) {
271
+ this . space_bar . text . innerHTML = `Mount <strong>${ this . fsBlock . mount } </strong> used <strong>${ Math . round ( this . fsBlock . use ) } %</strong>` ;
272
+ this . space_bar . bar . value = Math . round ( this . fsBlock . use ) ;
273
+ } else if ( ! isNaN ( ( this . fsBlock . size / this . fsBlock . used ) * 100 ) ) {
274
+ let usage = Math . round ( this . fsBlock . size / this . fsBlock . used ) * 100 ) ;
275
+
276
+ this . space_bar . text . innerHTML = `Mount <strong>${ this . fsBlock . mount } </strong> used <strong>${ usage } %</strong>` ;
277
+ this . space_bar . bar . value = usage ;
278
+ } else {
279
+ this . space_bar . text . innerHTML = `Could not calculate mountpoint usage.` ;
280
+ this . space_bar . bar . value = 100 ;
281
+ }
271
282
} ;
272
283
}
273
284
}
You can’t perform that action at this time.
0 commit comments