/*** Created by A.J on 2020/2/17.*/$(document).ready(function(){if($("#directly").text() == 1){$.post("remotepackage", {verification:$("#verification").text()}, function(data) {if(data == 'ok'){$("#directlyspan").text($("#tishixinxi2").text());$.upgrading(1);}else{$.shibai();$.alert({title: $('#chucuo').text(),content: data,buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});}});}$("#uploadfile").on("click", function(){$("#tishixinxi").text($("#tishixinxi1").text());$("#file").click();});$("#file").on("change", function() {$("#uploadfile").children("i:last").removeClass("d-none");$("#dbbackupModal").modal();$(this).upload("upgradepackage", {verification:$("#verification").text()}, function(data) {if(data == 'ok'){$("#tishixinxi").text($("#tishixinxi2").text());$.upgrading(0);}else{$("#uploadfile").children("i:last").addClass("d-none");$('#dbbackupModal').modal('hide');$.alert({title: $('#chucuo').text(),content: data,buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});}});});$.extend({'upgrading':function(auto){$.post("upgrading", {verification:$("#verification").text(), auto:auto}, function(data) {$("#uploadfile").children("i:last").addClass("d-none");$('#dbbackupModal').modal('hide');if(data == 'ok'){$("#directlyspan").text($("#upgradeok").text()).prev().removeClass("fa-refresh fa-spin").addClass("fa-check fa-2x");var aobj = $.alert({title: "",content: $('#upgradeok').text(),buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});setTimeout(function(){aobj.close();},2500);}else{$("#directlyspan").text($("#unsuccessful").text()).prev().removeClass("fa-refresh fa-spin").addClass("fa-frown-o fa-2x");if(auto == 1){$.shibai();}$.alert({title: $('#chucuo').text(),content: data,buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});}});}, "shibai": function(){$('#shibai').removeClass("d-none");$('#shougong').removeClass("d-none");}});});