Commit Graph

123 Commits

Author SHA1 Message Date
caoqianming 628553f2b8 refactor(control): extract pulse command helper to control/command.rs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 14:31:37 +08:00
caoqianming 9194bd1dca feat(control): add auto_enabled and flt_active to UnitRuntime 2026-03-24 14:23:53 +08:00
caoqianming 49a4afa4a4 feat(web): auto-toast on API errors with dismissible notifications
Add showToast() utility in api.js and a matching toast stylesheet.
apiFetch now automatically shows a toast for any 400+ response before
re-throwing, so callers can still .catch() for additional handling.

Toasts stack at the bottom-right, auto-dismiss after 4s, and support
error/warning/success/info levels via a left-border colour accent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 13:43:57 +08:00
caoqianming f7dc39a70a fix: point bind bug 2026-03-24 13:39:45 +08:00
caoqianming a38204511a refactor(control): align point roles and equipment kind 2026-03-24 13:17:53 +08:00
caoqianming 2d80266422 fix(opcua): trigger reconnect on BadTimeout and tighten subscription params
Remove the special-case that silently ignored BadTimeout in the
subscription status callback. BadTimeout means the server has already
dropped the subscription, so reconnect must be triggered immediately
rather than waiting for the heartbeat check.

Also reduce lifetime_count (120→15) and max_keep_alive_count (10→5)
so failures are detected within 15s instead of 120s, while still
satisfying the OPC UA spec requirement of lifetime >= 3×keepalive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 12:50:55 +08:00
caoqianming 0b9b7aef7d fix(opcua): relax subscription timeout handling 2026-03-24 12:28:23 +08:00
caoqianming c50127b9d0 feat(event): stream created events over websocket 2026-03-24 12:28:12 +08:00
caoqianming 97d2f6ebf8 feat(control): add manual equipment pulse commands 2026-03-24 11:16:50 +08:00
caoqianming 1f29eb3871 feat(web): add unit and event management views 2026-03-24 10:56:57 +08:00
caoqianming 4e3d325437 feat(control): add unit and event foundation 2026-03-24 10:20:23 +08:00
caoqianming 4d53ee0337 refactor(web): split index html into flat fragments 2026-03-23 14:14:19 +08:00
caoqianming 6cdc51a249 refactor(point): fold binding into edit action 2026-03-23 13:20:03 +08:00
caoqianming e55c1d5efb fix(chart): restore realtime updates and axes 2026-03-23 12:55:12 +08:00
caoqianming fec7b60d6b feat(web): reorganize equipment layout and point flows 2026-03-23 12:49:26 +08:00
caoqianming 06ace5e67d refactor(app): split services and web modules 2026-03-23 11:31:38 +08:00
caoqianming 8be82e372e feat(point): add equipment metadata scaffolding 2026-03-23 10:38:20 +08:00
caoqianming a691f07e8e feat(web): add API.md drawer preview 2026-03-20 19:00:46 +08:00
caoqianming 920e37f759 feat(web): add inline point chart panel 2026-03-20 10:54:20 +08:00
caoqianming bf548161a6 feat: 心跳检测设置为4秒 2026-03-20 09:58:15 +08:00
caoqianming 8eb1d6671a perf(connection): reduce subscription lock contention 2026-03-17 08:28:55 +08:00
caoqianming f33d989905 perf(point): batch point creation queries 2026-03-17 08:25:04 +08:00
caoqianming 7e6c7a7e4c feat(reconnect): add retry backoff and manual reconnect 2026-03-17 08:15:54 +08:00
caoqianming dd110919dd style(web): remove rounded corners and localize card titles 2026-03-16 10:25:32 +08:00
caoqianming f33c96a4e5 fix(opcua): default point quality to Good when status is absent
Made-with: Cursor
2026-03-16 09:57:37 +08:00
caoqianming ae134c722a refactor(ui): redesign web interface with flat modern style
Made-with: Cursor
2026-03-16 08:48:12 +08:00
caoqianming 503aefc4cb refactor(event): rename ReloadEvent to AppEvent and split event channels
Clarify event semantics by renaming ReloadEvent to AppEvent and route control vs telemetry traffic through dedicated channels. This keeps control events isolated from high-frequency PointNewValue updates while preserving the existing send() call pattern.

