From 40e8b35e6bf6112809f5d18cd5e9bdc2cf3bcf15 Mon Sep 17 00:00:00 2001
From: tian <11429339@qq.com>
Date: Sun, 26 Jul 2026 13:59:11 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=B6=E9=97=B4=E5=90=8C=E6=AD=A5?=
=?UTF-8?q?=E6=8C=89=E9=92=AE=E6=94=B9=E4=B8=BAJS=E6=8E=A7=E5=88=B6?=
=?UTF-8?q?=EF=BC=8C=E5=8B=BE=E9=80=89=E5=90=8E=E5=8D=B3=E6=97=B6=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
internal/web/ui/templates/devices.html | 18 ++++++++++++++----
safesightd.json | 8 +++++---
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/internal/web/ui/templates/devices.html b/internal/web/ui/templates/devices.html
index 704ef07..3c88644 100644
--- a/internal/web/ui/templates/devices.html
+++ b/internal/web/ui/templates/devices.html
@@ -47,10 +47,7 @@
{{if $allOffline}}
{{end}}
- {{$drift := false}}{{range .DeviceRows}}{{if and (gt .TimeDriftSec $.TimeSyncThreshold) (hasString $.SelectedDeviceIDs .Device.DeviceID)}}{{$drift = true}}{{end}}{{end}}
- {{if $drift}}
-
- {{end}}
+
下发设备分配
清空选择
@@ -178,6 +175,19 @@
});
cleanupBtn.style.display = allOffline ? '' : 'none';
}
+ // Show/hide time sync button if any selected device has time drift
+ const syncBtn = document.getElementById('time-sync-btn');
+ if (syncBtn) {
+ let hasDrift = false;
+ checked.forEach(cb => {
+ const row = cb.closest('tr');
+ if (row) {
+ const driftEl = row.querySelector('.pill.bad');
+ if (driftEl && driftEl.textContent.includes('偏差')) hasDrift = true;
+ }
+ });
+ syncBtn.style.display = hasDrift ? '' : 'none';
+ }
};
for (const box of selectedBoxes) {
box.addEventListener('change', syncSelected);
diff --git a/safesightd.json b/safesightd.json
index 8c21f99..2146aa1 100644
--- a/safesightd.json
+++ b/safesightd.json
@@ -8,8 +8,10 @@
"data_dir": "data",
"db_path": "data/app.db",
"log_dir": "data/logs",
+ "alarm_retention_days": 30,
+ "company_name": "金航数码有限公司",
+ "time_sync_threshold_sec": 10,
"device_aliases": {
"d12a4719c91641df91b76ab271280797": "盒子A"
- },
- "alarm_retention_days": 30
-}
+ }
+}
\ No newline at end of file