Replace form with div to avoid default button handling

This commit is contained in:
Matt
2025-12-14 08:23:32 +00:00
parent 2e36b44c7d
commit 1c29d37c6f
2 changed files with 15 additions and 19 deletions

View File

@@ -140,7 +140,7 @@
</div>
<div class="card">
<form id="configForm" class="controls">
<div class="controls">
<div>
<label>Sample Rate (Hz)</label>
<input type="number" id="sampleRate" value="10000" min="1" max="83333">
@@ -171,9 +171,9 @@
</div>
<div>
<button id="resetBtn">Reset</button>
<button id="powerOff"><a style="text-decoration: none; color: inherit" href="/poweroff">Power off</a></button>
<button id="powerOff">Power off</button>
</div>
</div>
</form>
</div>
<div id="deltaPanel"></div>

View File

@@ -150,8 +150,6 @@ canvas.addEventListener('click', (event) => {
voltage,
time: timeOffset
};
// draw(); // Removed: Animation loop handles this
}
});
@@ -411,8 +409,7 @@ function setParams() {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
})
.then(res => {
}).then(res => {
if (res.ok) {
resetLowRateState();
@@ -424,8 +421,7 @@ function setParams() {
} else {
alert('Error updating configuration');
}
})
.catch(err => alert('Network error: ' + err));
}).catch(err => alert('Network error: ' + err));
};
// Load config from localStorage on startup
@@ -452,6 +448,6 @@ document.getElementById('resetBtn').addEventListener('click', () => {
localStorage.clear();
window.location.reload();
});
document.getElementById('powerOff').addEventListener('click', () => window.location.href = "/poweroff");
setParams();
connect();