update-auto-update

This commit is contained in:
unknown
2025-12-30 14:21:37 +08:00
parent ca899630b3
commit 3dd86a588b
2 changed files with 22 additions and 12 deletions

View File

@@ -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("更新已完成!")

View File

@@ -1,4 +1,4 @@
var VERSION = "1.10.5.1024" var VERSION = "1.10.5.1230"
require('events').EventEmitter.defaultMaxListeners = 50; require('events').EventEmitter.defaultMaxListeners = 50;
const extract = require('extract-zip') const extract = require('extract-zip')