update-auto-update
This commit is contained in:
@@ -454,14 +454,25 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(configs)
|
console.log(configs)
|
||||||
$.get('/saveAndRestart',{'configs':JSON.stringify(configs,null,2)},function(res){
|
// 改为ajax, 超时设置为60s
|
||||||
if(res=="1")
|
$.ajax({
|
||||||
{
|
url: '/saveAndRestart',
|
||||||
showtext('保存成功, 正在重新启动服务器。')
|
type: 'GET',
|
||||||
}
|
data: {'configs':JSON.stringify(configs,null,2)},
|
||||||
else
|
timeout: 60000,
|
||||||
|
success: function(res){
|
||||||
|
if(res=="1")
|
||||||
|
{
|
||||||
|
showtext('保存成功, 正在重新启动服务器。')
|
||||||
|
}
|
||||||
|
else
|
||||||
|
showtext('保存失败')
|
||||||
|
modald.close()
|
||||||
|
},
|
||||||
|
error: function(res){
|
||||||
|
modald.close()
|
||||||
showtext('保存失败')
|
showtext('保存失败')
|
||||||
modald.close()
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
var stopServer = function(){
|
var stopServer = function(){
|
||||||
@@ -534,15 +545,14 @@
|
|||||||
add_text(`解压中...`)
|
add_text(`解压中...`)
|
||||||
}
|
}
|
||||||
else if (data.type === 'complete') {
|
else if (data.type === 'complete') {
|
||||||
add_text(`${data.version}更新完成!`);
|
|
||||||
eventSource.close();
|
eventSource.close();
|
||||||
if(data.version == "mixio"){
|
if(data.version == "mixio"){
|
||||||
|
add_text(`${data.version}解压完成,等待系统清理缓存,大约需要30秒...`);
|
||||||
setTimeout(
|
setTimeout(
|
||||||
function(){
|
function(){
|
||||||
window.location.reload()
|
alert("更新已完成,请务必手动重启MIXIO服务,请务必手动重启MIXIO服务,如果是支持自动启动,那么请直接重启服务器机器即可!!!")
|
||||||
}
|
}
|
||||||
, 10000)
|
, 30000)
|
||||||
alert("更新已完成,请务必手动重启MIXIO服务,请务必手动重启MIXIO服务,如果是支持自动启动,那么请直接重启服务器机器即可!!!")
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alert("更新已完成!")
|
alert("更新已完成!")
|
||||||
|
|||||||
Reference in New Issue
Block a user