mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-28 16:41:52 +08:00
refactor(web): 前端代码规范化重构
- 集中化 HID 类型定义到 types/hid.ts,消除重复代码 - 统一 WebSocket 连接管理,提取共享工具到 types/websocket.ts - 拆分 ConsoleView.vue 关注点,创建 useVideoStream、useHidInput、useConsoleEvents composables - 添加 useConfigPopover 抽象配置弹窗公共逻辑 - 优化视频容器布局,支持动态比例自适应
This commit is contained in:
@@ -351,6 +351,15 @@ impl PeerConnection {
|
||||
|
||||
/// Close the connection
|
||||
pub async fn close(&self) -> Result<()> {
|
||||
// Reset HID state to release any held keys/buttons
|
||||
if let Some(ref hid) = self.hid_controller {
|
||||
if let Err(e) = hid.reset().await {
|
||||
tracing::warn!("Failed to reset HID on peer {} close: {}", self.session_id, e);
|
||||
} else {
|
||||
tracing::debug!("HID reset on peer {} close", self.session_id);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ref track) = self.video_track {
|
||||
track.stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user