@@ -278,6 +278,12 @@ function selectDiskFsProfileEXT() {
278278 $('#diskFsProfile').val('');
279279 setDiskFsWidth(1);
280280}
281+ function selectDiskFsProfileNTFS() {
282+ $('#diskFsProfile').empty();
283+ $('#diskFsProfile').append($('<option>', {value: '', text:''}));
284+ $('#diskFsProfile').val('');
285+ setDiskFsWidth(1);
286+ }
281287function selectDiskFsProfileBTRFS(slots,init) {
282288 $('#diskFsProfile').empty();
283289 $('#diskFsProfile').append($('<option>', {value: 'single', text:_('single')}));
@@ -407,9 +413,11 @@ function selectDiskFsProfile(init) {
407413 selectDiskFsProfileXFS();
408414 } else if (fsType.indexOf('ext') != -1) {
409415 selectDiskFsProfileEXT();
416+ } else if (fsType.indexOf('ntfs') != -1) {
417+ selectDiskFsProfileNTFS();
410418 }
411419
412- if (subpool != '' || fsType == 'auto' || fsType.indexOf('xfs') != -1 || fsType.indexOf('ext') != -1) {
420+ if (subpool != '' || fsType == 'auto' || fsType.indexOf('xfs') != -1 || fsType.indexOf('ext') != -1 || fsType.indexOf('ntfs') != -1 ) {
413421 $('#compression').hide(t);
414422 $('#diskCompression').prop('disabled',true);
415423 } else {
@@ -586,7 +594,7 @@ function zfsResilver(path) {
586594}
587595function zfsExpansion(path) {
588596 $.post('/webGui/include/FileSystemStatus.php',{cmd:'zfs-expansion',path:path},function(data) {
589- if (data.indexOf(' expansion')>0 && data.indexOf(' in progress')>0 ) {
597+ if (/ expansion of \S+ in progress/.test(data) ) {
590598 $('#zfs-button').prop('disabled',true);
591599 $('#zfs-pool').text(data);
592600 setTimeout(function(){zfsExpansion(path);},1000);
@@ -633,6 +641,18 @@ function extCheck(path) {
633641 });
634642 return false;
635643}
644+ function ntfsCheck(path) {
645+ $.post('/webGui/include/FileSystemStatus.php',{cmd:'ntfs-check',path:path},function(data) {
646+ $('#ntfs-check').text(data);
647+ if (data.slice(-1)!='\0') {
648+ setTimeout(function(){ntfsCheck(path);},1000);
649+ } else {
650+ $.removeCookie('ntfs-check-<?=$tag?>');
651+ refresh();
652+ }
653+ });
654+ return false;
655+ }
636656function updateMode(form,mode) {
637657 $(form).find('input[name="#arg[3]"]').val(mode);
638658}
@@ -850,6 +870,7 @@ _(File system type)_:
850870 <?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "ext4", _('ext4'))?>
851871 <?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "ext3", _('ext3'), "disabled")?>
852872 <?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "ext2", _('ext2'), "disabled")?>
873+ <?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "ntfs", _('ntfs'))?>
853874 <?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "reiserfs", _('reiserfs'), "disabled")?>
854875 <?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "luks:xfs", _('xfs')." - "._('encrypted'))?>
855876 <?=mk_option(_var($disk, 'fsType'), "luks:zfs", _('zfs')." - "._('encrypted'))?>
@@ -1543,6 +1564,106 @@ _(xfs_repair status)_:
15431564<?endif;?>
15441565<?else:?>
15451566
1567+
1568+ : <span class="inline-block">
1569+ <input type="submit" value="_(Check)_" disabled>
1570+ <span>**_(Check)_** _(is only available when array is Started in **Maintenance** mode)_.
1571+ </span>
1572+
1573+ <?endif;?>
1574+ </form>
1575+ <?endif;?>
1576+ <?if (fsType('ntfs')):?>
1577+ <div class="title nocontrol">
1578+ <span class="left">
1579+ <i class="title fa fa-shield"></i>_(Check Filesystem Status)_
1580+ </span>
1581+ </div>
1582+ <form markdown="1" method="POST" action="/update.php" target="progressFrame" onsubmit="prepareFS(this,'ntfs-check-<?=$tag?>','/dev/<?=_var($disk, 'deviceSb')?> <?=_var($disk, 'id')?>')">
1583+ <?if (maintenance_mode()):?>
1584+ <?exec("$docroot/webGui/scripts/ntfs_check status /dev/"._var($disk,'deviceSb')." "._var($disk,'id'), $check_status, $retval)?>
1585+
1586+ _(ntfsfix_ status)_:
1587+ : <pre id='ntfs-check'><?=implode("\n", $check_status)?></pre>
1588+
1589+ <?if ($retval == 0 || $retval == 8):?>
1590+ <input type="hidden" name="#command" value="/webGui/scripts/ntfs_check">
1591+ <input type="hidden" name="#arg[1]" value="start">
1592+ <input type="hidden" name="#arg[2]" value="/dev/<?=_var($disk, 'deviceSb')?>">
1593+ <input type="hidden" name="#arg[3]" value="<?=_var($disk, 'id')?>">
1594+ <input type="hidden" name="#arg[4]" value="-d">
1595+
1596+
1597+ : <span class="buttons-spaced">
1598+ <input type="submit" value="_(Check)_">
1599+ <?if ($retval == 0): ?> _(No file system corruption detected)_.<?endif; ?>
1600+ </span>
1601+
1602+ :info_ntfs_check_help:
1603+
1604+ <?elseif ($retval == 1):?>
1605+ <input type="hidden" name="#command" value="/webGui/scripts/ntfs_check">
1606+ <input type="hidden" name="#arg[1]" value="start">
1607+ <input type="hidden" name="#arg[2]" value="/dev/<?=_var($disk, 'deviceSb')?>">
1608+ <input type="hidden" name="#arg[3]" value="<?=_var($disk, 'id')?>">
1609+ <input type="hidden" name="#arg[4]" value="-e">
1610+
1611+
1612+ : <span class="buttons-spaced">
1613+ <input type="submit" value="_(Fix)_">
1614+ <span style="color: red;">_(File system corruption detected)_.</span>
1615+ </span>
1616+
1617+ :info_ntfs_check_help:
1618+
1619+ <?elseif ($retval == 2):?>
1620+ <input type="hidden" name="#command" value="/webGui/scripts/ntfs_check">
1621+ <input type="hidden" name="#arg[1]" value="start">
1622+ <input type="hidden" name="#arg[2]" value="/dev/<?=_var($disk, 'deviceSb')?>">
1623+ <input type="hidden" name="#arg[3]" value="<?=_var($disk, 'id')?>">
1624+ <input type="hidden" name="#arg[4]" value="-eL">
1625+
1626+
1627+ : <span class="buttons-spaced">
1628+ <input type="submit" value="_(Zero Log)_">
1629+ <span style="color: red;">_(Dirty log detected)_.</span>
1630+ </span>
1631+
1632+ <p>_(Note)_: _(While there is some risk, if it is not possible to first mount the filesystem to clear the log, zeroing it is the only option to try and repair the filesystem, and in most cases it results in little or no data loss)_.</p>
1633+
1634+ :info_ntfs_check_help:
1635+
1636+ <?elseif ($retval == 4):?>
1637+ <input type="hidden" name="#command" value="/webGui/scripts/ntfs_check">
1638+ <input type="hidden" name="#arg[1]" value="start">
1639+ <input type="hidden" name="#arg[2]" value="/dev/<?=_var($disk, 'deviceSb')?>">
1640+ <input type="hidden" name="#arg[3]" value="<?=_var($disk, 'id')?>">
1641+ <input type="hidden" name="#arg[4]" value="-n">
1642+
1643+
1644+ : <span class="buttons-spaced">
1645+ <input type="submit" value="_(Check)_">
1646+ _(File system corruption fixed)_
1647+ </span>
1648+
1649+ :info_ntfs_check_help:
1650+
1651+ <?elseif ($retval == 9):?>
1652+ <input type="hidden" name="#command" value="/webGui/scripts/ntfs_check">
1653+ <input type="hidden" name="#arg[1]" value="cancel">
1654+ <input type="hidden" name="#arg[2]" value="/dev/<?=_var($disk, 'deviceSb')?>">
1655+
1656+
1657+ : <span class="buttons-spaced">
1658+ <input type="submit" value="_(Cancel)_">
1659+ *_(Running)_*
1660+ </span>
1661+
1662+ :info_ntfs_cancel_help:
1663+
1664+ <?endif;?>
1665+ <?else:?>
1666+
15461667
15471668: <span class="inline-block">
15481669 <input type="submit" value="_(Check)_" disabled>
@@ -1797,6 +1918,7 @@ $(function() {
17971918 if ($.cookie('zfs-expansion-<?=$tag?>')) status = zfsExpansion($.cookie('zfs-expansion-<?=$tag?>'));
17981919 if ($.cookie('rfs-check-<?=$tag?>')) status = rfsCheck($.cookie('rfs-check-<?=$tag?>'));
17991920 if ($.cookie('xfs-check-<?=$tag?>')) status = xfsCheck($.cookie('xfs-check-<?=$tag?>'));
1921+ if ($.cookie('ntfs-check-<?=$tag?>')) status = ntfsCheck($.cookie('ntfs-check-<?=$tag?>'));
18001922 if ($.cookie('ext-check-<?=$tag?>')) status = extCheck($.cookie('ext-check-<?=$tag?>'));
18011923 if (status) {
18021924 $.post('/webGui/include/FileSystemStatus.php',{cmd:'status',path:'<?=$tag?>'},function(a){
0 commit comments