FIX blade-ai freeze: remove duplicate poller.js + hidden guards + 30s→60s poll
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
This commit is contained in:
@@ -162,7 +162,7 @@ body{background:var(--bg);color:var(--t1);font-family:var(--font);overflow:hidde
|
||||
</div>
|
||||
<script>
|
||||
async function checkSentinel(){try{const r=await fetch('/api/blade-poll.php?k=BLADE2026&action=status');const d=await r.json();const on=d.heartbeat&&d.heartbeat.ts;document.getElementById('sentinel-dot').style.background=on?'#22c55e':'#ef4444';document.getElementById('sentinel-status').textContent=on?'Sentinel ONLINE v'+(d.heartbeat&&d.heartbeat.agent_version)||'2.0':'Sentinel OFFLINE';document.getElementById('sentinel-install').style.display=on?'none':'inline-block';document.getElementById('sentinel-fix').style.display=on?'none':'inline-block'}catch(e){document.getElementById('sentinel-status').textContent='Sentinel: error'}}
|
||||
checkSentinel();setInterval(checkSentinel,60000);
|
||||
checkSentinel();setInterval(()=>{if(!document.hidden)checkSentinel()},60000);
|
||||
</script>
|
||||
<div class="app"><script>document.addEventListener("visibilitychange",function(){if(document.hidden){window.__bladeHidden=true}else{window.__bladeHidden=false}});</script>
|
||||
<!-- TOPBAR -->
|
||||
@@ -489,7 +489,7 @@ async function loadTasks(){
|
||||
|
||||
async function clearTasks(){await api({action:'clear'});loadTasks();loadStatus()}
|
||||
|
||||
loadStatus();setInterval(loadStatus,60000);
|
||||
loadStatus();setInterval(()=>{if(!document.hidden)loadStatus()},60000);
|
||||
</script>
|
||||
<script>
|
||||
// === UX: Dynamic health bar colors ===
|
||||
@@ -528,7 +528,7 @@ document.querySelectorAll('a[href*="sentinel-agent"]').forEach(function(a) {
|
||||
// WEVIA Task Poller — auto-fetch and execute pending tasks
|
||||
(function(){
|
||||
const API = "/api/blade-poll.php?k=BLADE2026";
|
||||
const POLL_INTERVAL = 30000; // 15 seconds
|
||||
const POLL_INTERVAL = 60000; // 60 seconds
|
||||
|
||||
async function pollAndExecute() {
|
||||
try {
|
||||
@@ -567,7 +567,7 @@ document.querySelectorAll('a[href*="sentinel-agent"]').forEach(function(a) {
|
||||
window.taskPoller = { poll: pollAndExecute };
|
||||
})();
|
||||
</script>
|
||||
<script src="/api/blade-tasks/poller.js?v=1775429494"></script>
|
||||
<!-- poller.js REMOVED: duplicate of pollAndExecute 30s -->
|
||||
|
||||
<script>
|
||||
// WEVIA Auto-upgrade: check server version every 30s
|
||||
@@ -624,7 +624,7 @@ function load(){
|
||||
B.innerHTML=h;
|
||||
});
|
||||
}
|
||||
load();setInterval(load,60000);
|
||||
load();setInterval(()=>{if(!document.hidden)load()},120000);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user