@@ -317,7 +317,7 @@ function selectDiskFsWidthZFS(slots,init) {
317317 value: 1,
318318 text: _(sprintf('%s '+label,slots))
319319 }));
320- if (selected_width == 0) selected_width = 1;
320+ selected_width = 1;
321321 } else if ($('#diskFsProfile').val() == 'mirror') {
322322 var width;
323323 for (width=2; width<=Math.min(slots,4); width++) {
@@ -336,17 +336,17 @@ function selectDiskFsWidthZFS(slots,init) {
336336 if ($('#diskFsProfile').val() == 'raidz1') min_width = 2;
337337 else if ($('#diskFsProfile').val() == 'raidz2') min_width = 3;
338338 else if ($('#diskFsProfile').val() == 'raidz3') min_width = 4;
339- for (width=min_width ; width<=slots ; width++ ) {
339+ for (width=slots ; width>=min_width ; width-- ) {
340340 if ((slots % width) == 0) {
341341 var groups = slots / width;
342342 var label = (groups == 1) ? "vdev" : "vdevs";
343343 $('#diskFsWidth').append($('<option>', {
344344 value: width,
345345 text: _(sprintf('%s '+label+' of %s devices',groups,width)),
346346 }));
347- if (selected_width == 0) selected_width = width;
348347 }
349348 }
349+ selected_width = slots;
350350 }
351351 $('#diskFsWidth').val(selected_width);
352352}
@@ -565,7 +565,7 @@ function btrfsScrub(path) {
565565}
566566function btrfsCheck(path) {
567567 $.post('/webGui/include/FileSystemStatus.php',{cmd:'btrfs-check',path:path},function(data) {
568- $('#btrfs-check').text(data);
568+ $('#btrfs-check').text(data.replace(/\0$/, '') );
569569 if (data.slice(-1)!='\0') {
570570 setTimeout(function(){btrfsCheck(path);},1000);
571571 } else {
@@ -615,7 +615,7 @@ function zfsExpansion(path) {
615615}
616616function reiserfsCheck(path) {
617617 $.post('/webGui/include/FileSystemStatus.php',{cmd:'reiserfs-check',path:path},function(data) {
618- $('#reiserfs-check').text(data);
618+ $('#reiserfs-check').text(data.replace(/\0$/, '') );
619619 if (data.slice(-1)!='\0') {
620620 setTimeout(function(){reiserfsCheck(path);},1000);
621621 } else {
@@ -627,7 +627,7 @@ function reiserfsCheck(path) {
627627}
628628function xfsCheck(path) {
629629 $.post('/webGui/include/FileSystemStatus.php',{cmd:'xfs-check',path:path},function(data) {
630- $('#xfs-check').text(data);
630+ $('#xfs-check').text(data.replace(/\0$/, '') );
631631 if (data.slice(-1)!='\0') {
632632 setTimeout(function(){xfsCheck(path);},1000);
633633 } else {
@@ -639,7 +639,7 @@ function xfsCheck(path) {
639639}
640640function extCheck(path) {
641641 $.post('/webGui/include/FileSystemStatus.php',{cmd:'ext-check',path:path},function(data) {
642- $('#ext-check').text(data);
642+ $('#ext-check').text(data.replace(/\0$/, '') );
643643 if (data.slice(-1)!='\0') {
644644 setTimeout(function(){extCheck(path);},1000);
645645 } else {
@@ -651,7 +651,7 @@ function extCheck(path) {
651651}
652652function ntfsCheck(path) {
653653 $.post('/webGui/include/FileSystemStatus.php',{cmd:'ntfs-check',path:path},function(data) {
654- $('#ntfs-check').text(data);
654+ $('#ntfs-check').text(data.replace(/\0$/, '') );
655655 if (data.slice(-1)!='\0') {
656656 setTimeout(function(){ntfsCheck(path);},1000);
657657 } else {
@@ -663,7 +663,7 @@ function ntfsCheck(path) {
663663}
664664function exfatCheck(path) {
665665 $.post('/webGui/include/FileSystemStatus.php',{cmd:'exfat-check',path:path},function(data) {
666- $('#exfat-check').text(data);
666+ $('#exfat-check').text(data.replace(/\0$/, '') );
667667 if (data.slice(-1)!='\0') {
668668 setTimeout(function(){exfatCheck(path);},1000);
669669 } else {
0 commit comments