mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 03:32:00 +08:00
fix: 修复设置页滚动和 HID 继电器识别 #252
This commit is contained in:
@@ -33,8 +33,11 @@ pub use wol::{list_wol_history, record_wol_history, send_wol};
|
||||
fn hidraw_uevent_is_usb_relay(uevent: &str) -> bool {
|
||||
let upper = uevent.to_ascii_uppercase();
|
||||
upper.contains("000016C0:000005DF")
|
||||
|| upper.contains("00005131:00002007")
|
||||
|| upper.contains("16C0:05DF")
|
||||
|| upper.contains("5131:2007")
|
||||
|| upper.contains("PRODUCT=16C0/5DF")
|
||||
|| upper.contains("PRODUCT=5131/2007")
|
||||
|| upper.contains("USBRELAY")
|
||||
|| upper.contains("USB RELAY")
|
||||
}
|
||||
@@ -94,6 +97,14 @@ mod tests {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hidraw_uevent_detects_5131_usb_relay_id() {
|
||||
assert!(hidraw_uevent_is_usb_relay(
|
||||
"HID_ID=0003:00005131:00002007\n"
|
||||
));
|
||||
assert!(hidraw_uevent_is_usb_relay("PRODUCT=5131/2007/100"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hidraw_uevent_rejects_unrelated_hid() {
|
||||
assert!(!hidraw_uevent_is_usb_relay(
|
||||
|
||||
@@ -2267,8 +2267,8 @@ watch(isWindows, () => {
|
||||
<span class="sr-only">{{ t('common.menu') }}</span>
|
||||
</Button>
|
||||
</SheetTrigger>
|
||||
<SheetContent side="left" class="w-72 p-0">
|
||||
<div class="p-4 sm:p-6">
|
||||
<SheetContent side="left" class="w-72 p-0 overflow-y-auto">
|
||||
<div class="min-h-full p-4 sm:p-6">
|
||||
<h2 class="text-lg font-semibold mb-4">{{ t('settings.title') }}</h2>
|
||||
<nav class="space-y-6">
|
||||
<div v-for="group in navGroups" :key="group.title" class="space-y-1">
|
||||
@@ -2301,8 +2301,8 @@ watch(isWindows, () => {
|
||||
</div>
|
||||
|
||||
<!-- Desktop Sidebar -->
|
||||
<aside class="hidden lg:block w-64 shrink-0 border-r bg-muted/30">
|
||||
<div class="sticky top-0 p-6 space-y-6 max-h-screen overflow-y-auto">
|
||||
<aside class="hidden lg:block w-64 shrink-0 border-r bg-muted/30 overflow-hidden">
|
||||
<div class="h-full p-6 space-y-6 overflow-y-auto">
|
||||
<div class="space-y-1">
|
||||
<h1 class="text-xl font-semibold tracking-tight">{{ t('settings.title') }}</h1>
|
||||
<p class="text-xs text-muted-foreground">{{ t('settings.sidebarSubtitle') }}</p>
|
||||
|
||||
Reference in New Issue
Block a user