feat: added reboot to OTA in command menu

This commit is contained in:
Dan Ditomaso
2025-04-02 17:58:40 -04:00
parent ec7b4528f6
commit edc17b304a
8 changed files with 320 additions and 47 deletions
+19
View File
@@ -0,0 +1,19 @@
import useLocalStorage from "@core/hooks/useLocalStorage.ts";
import { useCallback } from "react";
export function usePinnedItems({ storageName }: { storageName: string }) {
const [pinnedItems, setPinnedItems] = useLocalStorage<string[]>(storageName, []);
const togglePinnedItem = useCallback((label: string) => {
setPinnedItems((prev) =>
prev.includes(label)
? prev.filter((g) => g !== label)
: [...prev, label]
);
}, []);
return {
pinnedItems,
togglePinnedItem,
};
}
+3
View File
@@ -23,6 +23,7 @@ export type DialogVariant =
| "QR"
| "shutdown"
| "reboot"
| "rebootOTA"
| "deviceName"
| "nodeRemoval"
| "pkiBackup"
@@ -64,6 +65,7 @@ export interface Device {
QR: boolean;
shutdown: boolean;
reboot: boolean;
rebootOTA: boolean;
deviceName: boolean;
nodeRemoval: boolean;
pkiBackup: boolean;
@@ -149,6 +151,7 @@ export const useDeviceStore = createStore<DeviceState>((set, get) => ({
nodeDetails: false,
unsafeRoles: false,
refreshKeys: false,
rebootOTA: false,
},
pendingSettingsChanges: false,
messageDraft: "",