From b0ff8d088466c431553b82cbd4ab79800b917b4e Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 30 Nov 2025 22:11:40 +0700 Subject: url params start --- frontend/main.js | 3 +-- frontend/start.js | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/main.js b/frontend/main.js index 2b35977..90c3e5c 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -1,8 +1,7 @@ // --- begin, important constants const data = { duration: 1, // will be multiplied by 30 - block: 1, - machine: 2, + machine_id: "" } const API_URL = "https://backend.laundryweb.altafcreator.com" diff --git a/frontend/start.js b/frontend/start.js index 4c860e5..f79033d 100644 --- a/frontend/start.js +++ b/frontend/start.js @@ -1,6 +1,11 @@ document.getElementById("startbtn").addEventListener("click", () => { start(); }); + +const urlParams = new URLSearchParams(window.location.search); +data.machine_id = urlParams.get('machine'); +console.log(urlParams); + startUpdateMachines(); const notbtn = document.getElementById("notbtn") -- cgit v1.2.3