mirror of https://github.com/jetkvm/kvm.git
feat: add reboot state management to UI store
This commit is contained in:
parent
63d1a68d99
commit
b3141e02ad
|
|
@ -69,6 +69,11 @@ export interface UIState {
|
||||||
|
|
||||||
terminalType: AvailableTerminalTypes;
|
terminalType: AvailableTerminalTypes;
|
||||||
setTerminalType: (type: UIState["terminalType"]) => void;
|
setTerminalType: (type: UIState["terminalType"]) => void;
|
||||||
|
|
||||||
|
rebootState: { isRebooting: boolean; suggestedIp: string | null } | null;
|
||||||
|
setRebootState: (
|
||||||
|
state: { isRebooting: boolean; suggestedIp: string | null } | null,
|
||||||
|
) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useUiStore = create<UIState>(set => ({
|
export const useUiStore = create<UIState>(set => ({
|
||||||
|
|
@ -82,7 +87,8 @@ export const useUiStore = create<UIState>(set => ({
|
||||||
setDisableVideoFocusTrap: (enabled: boolean) => set({ disableVideoFocusTrap: enabled }),
|
setDisableVideoFocusTrap: (enabled: boolean) => set({ disableVideoFocusTrap: enabled }),
|
||||||
|
|
||||||
isWakeOnLanModalVisible: false,
|
isWakeOnLanModalVisible: false,
|
||||||
setWakeOnLanModalVisibility: (enabled: boolean) => set({ isWakeOnLanModalVisible: enabled }),
|
setWakeOnLanModalVisibility: (enabled: boolean) =>
|
||||||
|
set({ isWakeOnLanModalVisible: enabled }),
|
||||||
|
|
||||||
toggleSidebarView: view =>
|
toggleSidebarView: view =>
|
||||||
set(state => {
|
set(state => {
|
||||||
|
|
@ -96,6 +102,9 @@ export const useUiStore = create<UIState>(set => ({
|
||||||
isAttachedVirtualKeyboardVisible: true,
|
isAttachedVirtualKeyboardVisible: true,
|
||||||
setAttachedVirtualKeyboardVisibility: (enabled: boolean) =>
|
setAttachedVirtualKeyboardVisibility: (enabled: boolean) =>
|
||||||
set({ isAttachedVirtualKeyboardVisible: enabled }),
|
set({ isAttachedVirtualKeyboardVisible: enabled }),
|
||||||
|
|
||||||
|
rebootState: null,
|
||||||
|
setRebootState: state => set({ rebootState: state }),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export interface RTCState {
|
export interface RTCState {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue