From bdf04ee8a3f39a3bd6e63215fdb043f70bf26810 Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 7 Feb 2023 00:13:30 +0100 Subject: [PATCH] DeviceInfo: Confirm by typing pool name + Show error message when confirmation is wrong --- plugins/dynamix/DeviceInfo.page | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/DeviceInfo.page b/plugins/dynamix/DeviceInfo.page index 7069136c0..1852e7563 100644 --- a/plugins/dynamix/DeviceInfo.page +++ b/plugins/dynamix/DeviceInfo.page @@ -23,7 +23,6 @@ $dev = $disk['device']??''; $disk['id'] = $disk['id']??''; $events = explode('|',$disk['smEvents'] ?? $var['smEvents'] ?? $numbers); $bgcolor = in_array($display['theme'],['white','azure']) ? '#f2f2f2' : '#1c1c1c'; -$yes = _('Yes'); $mode = ['Disabled','Hourly','Daily','Weekly','Monthly']; $days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; @@ -385,12 +384,18 @@ function eraseDisk(name) { text:"

_(Existing content is permanently lost)_

", html:true, type:'input', - inputPlaceholder:"", + inputPlaceholder:"", showCancelButton:true, + closeOnConfirm:false, confirmButtonText:"_(Proceed)_", cancelButtonText:"_(Cancel)_"}, function(confirm) { - if (confirm === "") {$.get("/update.htm",{cmdWipefs:name,csrf_token:""},function(){refresh();});} + if (confirm == "") { + swal.close(); + $.get("/update.htm",{cmdWipefs:name,csrf_token:""},function(){refresh();}); + } else { + if (confirm.length) swal({title:"_(Incorrect confirmation)_",text:"_(Please try again)_!",type:'error',html:true,confirmButtonText:"_(Ok)_"}); + } }); } function freeSpace(val) {