controller: drill F-11 — inline two-step confirm (felhomConfirm + data-confirm) replaces every native confirm(); native_confirm_gate.py enforces zero; stale-data delete keeps its double acknowledgement inline
Claude-Session: https://claude.ai/code/session_01GzammAMzsJTgpQHqxwM2bC
This commit is contained in:
@@ -457,7 +457,7 @@ function renderWatchdogStatus(paths) {
|
||||
var simBadge = p.simulated ? ' <span class="badge-warn">SIM</span>' : '';
|
||||
var action = '';
|
||||
if (p.status === 'connected' && !p.simulated) {
|
||||
action = '<button class="btn btn-xs btn-secondary" onclick="simulateDisconnect(\'' + p.path + '\')">Leválasztás</button>';
|
||||
action = '<button class="btn btn-xs btn-secondary" onclick="simulateDisconnect(this,\'' + p.path + '\')">Leválasztás</button>';
|
||||
} else if (p.simulated) {
|
||||
action = '<button class="btn btn-xs btn-primary" onclick="simulateReconnect(\'' + p.path + '\')">Visszacsatl.</button>';
|
||||
}
|
||||
@@ -468,16 +468,17 @@ function renderWatchdogStatus(paths) {
|
||||
html += '</table>';
|
||||
document.getElementById('watchdog-status').innerHTML = html;
|
||||
}
|
||||
function simulateDisconnect(path) {
|
||||
if (!confirm('Biztosan szimulálja a leválasztást?\n\nEz leállítja az érintett alkalmazásokat.')) return;
|
||||
fetch('/api/debug/storage/simulate-disconnect', {
|
||||
method: 'POST',
|
||||
headers: Object.assign({'Content-Type':'application/json'}, csrfHeaders()),
|
||||
body: JSON.stringify({path: path})
|
||||
}).then(function(r){return r.json()}).then(function(data) {
|
||||
if (!data.ok) alert('Hiba: ' + (data.error || 'ismeretlen'));
|
||||
loadWatchdogStatus();
|
||||
}).catch(function(e) { alert('Hiba: ' + e.message); });
|
||||
function simulateDisconnect(btn, path) {
|
||||
felhomConfirm(btn, 'Biztosan szimulálja a leválasztást? Ez leállítja az érintett alkalmazásokat.', function () {
|
||||
fetch('/api/debug/storage/simulate-disconnect', {
|
||||
method: 'POST',
|
||||
headers: Object.assign({'Content-Type':'application/json'}, csrfHeaders()),
|
||||
body: JSON.stringify({path: path})
|
||||
}).then(function(r){return r.json()}).then(function(data) {
|
||||
if (!data.ok) alert('Hiba: ' + (data.error || 'ismeretlen'));
|
||||
loadWatchdogStatus();
|
||||
}).catch(function(e) { alert('Hiba: ' + e.message); });
|
||||
});
|
||||
}
|
||||
function simulateReconnect(path) {
|
||||
fetch('/api/debug/storage/simulate-reconnect', {
|
||||
@@ -560,30 +561,31 @@ function triggerDR() {
|
||||
result.textContent = 'Írja be: RESET';
|
||||
return;
|
||||
}
|
||||
if (!confirm('FIGYELEM! Ez újraindítja a controllert setup módba.\n\nBiztosan folytatja?')) return;
|
||||
var btn = document.getElementById('btn-dr-trigger');
|
||||
var result = document.getElementById('btn-dr-trigger-result');
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Folyamatban...';
|
||||
fetch('/api/debug/dr/trigger-setup', {
|
||||
method: 'POST',
|
||||
headers: Object.assign({'Content-Type':'application/json'}, csrfHeaders()),
|
||||
body: JSON.stringify({confirm: 'RESET'})
|
||||
}).then(function(r){return r.json()}).then(function(data) {
|
||||
if (data.ok) {
|
||||
result.className = 'debug-result debug-result-ok';
|
||||
result.textContent = 'Controller újraindulása...';
|
||||
} else {
|
||||
felhomConfirm(btn, 'FIGYELEM! Ez újraindítja a controllert setup módba. Biztosan folytatja?', function () {
|
||||
var result = document.getElementById('btn-dr-trigger-result');
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Folyamatban...';
|
||||
fetch('/api/debug/dr/trigger-setup', {
|
||||
method: 'POST',
|
||||
headers: Object.assign({'Content-Type':'application/json'}, csrfHeaders()),
|
||||
body: JSON.stringify({confirm: 'RESET'})
|
||||
}).then(function(r){return r.json()}).then(function(data) {
|
||||
if (data.ok) {
|
||||
result.className = 'debug-result debug-result-ok';
|
||||
result.textContent = 'Controller újraindulása...';
|
||||
} else {
|
||||
result.className = 'debug-result debug-result-error';
|
||||
result.textContent = data.error || 'Hiba';
|
||||
btn.disabled = false;
|
||||
btn.textContent = btn.dataset.label;
|
||||
}
|
||||
}).catch(function(e) {
|
||||
result.className = 'debug-result debug-result-error';
|
||||
result.textContent = data.error || 'Hiba';
|
||||
result.textContent = 'Hiba: ' + e.message;
|
||||
btn.disabled = false;
|
||||
btn.textContent = btn.dataset.label;
|
||||
}
|
||||
}).catch(function(e) {
|
||||
result.className = 'debug-result debug-result-error';
|
||||
result.textContent = 'Hiba: ' + e.message;
|
||||
btn.disabled = false;
|
||||
btn.textContent = btn.dataset.label;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user