Made-with: Cursor
2026-03-13 14:44:30 +08:00
caoqianming 5fa63ad6dd fix(opcua): stabilize reconnect loop and coalesce telemetry events
Always clear reconnect-in-progress markers after reconnect attempts so heartbeat-triggered retries are not blocked. Reduce high-frequency event overhead by coalescing consecutive point updates in the event worker and processing only the latest value per source/client handle.

Made-with: Cursor
2026-03-13 14:26:50 +08:00
caoqianming 5406568969 fix: harden event handling and source safety
Improve runtime resilience by bounding the reload event queue and processing telemetry updates without per-point spawned tasks. Also reduce security risk by sanitizing source responses, avoiding internal error detail leaks, and standardizing write-key configuration with backward compatibility.

Made-with: Cursor
2026-03-13 14:22:16 +08:00
caoqianming 6f215162a3 feat(page): add page table and CRUD handlers 2026-03-11 13:54:14 +08:00
caoqianming efed6aa816 feat: add page 2026-03-11 13:23:05 +08:00
caoqianming 1374abe550 feat(log): add file-based log APIs and switch file logs to JSON 2026-03-09 14:47:19 +08:00
caoqianming 63bcf679c2 fix(opcua): reconnect when subscription becomes invalid 2026-03-09 08:58:40 +08:00
caoqianming 0893c9783c fix: 修复心跳检查中订阅状态判断逻辑,避免启动时误触发重连 2026-03-06 13:51:47 +08:00
caoqianming 5dc1081c90 改进心跳检测中的订阅状态检查,通过读取服务器节点属性来验证订阅是否真正有效 2026-03-06 12:57:22 +08:00
caoqianming afab910780 在 DataChangeCallback 中添加 BadNoSubscription 错误检测 2026-03-06 10:58:27 +08:00
caoqianming d4d5749ccc 优化 OPC UA event_loop 监控和重连机制 2026-03-06 10:01:18 +08:00
caoqianming 76b6e17927 feat: save event_loop handle to avoid ghost session 2026-03-06 09:38:14 +08:00
caoqianming b197607d5f refactor: 添加 allocate_client_handle 函数封装句柄分配逻辑 2026-03-06 09:22:55 +08:00
caoqianming a2208e8958 perf: 将 poll_points 改为 Arc<Vec<PollPointInfo>> 以减少 clone 开销 2026-03-06 09:16:18 +08:00
caoqianming 487d3cdf26 refactor: 优化 unsubscribe_points_from_source 中 status 锁粒度,使用 get_session 函数 2026-03-06 09:13:30 +08:00
caoqianming 4d88bcbce3 refactor: 优化 heartbeat 中 status 锁粒度,使用 get_session 函数 2026-03-06 09:09:42 +08:00
caoqianming afac9f1eb9 fix: 修复 poll task 中 results 和 poll_points 可能错位的 bug 2026-03-06 09:04:50 +08:00
caoqianming 8e4abd0af9 feat: 添加重连保护机制修复重复重连问题 2026-03-06 09:01:15 +08:00
caoqianming aaf887a6fc 优化PointNewValue事件处理:并行执行update_point_monitor_data和send_to_public,移除不必要的ws_manager_clone 2026-03-05 15:28:04 +08:00
caoqianming ee3ee273b2 refactor: merge set_pool and start_reconnect_task into set_pool_and_start_reconnect_task 2026-03-05 14:01:40 +08:00
caoqianming 0f37c9435e feat: 实现心跳检测和自动重连功能 2026-03-05 13:27:13 +08:00
caoqianming 494cf1d656 优化连接流程:connect_from_source自动处理订阅,简化main.rs 2026-03-05 11:18:30 +08:00
caoqianming a2217a991c 重构ConnectionManager:简化get_session方法,移除pool依赖,重命名new_with_pool为new 2026-03-05 11:13:10 +08:00
caoqianming 5685c33687 优化main.rs日志打印:移除重复日志,使用并发处理source连接和订阅 2026-03-05 11:08:01 +08:00