mirror of https://github.com/jetkvm/kvm.git
Revert "fix for initial values being empty"
This reverts commit 065f1bd21b
.
This commit is contained in:
parent
065f1bd21b
commit
194fad972e
|
@ -78,13 +78,15 @@ function UpdateUsbConfigModal({
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
}) {
|
}) {
|
||||||
const [usbConfigState, setUsbConfigState] = useState<UsbConfigState>({
|
const [usbConfig, setUsbConfig] = useState({
|
||||||
vendor_id: '',
|
vendor_id: '',
|
||||||
product_id: '',
|
product_id: '',
|
||||||
serial_number: '',
|
serial_number: '',
|
||||||
manufacturer: '',
|
manufacturer: '',
|
||||||
product: ''
|
product: '',
|
||||||
});
|
})
|
||||||
|
|
||||||
|
const [usbConfigState, setUsbConfigState] = useState<UsbConfigState>();
|
||||||
const [send] = useJsonRpc();
|
const [send] = useJsonRpc();
|
||||||
|
|
||||||
const syncUsbConfig = useCallback(() => {
|
const syncUsbConfig = useCallback(() => {
|
||||||
|
@ -103,23 +105,23 @@ function UpdateUsbConfigModal({
|
||||||
}, [syncUsbConfig]);
|
}, [syncUsbConfig]);
|
||||||
|
|
||||||
const handleUsbVendorIdChange = (value: string) => {
|
const handleUsbVendorIdChange = (value: string) => {
|
||||||
setUsbConfigState({... usbConfigState, vendor_id: value})
|
setUsbConfig({... usbConfig, vendor_id: value})
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUsbProductIdChange = (value: string) => {
|
const handleUsbProductIdChange = (value: string) => {
|
||||||
setUsbConfigState({... usbConfigState, product_id: value})
|
setUsbConfig({... usbConfig, product_id: value})
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUsbSerialChange = (value: string) => {
|
const handleUsbSerialChange = (value: string) => {
|
||||||
setUsbConfigState({... usbConfigState, serial_number: value})
|
setUsbConfig({... usbConfig, serial_number: value})
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUsbManufacturer = (value: string) => {
|
const handleUsbManufacturer = (value: string) => {
|
||||||
setUsbConfigState({... usbConfigState, manufacturer: value})
|
setUsbConfig({... usbConfig, manufacturer: value})
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUsbProduct = (value: string) => {
|
const handleUsbProduct = (value: string) => {
|
||||||
setUsbConfigState({... usbConfigState, product: value})
|
setUsbConfig({... usbConfig, product: value})
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -178,7 +180,7 @@ function UpdateUsbConfigModal({
|
||||||
size="SM"
|
size="SM"
|
||||||
theme="primary"
|
theme="primary"
|
||||||
text="Update USB Config"
|
text="Update USB Config"
|
||||||
onClick={() => onSetUsbConfig(usbConfigState)}
|
onClick={() => onSetUsbConfig(usbConfig)}
|
||||||
/>
|
/>
|
||||||
<Button size="SM" theme="light" text="Not Now" onClick={onCancel} />
|
<Button size="SM" theme="light" text="Not Now" onClick={onCancel} />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue