Feature/usb config - Rebasing USB Config Changes on Dev Branch (#185)

* rebasing on dev branch

* fixed formatting

* fixed formatting

* removed query params

* moved usb settings to hardware setting

* swapped from error to log

* added fix for any change to product name now resulting in show the spinner as custom on page reload

* formatting

---------

Co-authored-by: JackTheRooster <adrian@rydeas.com>
Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
This commit is contained in:
jackislanding
2025-02-27 02:53:47 -06:00
committed by GitHub
parent 92aec30c8f
commit 77263e73f7
6 changed files with 490 additions and 7 deletions

View File

@@ -526,6 +526,30 @@ export const useUpdateStore = create<UpdateState>(set => ({
setUpdateErrorMessage: errorMessage => set({ updateErrorMessage: errorMessage }),
}));
interface UsbConfigModalState {
modalView:
| "updateUsbConfig"
| "updateUsbConfigSuccess";
errorMessage: string | null;
setModalView: (view: UsbConfigModalState["modalView"]) => void;
setErrorMessage: (message: string | null) => void;
}
export interface UsbConfigState {
vendor_id: string;
product_id: string;
serial_number: string;
manufacturer: string;
product: string;
}
export const useUsbConfigModalStore = create<UsbConfigModalState>(set => ({
modalView: "updateUsbConfig",
errorMessage: null,
setModalView: view => set({ modalView: view }),
setErrorMessage: message => set({ errorMessage: message }),
}));
interface LocalAuthModalState {
modalView:
| "createPassword"