All checks were successful
Compilie project and upload binaries / test (push) Successful in 3m59s
59 lines
1.5 KiB
HTML
59 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<head>
|
|
<link rel="stylesheet" href="/chota.css">
|
|
</head>
|
|
|
|
<body>
|
|
<script>
|
|
const webSocket = new WebSocket('ws://' + window.location.host + '/webSocket');
|
|
|
|
webSocket.onopen = function() {
|
|
console.log('WebSocket connection opened.');
|
|
};
|
|
|
|
webSocket.onmessage = function(event) {
|
|
console.log('Progress:', event.data);
|
|
// Update the progress bar
|
|
let progress = parseInt(event.data);
|
|
if (progress == -1) {
|
|
document.getElementById('progress').textContent = "Upgrade Done, wait for reboot...";
|
|
|
|
const checkStatus = setInterval(() => {
|
|
fetch('/ota_update_status')
|
|
.then(response => {
|
|
if (response.ok) {
|
|
clearInterval(checkStatus);
|
|
window.location.href = '/';
|
|
}
|
|
})
|
|
.catch(error => console.error('Error checking OTA update status:', error));
|
|
}, 1000);
|
|
} else {
|
|
document.getElementById('progress').textContent = progress + '%';
|
|
}
|
|
|
|
|
|
};
|
|
|
|
webSocket.onerror = function(error) {
|
|
console.error('WebSocket error:', error);
|
|
};
|
|
|
|
webSocket.onclose = function() {
|
|
console.log('WebSocket connection closed.');
|
|
};
|
|
</script>
|
|
<div class="container">
|
|
<div class="card bd-success">
|
|
<header class="is-center">
|
|
<h4>Update running</h4>
|
|
</header>
|
|
<div class="is-center" id="progress">
|
|
Running update...
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|