Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
27 lines
625 B
JavaScript
27 lines
625 B
JavaScript
const rebootbutton = document.querySelector('#rebootbutton')
|
|
|
|
rebootbutton.addEventListener('click', () => {
|
|
if (confirm("Confirm reboot?")) {
|
|
reboot()
|
|
}
|
|
})
|
|
|
|
const reboot = () => {
|
|
loader.classList.add('active')
|
|
fetch(routes.reboot(), {
|
|
method: 'POST',
|
|
body: `{"token":"${localStorage.getItem("token")}"}`
|
|
}).then(data => data.json()).then(jsondata => {
|
|
|
|
}).catch((error) => {
|
|
setTimeout(waitreboot, 2000)
|
|
})
|
|
}
|
|
|
|
const waitreboot = () => {
|
|
fetch(routes.uptime()).then(res => res.json()).then(jsondata => {
|
|
}).catch((error) => {
|
|
waitreboot()
|
|
})
|
|
}
|