AP manageur V1.1 (Bêta)

This commit is contained in:
yoannmultigaming committed 2026-11-25 02:10:59 +01:00
1 parent a9630cc035
commit 7fe1dbf389
2 files changed
+94 -71

No files matched your search

+8 -3
View File
@@ -9688,10 +9688,15 @@ ${vpnBadgeTopo}
rstBtn.innerHTML = `<span style="display:inline-flex;animation:spin 1s linear infinite">⚙️</span> <span>${escapeHtml(t('btn_restarting', 'Redémarrage…'))}</span>`;
}
try {
const response = await apiFetch('/api/ap/control', { method: 'POST', timeout: 35000, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action }) });
const response = await apiFetch('/api/ap/control', { method: 'POST', timeout: 60000, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action }) });
const data = await response.json(); if (!response.ok) throw Error(data.error || 'Action refusée');
await new Promise(resolve => setTimeout(resolve, 800));
await load();
for (let attempt = 0; attempt < 6; attempt++) {
await new Promise(resolve => setTimeout(resolve, 600));
await load();
if (action === 'start' && status && status.active) break;
if (action === 'stop' && status && !status.active) break;
if (action === 'restart' && status && status.active) break;
}
} catch (e) {
alert(tErr(e.message));
} finally {