mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-04-20 22:05:11 +00:00
feat: send beacon and reboot buttons
This commit is contained in:
parent
67e1c528f3
commit
5337cb2d46
5 changed files with 66 additions and 9 deletions
|
|
@ -216,6 +216,30 @@ function loadSettings(settings) {
|
|||
toggleFields();
|
||||
}
|
||||
|
||||
function showToast(message) {
|
||||
const el = document.querySelector('#toast');
|
||||
|
||||
el.querySelector('.toast-body').innerHTML = message;
|
||||
|
||||
(new bootstrap.Toast(el)).show();
|
||||
}
|
||||
|
||||
document.getElementById('send-beacon').addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
fetch("/action?type=send-beacon", { method: "POST" });
|
||||
|
||||
showToast("Your beacon will be sent in a moment. <br> <u>This action will be ignored if you have APRSIS and LoRa TX disabled!</u>");
|
||||
});
|
||||
|
||||
document.getElementById('reboot').addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
fetch("/action?type=reboot", { method: "POST" });
|
||||
|
||||
showToast("Your device will be rebooted in a while");
|
||||
});
|
||||
|
||||
const bmeCheckbox = document.querySelector("input[name='bme.active']");
|
||||
|
||||
const stationModeSelect = document.querySelector("select[name='stationMode']");
|
||||
|
|
@ -443,4 +467,4 @@ form.addEventListener("submit", async (event) => {
|
|||
setTimeout(checkConnection, 2000);
|
||||
});
|
||||
|
||||
fetchSettings();
|
||||
fetchSettings();
|
||||
Loading…
Add table
Add a link
Reference in a new issue