diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f67b8c..a8e5453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ ## Changelog +### v0.126.4 — edge-safe error statuses + the native-alert ban (2026-07-13) + +Two defects surfaced by the agent-0.87.0 wizard leg's decommission attempt (the M1 refusal — +correct policy — reached the operator as a JSON SyntaxError popup): + +- **502/504 never leave the origin:** Cloudflare replaces origin 502/504 bodies with its own + HTML error page, so every `writeDiskJSON(StatusBadGateway…)` refusal/error rendered as + "Csatlakoztatás'; } }).catch(function(e) { - alert('Hiba: ' + e); + showAlert('Hiba: ' + e); if (actionsDiv) actionsDiv.innerHTML = ''; }); } @@ -564,12 +564,12 @@ function storageRestartApps(path) { }).then(function(r) { return r.json(); }).then(function(data) { if (data.ok) { var r2 = data.restarted || []; - if (r2.length) alert('Elindítva: ' + r2.join(', ')); + if (r2.length) showAlert('Elindítva: ' + r2.join(', ')); location.reload(); } else { - alert('Hiba: ' + (data.error || 'ismeretlen')); + showAlert('Hiba: ' + (data.error || 'ismeretlen')); } - }).catch(function(e) { alert('Hiba: ' + e); }); + }).catch(function(e) { showAlert('Hiba: ' + e); }); } // H2: decommission a drive (non-destructive). If a migrate target is picked in the inline select → // migrate-then-decommission; otherwise decommission-anyway with type-to-confirm. @@ -594,9 +594,9 @@ function doStorageDecommission(body) { headers: Object.assign({'Content-Type': 'application/json'}, csrfHeaders()), body: JSON.stringify(body) }).then(function(r) { return r.json(); }).then(function(data) { - if (data.ok) { alert('Leszerelés elindítva.'); location.reload(); } - else { alert('Hiba: ' + (data.error || 'ismeretlen')); } - }).catch(function(e) { alert('Hiba: ' + e); }); + if (data.ok) { showAlert('Leszerelés elindítva.'); location.reload(); } + else { showAlert('Hiba: ' + (data.error || 'ismeretlen')); } + }).catch(function(e) { showAlert('Hiba: ' + e); }); } // H3: one-click re-enroll a decommissioned/ejected drive — clears the marker, re-attaches under the // parent, restarts the gate-stopped apps (data is intact). @@ -612,8 +612,8 @@ function doStorageReEnroll(path) { body: JSON.stringify({where: path}) }).then(function(r) { return r.json(); }).then(function(data) { if (data.ok) { location.reload(); } - else { alert('Hiba: ' + (data.error || 'ismeretlen')); } - }).catch(function(e) { alert('Hiba: ' + e); }); + else { showAlert('Hiba: ' + (data.error || 'ismeretlen')); } + }).catch(function(e) { showAlert('Hiba: ' + e); }); } function cancelEditLabel(path, label) { var wrap = document.getElementById('label-wrap-' + path); diff --git a/controller/internal/web/templates/storage_network.html b/controller/internal/web/templates/storage_network.html index 907bf9f..2730c9a 100644 --- a/controller/internal/web/templates/storage_network.html +++ b/controller/internal/web/templates/storage_network.html @@ -218,8 +218,8 @@ function netStorageRemove(name,label){ onConfirm:function(){ fetch('/api/storage/netstorage/remove',{method:'POST',headers:Object.assign({'Content-Type':'application/json'},csrfHeaders()),body:JSON.stringify({name:name})}) .then(function(r){return r.json();}).then(function(d){ - if(d.ok){ location.reload(); } else { alert('Hiba: '+(d.error||'ismeretlen')); } - }).catch(function(e){ alert('Hiba: '+e); }); + if(d.ok){ location.reload(); } else { showAlert('Hiba: '+(d.error||'ismeretlen')); } + }).catch(function(e){ showAlert('Hiba: '+e); }); }}); } if(document.getElementById('ns-add-form')){ nsToggleSmb(); nsUpdateHostID(); } // form absent on the capability banner diff --git a/controller/scripts/native_confirm_gate.py b/controller/scripts/native_confirm_gate.py index 3e2de5c..a18ce2e 100644 --- a/controller/scripts/native_confirm_gate.py +++ b/controller/scripts/native_confirm_gate.py @@ -1,10 +1,13 @@ # -*- coding: utf-8 -*- -"""Native-confirm gate (drill F-11) — native confirm()/prompt() dialogs are OS-modals that block -browser automation (CDP freezes) and are banned from the UI; consequential actions use the inline -felhomConfirm helper (layout.html) or the .confirm-overlay dialog. +"""Native-confirm gate (drill F-11; alert added v0.126.4) — native confirm()/prompt()/alert() +dialogs are OS-modals that block browser automation (CDP freezes) and are banned from the UI; +consequential actions use the inline felhomConfirm helper (layout.html) or the .confirm-overlay +dialog; error/info surfaces use showAlert (layout.html modal). alert() joined the ban after the +0.87.0 wizard leg: a decommission error path alert() froze the automation exactly like F-11 +predicted (the operator had to click the OS-modal away). Run from controller/: python scripts/native_confirm_gate.py -Exit 1 if any native confirm(/prompt( call remains in the templates. +Exit 1 if any native confirm(/prompt(/alert( call remains in the templates. """ import io, os, re, sys @@ -13,9 +16,10 @@ ROOTS = [ os.path.join("internal", "setup", "templates"), ] -# A bare confirm(/prompt( CALL with an argument: not preceded by an identifier character, so felhomConfirm( and -# onRestoreConfirmChange( never match. window.confirm( still matches ('.' is not identifier). -NATIVE = re.compile(r"(?