feat: update version to 1.2.3; modify HTML files to reflect new version; enhance firmware update process and UI improvements
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1056,6 +1056,7 @@ input[type="submit"]:disabled,
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
margin: 0 auto;
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
}
|
||||
.update-form input[type="file"] {
|
||||
margin-bottom: 15px;
|
||||
@ -1063,6 +1064,7 @@ input[type="submit"]:disabled,
|
||||
padding: 8px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
background: white;
|
||||
}
|
||||
.update-form input[type="submit"] {
|
||||
background-color: #4CAF50;
|
||||
@ -1072,6 +1074,7 @@ input[type="submit"]:disabled,
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
.update-form input[type="submit"]:hover {
|
||||
background-color: #45a049;
|
||||
@ -1083,8 +1086,10 @@ input[type="submit"]:disabled,
|
||||
.warning {
|
||||
background-color: var(--primary-color);
|
||||
border: 1px solid #ffe0b2;
|
||||
color: #e65100;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
margin: 20px auto;
|
||||
border-radius: 4px;
|
||||
max-width: 600px;
|
||||
text-align: center;
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
|
||||
<!-- head --><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -13,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -42,14 +41,13 @@
|
||||
|
||||
<div class="warning">
|
||||
<strong>Warning:</strong> Please do not turn off or restart the device during the update.
|
||||
Configuration files will be automatically backed up and restored after the update.
|
||||
The device will restart automatically after the update.
|
||||
</div>
|
||||
|
||||
|
||||
<div class="update-form" style="align-items: center;">
|
||||
<form id="updateForm" enctype='multipart/form-data' style="text-align: center;"></form>
|
||||
<div class="update-form">
|
||||
<form id="updateForm" enctype='multipart/form-data'>
|
||||
<input type='file' name='update' accept='.bin' required>
|
||||
<input type='submit' value='Firmware Update starten'>
|
||||
<input type='submit' value='Start Firmware Update'>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -60,10 +58,21 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Hide status indicators during update
|
||||
const statusContainer = document.querySelector('.status-container');
|
||||
if (statusContainer) {
|
||||
statusContainer.style.display = 'none';
|
||||
}
|
||||
|
||||
document.getElementById('updateForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const form = e.target;
|
||||
const file = form.update.files[0];
|
||||
if (!file) {
|
||||
alert('Please select a firmware file.');
|
||||
return;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('update', file);
|
||||
|
||||
@ -91,21 +100,24 @@
|
||||
try {
|
||||
let response = this.responseText;
|
||||
try {
|
||||
// Versuche als JSON zu parsen
|
||||
const jsonResponse = JSON.parse(response);
|
||||
response = jsonResponse.message;
|
||||
|
||||
if (jsonResponse.restart) {
|
||||
// Wenn Gerät neustartet, warte und lade dann neu
|
||||
status.textContent = response + " Weiterleitung in 5 Sekunden...";
|
||||
setTimeout(() => {
|
||||
window.location.href = '/';
|
||||
}, 5000);
|
||||
status.textContent = response + " Redirecting in 20 seconds...";
|
||||
let countdown = 20;
|
||||
const timer = setInterval(() => {
|
||||
countdown--;
|
||||
if (countdown <= 0) {
|
||||
clearInterval(timer);
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
status.textContent = response + ` Redirecting in ${countdown} seconds...`;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
} catch (e) {
|
||||
// Wenn kein JSON, nutze response als Text
|
||||
if (!isNaN(response)) {
|
||||
// Wenn es eine Zahl ist, update den Fortschritt
|
||||
const percent = parseInt(response);
|
||||
progress.style.width = percent + '%';
|
||||
progress.textContent = percent + '%';
|
||||
@ -121,7 +133,7 @@
|
||||
form.querySelector('input[type=submit]').disabled = false;
|
||||
}
|
||||
} catch (error) {
|
||||
status.textContent = 'Fehler: ' + error.message;
|
||||
status.textContent = 'Error: ' + error.message;
|
||||
status.classList.add('error');
|
||||
status.style.display = 'block';
|
||||
form.querySelector('input[type=submit]').disabled = false;
|
||||
@ -129,7 +141,7 @@
|
||||
};
|
||||
|
||||
xhr.onerror = function() {
|
||||
status.textContent = 'Update fehlgeschlagen: Netzwerkfehler';
|
||||
status.textContent = 'Update failed: Network error';
|
||||
status.classList.add('error');
|
||||
status.style.display = 'block';
|
||||
form.querySelector('input[type=submit]').disabled = false;
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.1</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.2</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user