This commit is contained in:
File diff suppressed because one or more lines are too long
41
data/update_progress.html
Normal file
41
data/update_progress.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="/chota.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<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>
|
||||
|
||||
<script>
|
||||
const ws = new WebSocket('ws://' + window.location.host + '/ws');
|
||||
|
||||
ws.onopen = function() {
|
||||
console.log('WebSocket connection opened.');
|
||||
};
|
||||
|
||||
ws.onmessage = function(event) {
|
||||
console.log('Progress:', event.data);
|
||||
// Update the progress bar
|
||||
let progress = parseInt(event.data);
|
||||
document.getElementById('progress').textContent = progress + '%';
|
||||
};
|
||||
|
||||
ws.onerror = function(error) {
|
||||
console.error('WebSocket error:', error);
|
||||
};
|
||||
|
||||
ws.onclose = function() {
|
||||
console.log('WebSocket connection closed.');
|
||||
};
|
||||
</script>
|
||||
@@ -1 +1 @@
|
||||
2
|
||||
3
|
||||
Reference in New Issue
Block a user