PC 켜기 응답 처리 정리

This commit is contained in:
seo
2026-07-22 01:18:08 +09:00
parent 694741fc72
commit d29c03a9f4
2 changed files with 13 additions and 3 deletions
+11 -1
View File
@@ -345,9 +345,19 @@ async function wakeComputer() {
return;
}
await fetch('/custom/wakeonlan/api.php', { method: 'POST', credentials: 'same-origin' })
const sent = await fetch('/custom/wakeonlan/api.php', { method: 'POST', credentials: 'same-origin' })
.then(res => res.ok ? res.json() : Promise.reject());
if (sent && sent.result === 'already') {
launcherAlert('wakeonlan_already');
return;
}
if (!sent || sent.result !== 'sent') {
launcherAlert('error');
return;
}
launcherAlert('wakeonlan_request_sent');
let attempts = 0;