mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
feat(UsbDeviceSetting): integrate remote virtual media state management and improve USB config handlingt
This commit is contained in:
@@ -9,7 +9,6 @@ import { Button } from "./Button";
|
||||
import { SelectMenuBasic } from "./SelectMenuBasic";
|
||||
import { SettingsSectionHeader } from "./SettingsSectionHeader";
|
||||
import Fieldset from "./Fieldset";
|
||||
|
||||
export interface USBConfig {
|
||||
vendor_id: string;
|
||||
product_id: string;
|
||||
@@ -119,13 +118,12 @@ export function UsbDeviceSetting() {
|
||||
|
||||
const onUsbConfigItemChange = useCallback(
|
||||
(key: keyof UsbDeviceConfig) => (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setUsbDeviceConfig(val => {
|
||||
val[key] = e.target.checked;
|
||||
handleUsbConfigChange(val);
|
||||
return val;
|
||||
});
|
||||
setUsbDeviceConfig(prev => ({
|
||||
...prev,
|
||||
[key]: e.target.checked,
|
||||
}));
|
||||
},
|
||||
[handleUsbConfigChange],
|
||||
[],
|
||||
);
|
||||
|
||||
const handlePresetChange = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user