1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-18 18:51:16 +08:00

update-12.28

This commit is contained in:
github-actions[bot]
2021-12-28 20:32:26 +08:00
parent 3f2643e210
commit f14ef1fbd2
5 changed files with 65 additions and 47 deletions

View File

@ -119,12 +119,23 @@ function check_version() {
if (r.code == 1) {
XHR.poll(1, '<%=url([[admin]], [[services]], [[easyupdate]], [[getlog]])%>', null,(x, r) => {
update_status_message('notice', r.data);
if (r.data.indexOf("Commencing upgrade") > -1 ){
if (r.data.indexOf("Image check failed.") > -1){
XHR.halt()
setTimeout(() => {
location.replace(document.location.origin)
},180000);
update_status_message('warning', r.data);
document.getElementById('update_apply_overlay').addEventListener("click", (e)=>{
update_status_message()
})
}else{
if (r.data.indexOf("Commencing upgrade") > -1 ){
XHR.halt()
setTimeout(() => {
location.replace(document.location.origin)
},180000);
}else{
update_status_message('notice', r.data);
}
}
})
} else {
tb.disabled = false;

View File

@ -68,7 +68,7 @@ function flashFirmware() {
echo 'Get whether to save the configuration(读取是否保存配置)'
keepconfig=$(uci get easyupdate.main.keepconfig)
if [ $keepconfig -eq 1 ]; then
keepconfig=''
keepconfig=' '
res='yes'
else
keepconfig='-n '
@ -76,7 +76,7 @@ function flashFirmware() {
fi
echo "Whether to save the configuration(读取是否保存配置):$res"
echo 'Start flash firmware, log output in /tmp/easyupdate.log(开始刷写固件,日志输出在/tmp/easyupdate.log)'
sysupgrade $keepconfig"/tmp/$file" >/tmp/easyupdate.log 2>&1 &
sysupgrade $keepconfig$file >/tmp/easyupdate.log 2>&1 &
fi
}