diff --git a/internal/web/ui/templates/device.html b/internal/web/ui/templates/device.html
index 88f5366..2109f20 100644
--- a/internal/web/ui/templates/device.html
+++ b/internal/web/ui/templates/device.html
@@ -49,7 +49,7 @@
{{if .Device.Online}}在线{{else}}离线{{end}}
-
设备名称{{displayDeviceName .Device .ConfigStatus}}✎
+
设备名称{{displayDeviceName .Device .ConfigStatus}}✎ 改名
设备 ID{{.Device.DeviceID}}
管理地址{{.Device.IP}}:{{.Device.AgentPort}}
视频端口{{.Device.MediaPort}}
@@ -262,8 +262,9 @@ function editDeviceName(el, deviceID) {
function save() {
var name = input.value.trim();
input.remove();
+ nameSpan.style.display = '';
el.style.display = '';
- if (!name || name === current) { input.remove(); el.style.display = ''; return; }
+ if (!name || name === current) return;
var form = document.createElement('form');
form.method = 'POST';
form.action = '/devices/' + deviceID + '/alias';
@@ -276,7 +277,7 @@ function editDeviceName(el, deviceID) {
form.submit();
}
input.addEventListener('blur', save);
- input.addEventListener('keydown', function(e) { if (e.key === 'Enter') save(); if (e.key === 'Escape') { input.remove(); el.style.display = ''; } });
+ input.addEventListener('keydown', function(e) { if (e.key === 'Enter') save(); if (e.key === 'Escape') { input.remove(); nameSpan.style.display = ''; el.style.display = ''; } });
}
{{end}}
diff --git a/safesightd-linux-arm64 b/safesightd-linux-arm64
index 4d6c00b..54a631a 100644
Binary files a/safesightd-linux-arm64 and b/safesightd-linux-arm64 differ