mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 11:42:02 +08:00
fix:改进atx usb 继电器适配;修复 webrtc 无法建立连接问题;网页样式优化
This commit is contained in:
@@ -34,7 +34,7 @@ pub async fn update_stream_config(
|
||||
&state,
|
||||
&old_stream_config,
|
||||
&new_stream_config,
|
||||
ConfigApplyOptions::forced(),
|
||||
ConfigApplyOptions::default(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
||||
@@ -509,6 +509,12 @@ impl AtxConfigUpdate {
|
||||
}
|
||||
crate::atx::AtxDriverType::UsbRelay => {
|
||||
if let Some(pin) = key.pin {
|
||||
if pin == 0 {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"{} USB relay channel must be 1-based (>= 1)",
|
||||
name
|
||||
)));
|
||||
}
|
||||
if pin > u8::MAX as u32 {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"{} USB relay channel must be <= {}",
|
||||
@@ -516,6 +522,12 @@ impl AtxConfigUpdate {
|
||||
u8::MAX
|
||||
)));
|
||||
}
|
||||
if pin > 8 {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"{} USB HID relay channel must be <= 8",
|
||||
name
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
crate::atx::AtxDriverType::Gpio | crate::atx::AtxDriverType::None => {}
|
||||
@@ -551,6 +563,12 @@ impl AtxConfigUpdate {
|
||||
}
|
||||
}
|
||||
crate::atx::AtxDriverType::UsbRelay => {
|
||||
if key.pin == 0 {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"{} USB relay channel must be 1-based (>= 1)",
|
||||
name
|
||||
)));
|
||||
}
|
||||
if key.pin > u8::MAX as u32 {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"{} USB relay channel must be <= {}",
|
||||
@@ -558,6 +576,12 @@ impl AtxConfigUpdate {
|
||||
u8::MAX
|
||||
)));
|
||||
}
|
||||
if key.pin > 8 {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"{} USB HID relay channel must be <= 8",
|
||||
name
|
||||
)));
|
||||
}
|
||||
}
|
||||
crate::atx::AtxDriverType::Gpio | crate::atx::AtxDriverType::None => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user