release 1.5.3: экран обновления с любой страницы
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4
app.py
4
app.py
@@ -2681,7 +2681,7 @@ def update_hud():
|
||||
fake=Math.min(94,Math.max(fake,6+k*16)+0.6);show(fake,k?ST[k-1][1]+'...':MSG.run)
|
||||
}).catch(function(){sawFail=true;fake=Math.min(96,fake+0.4);show(fake,MSG.restart+'...')})}
|
||||
window.phobosUpdate=function(arg,title){
|
||||
var v=$('jv');v.className='show';$('jlog').textContent='';$('jtitle').innerHTML=title||'P H O B O S // UPDATE';fake=0;show(2,MSG.start);$('jstages').innerHTML='';$('jsub').textContent='PHOBOS';
|
||||
var um=$('upd-modal');if(um)um.style.display='none';var v=$('jv');v.className='show';$('jlog').textContent='';$('jtitle').innerHTML=title||'P H O B O S // UPDATE';fake=0;show(2,MSG.start);$('jstages').innerHTML='';$('jsub').textContent='PHOBOS';
|
||||
fetch('/api/update/start',{method:'POST',credentials:'same-origin',body:new URLSearchParams({arg:arg})}).then(function(r){return r.json()}).then(function(j){
|
||||
if(!j.ok){v.classList.add('err');show(0,MSG.err+': '+j.msg);return}
|
||||
clearInterval(tm);tm=setInterval(poll,1000)}).catch(function(e){v.classList.add('err');show(0,MSG.err)})};
|
||||
@@ -2830,7 +2830,7 @@ def update_banner():
|
||||
def render(content):
|
||||
content = update_banner() + content
|
||||
side, top, cls = _sidebar_topbar()
|
||||
if request.path == "/settings" and session.get("auth"):
|
||||
if session.get("auth") and (request.path == "/settings" or "upd-modal" in content):
|
||||
content = content + update_hud()
|
||||
return PAGE.replace("APPCLS", cls).replace("SIDEBAR", side).replace("TOPBAR", top).replace("CONTENT", content)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user