This repository was archived by the owner on Oct 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
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
}
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ class Terminal {
108
108
}
109
109
} , 200 ) ;
110
110
} ;
111
- this . socket . onerror = ( e ) => { throw e } ;
111
+ this . socket . onerror = ( e ) => { throw JSON . stringify ( e ) } ;
112
112
113
113
let parent = document . getElementById ( opts . parentId ) ;
114
114
parent . addEventListener ( "wheel" , e => {
You can’t perform that action at this time.
0 commit comments