From 60c081c7b1297580cb56cc020832feb8b7ea770a Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 12 Sep 2017 20:05:21 +0200 Subject: [PATCH 1/4] Hide Format button when wrong encryption key is ignored --- plugins/dynamix/ArrayOperation.page | 18 +++++++++++------ plugins/dynamix/include/HideFormatButton.php | 21 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 plugins/dynamix/include/HideFormatButton.php diff --git a/plugins/dynamix/ArrayOperation.page b/plugins/dynamix/ArrayOperation.page index 874b2427c..9db3bf855 100644 --- a/plugins/dynamix/ArrayOperation.page +++ b/plugins/dynamix/ArrayOperation.page @@ -15,6 +15,8 @@ Tag="snowflake-o" */ ?> "; echo ""; @@ -40,9 +42,13 @@ var ask2 = ; var ctrl = ""; function verify(form) { - swal({title:'Found wrong encryption key',text:'Format unmountable disk(s) and ERASE ALL data?',type:'warning',showCancelButton:true},function(){ - $(form).append(''); - form.submit(); + swal({title:'Found wrong encryption key',text:'Format unmountable disk(s) and erase all data?',type:'warning',confirmButtonText:'Format',cancelButtonText:'Ignore',showCancelButton:true},function(p){ + if (p) { + $(form).append(''); + form.submit(); + } else { + $.post('/webGui/include/HideFormatButton.php',{hide:'yes'},function(){refresh();}); + } }); } function tab0() { @@ -80,9 +86,9 @@ function parity_warning(form) { function stop_array(form) { $(form).append(''); if (ask1) { - swal({title:'Proceed?',text:'This will stop the array',type:'warning',showCancelButton:true},function(p){if (p) form.submit(); else $('input[name="cmdStop"]').remove();}); + swal({title:'Proceed?',text:'This will stop the array',type:'warning',showCancelButton:true},function(p){if (p) $.post('/webGui/include/HideFormatButton.php',{hide:'no'},function(){form.submit();}); else $('input[name="cmdStop"]').remove();}); } else { - form.submit(); + $.post('/webGui/include/HideFormatButton.php',{hide:'no'},function(){form.submit();}); } } function stop_parity(form,text) { @@ -144,7 +150,7 @@ toggle_diskio(true); disabled> Stop will take the array off-line.$parity":($mover?"
$mover":"")?> -0):?> +0 && !file_exists($hide)):?> Unmountable disk present:
+ From 29bf35211f12b885d7aad53bed276b407f64fe6f Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 12 Sep 2017 20:24:37 +0200 Subject: [PATCH 2/4] Hide Format button when wrong encryption key is ignored --- plugins/dynamix/ArrayOperation.page | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/ArrayOperation.page b/plugins/dynamix/ArrayOperation.page index 9db3bf855..70cfb480d 100644 --- a/plugins/dynamix/ArrayOperation.page +++ b/plugins/dynamix/ArrayOperation.page @@ -41,13 +41,13 @@ var ask1 = ; var ask2 = ; var ctrl = ""; -function verify(form) { +function verify(form,hide) { swal({title:'Found wrong encryption key',text:'Format unmountable disk(s) and erase all data?',type:'warning',confirmButtonText:'Format',cancelButtonText:'Ignore',showCancelButton:true},function(p){ if (p) { $(form).append(''); form.submit(); } else { - $.post('/webGui/include/HideFormatButton.php',{hide:'yes'},function(){refresh();}); + $.post('/webGui/include/HideFormatButton.php',{hide:hide},function(){refresh();}); } }); } @@ -154,13 +154,14 @@ toggle_diskio(true); Unmountable disk present:
".my_disk($disk['name'])." • ".my_id($disk['id'])." (".$disk['device'].")"; - if (strpos($disk['fsStatus'],'Wrong')!==false) $verify = true; + if (strpos($disk['fsStatus'],'Wrong')!==false) $verify = true; else $yesno = 'no'; } ?> - + From 918dcc94d6711cb07396107dadce60bb3bb16d1e Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 13 Sep 2017 14:21:20 +0200 Subject: [PATCH 3/4] Fixed regression error in DeviceInfo --- plugins/dynamix/DeviceInfo.page | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/dynamix/DeviceInfo.page b/plugins/dynamix/DeviceInfo.page index 52661d0c3..ff161c55f 100644 --- a/plugins/dynamix/DeviceInfo.page +++ b/plugins/dynamix/DeviceInfo.page @@ -215,7 +215,7 @@ btrfs filesystem show: : ".shell_exec("/sbin/btrfs filesystem show {$disk['uuid']}")."";?> - +
Balance Status
@@ -266,7 +266,7 @@ btrfs balance status:
- +
Scrub Status
@@ -308,7 +308,7 @@ btrfs scrub status:
- +
Check Filesystem Status
@@ -356,7 +356,7 @@ btrfs check status:
- +
Check Filesystem Status
@@ -405,7 +405,7 @@ reiserfsck status:
- +
Check Filesystem Status
From 7d3714be38a0806580b609d45fc227fed76571e3 Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 13 Sep 2017 18:06:29 +0200 Subject: [PATCH 4/4] Fixed regression error in DeviceInfo --- plugins/dynamix/DeviceInfo.page | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/DeviceInfo.page b/plugins/dynamix/DeviceInfo.page index ff161c55f..fa43b70f4 100644 --- a/plugins/dynamix/DeviceInfo.page +++ b/plugins/dynamix/DeviceInfo.page @@ -261,7 +261,7 @@ btrfs balance status:   -: **Balance** is only available when array is Started. +: Balance is only available when array is Started." : "See Cache Settings."?> @@ -303,7 +303,7 @@ btrfs scrub status:   -: **Scrub** is only available when array is Started. +: Scrub is only available when array is Started." : "See Cache Settings."?> @@ -351,7 +351,7 @@ btrfs check status:   -: **Check** is only available when array is Started in **Maintenance** mode. +: Check is only available when array is Started in Maintenance mode." : "See Cache Settings."?>