diff --git a/frontend/src/views/machine/MachineListPage.vue b/frontend/src/views/machine/MachineListPage.vue index b4f8f9f..366010b 100644 --- a/frontend/src/views/machine/MachineListPage.vue +++ b/frontend/src/views/machine/MachineListPage.vue @@ -48,8 +48,7 @@ diff --git a/src/CncCollector/Core/CollectWorker.cs b/src/CncCollector/Core/CollectWorker.cs index b7d4450..c723f03 100644 --- a/src/CncCollector/Core/CollectWorker.cs +++ b/src/CncCollector/Core/CollectWorker.cs @@ -253,10 +253,10 @@ namespace CncCollector.Core conn.Execute(@"UPDATE cnc_machine SET last_ping_time = NOW(), last_ping_latency = @Latency, updated_at = NOW() WHERE id = @Id", new { Id = kv.Key, Latency = kv.Value }); } - // 离线机床:清空延迟,不更新 last_ping_time + // 离线机床:不更新 last_ping_time,保留上次延迟值 if (offlineIds.Count > 0) { - conn.Execute(@"UPDATE cnc_machine SET last_ping_latency = NULL, updated_at = NOW() WHERE id IN @Ids", + conn.Execute(@"UPDATE cnc_machine SET updated_at = NOW() WHERE id IN @Ids", new { Ids = offlineIds }); } }