fix address form and calibration form

This commit is contained in:
Dennis Gunia
2025-11-01 23:47:58 +01:00
parent d5bcc86ca8
commit 085e6fc81b
2 changed files with 23 additions and 2 deletions

View File

@@ -68,6 +68,26 @@ of the license in the project repository or at <https://www.gnu.org/licenses/agp
</article>
</dialog>
<dialog id="dialog_change_calibration">
<article>
<h2>Change calibration</h2>
<section>
<form id="form_change_calibration">
<label>
New calibration data (default 1400):
<input id="form_change_calibration_data" name="calibration" type="number"
placeholder="Calibration Value" value="1400" />
</label>
</form>
<footer>
<button class="secondary btn_cancel">
Cancel
</button>
<button class="btn_confirm">Confirm</button>
</footer>
</article>
</dialog>
<main class="container">
<div id="message_container" style="width: 100%;" class="notification-container">
<template id="notification">

View File

@@ -280,10 +280,11 @@ function display_dialog_change_address() {
const dialog = document.getElementById("change_address");
dialog.showModal();
const dialog_el = dialog.querySelector("article").querySelector("section").querySelector("footer");
const addr_old = Number(dialog.querySelector("#form_change_address_old").value);
const addr_new = Number(dialog.querySelector("#form_change_address_new").value);
dialog_el.querySelector(".btn_confirm").onclick = function () {
const addr_old = Number(dialog.querySelector("#form_change_address_old").value);
const addr_new = Number(dialog.querySelector("#form_change_address_new").value);
const msg = {
"command": "dr_setaddress",
"address": addr_old,