Added confirmation question before upgrading unRAID OS

This commit is contained in:
bergware
2018-04-18 07:47:35 +02:00
parent c436a7032b
commit 6a3b3ababf

View File

@@ -177,7 +177,7 @@ function showNotice(data,plugin) {
$('#user-notice').html(data.replace(/<a>(.*)<\/a>/,"<a "+href+">$1</a>"));
}
function showUpgrade(data,plugin) {
var href = "href=\"#\" onclick=\"hideUpgrade();openBox('/plugins/dynamix.plugin.manager/scripts/plugin&arg1=update&arg2="+plugin+".plg','Update Plugin',600,900,true)\"";
var href = "href=\"#\" onclick=\"hideUpgrade();openUpgrade('"+plugin+"')\"";
if ($.cookie('os_upgrade')==null)
$('.upgrade_notice').html(data.replace(/<a(.*)>(.*)<\/a>/,"<a "+href+"$1>$2</a>")+"<i class='fa fa-close' title='Close' onclick='hideUpgrade(true)'></i>").show();
}
@@ -188,6 +188,11 @@ function hideUpgrade(set) {
else
$.removeCookie('os_upgrade',{path:'/'});
}
function openUpgrade(plugin) {
swal({title:'Upgrade unRAID OS',text:'Do you want to download and install the new version?',type:'warning',showCancelButton:true},function(){
openBox('/plugins/dynamix.plugin.manager/scripts/plugin&arg1=update&arg2='+plugin+'.plg','Update Plugin',600,900,true);
});
}
function notifier() {
var tub1 = 0, tub2 = 0, tub3 = 0;
$.post('/webGui/include/Notify.php',{cmd:'get'},function(json) {