From 56922dd8a3c3e140d5b5cd51575a50b8cf07dec5 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Thu, 12 Feb 2026 20:14:31 +0800 Subject: some changes in admin panel js --- frontend/.DS_Store | Bin 6148 -> 6148 bytes frontend/admin/admin-style.css | 5 +++++ frontend/admin/admin.js | 20 ++++++++++---------- frontend/admin/panel.html | 8 ++++++++ frontend/assets/.DS_Store | Bin 6148 -> 6148 bytes 5 files changed, 23 insertions(+), 10 deletions(-) (limited to 'frontend') diff --git a/frontend/.DS_Store b/frontend/.DS_Store index ac6b678..1f6bb54 100644 Binary files a/frontend/.DS_Store and b/frontend/.DS_Store differ diff --git a/frontend/admin/admin-style.css b/frontend/admin/admin-style.css index e04a047..9c866ff 100644 --- a/frontend/admin/admin-style.css +++ b/frontend/admin/admin-style.css @@ -28,6 +28,11 @@ width: 128px; } +.admin-machine-container > div > span { + text-align: center; + font-weight: 600; +} + .admin-machine-container > h2 { writing-mode: vertical-lr; transform: rotate(180deg); diff --git a/frontend/admin/admin.js b/frontend/admin/admin.js index b78b1b3..ff1c463 100644 --- a/frontend/admin/admin.js +++ b/frontend/admin/admin.js @@ -53,25 +53,25 @@ async function syncMachineStatus() { }); const data = await response.json(); - for (let b = 1; b <= data.length; b++) { - for (let m = 1; m <= data[b].length; m++) { - const img = document.getElementById("h"+b.toString()+"m"+m.toString()+"img"); - const dropdown = document.getElementById("h"+b.toString()+"m"+m.toString()); + for (let b = 0; b < data.length; b++) { + for (let m = 0; m < data[b].length; m++) { + const img = document.getElementById("h"+(b+1).toString()+"m"+(m+1).toString()+"img"); + const dropdown = document.getElementById("h"+(b+1).toString()+"m"+(m+1).toString()); if (data[b][m] != "OUTOFSERVICE") { if (m % 2 == 0) { - img.src = "/assets/img/washer_down.png"; + img.src = "/assets/img/dryer_off.png"; } else { - img.src = "/assets/img/dryer_down.png"; + img.src = "/assets/img/washer_off.png"; } - dropdown.selectedIndex = 1; + dropdown.selectedIndex = 0; } else { if (m % 2 == 0) { - img.src = "/assets/img/washer_off.png"; + img.src = "/assets/img/dryer_down.png"; } else { - img.src = "/assets/img/dryer_off.png"; + img.src = "/assets/img/washer_down.png"; } - dropdown.selectedIndex = 0; + dropdown.selectedIndex = 1; } } } diff --git a/frontend/admin/panel.html b/frontend/admin/panel.html index 1b0f2cf..4813c06 100644 --- a/frontend/admin/panel.html +++ b/frontend/admin/panel.html @@ -14,6 +14,7 @@

Block H2

+ Dryer 1
+ Washer 1
+ Dryer 2
+ Washer 2 @@ -52,6 +57,7 @@
+ Washer 1
+ Dryer 2
+ Washer 2