test ci/cd
This commit is contained in:
commit
1e8243ab9a
265 changed files with 216965 additions and 0 deletions
51
FRONT/BUILD/resources/app/src/store/useDeviceStore.ts
Normal file
51
FRONT/BUILD/resources/app/src/store/useDeviceStore.ts
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { create } from 'zustand';
|
||||
|
||||
export interface DeviceUser {
|
||||
ip: string;
|
||||
mac: string;
|
||||
hostname: string;
|
||||
vendor: string;
|
||||
open_ports: string[];
|
||||
status: string;
|
||||
last_seen: string;
|
||||
note: string;
|
||||
}
|
||||
|
||||
export interface WifiNetworkScanner {
|
||||
ssid: string;
|
||||
bssid: string;
|
||||
channel: number;
|
||||
signal: number;
|
||||
encryption: string;
|
||||
frequency: string;
|
||||
vendor: string;
|
||||
hidden: boolean;
|
||||
note: string;
|
||||
}
|
||||
|
||||
interface NetworkStore {
|
||||
devices: DeviceUser[];
|
||||
setDevices: (devices: DeviceUser[]) => void;
|
||||
addDevice: (device: DeviceUser) => void;
|
||||
wifiNetworks: WifiNetworkScanner[];
|
||||
setWifiNetworks: (networks: WifiNetworkScanner[]) => void;
|
||||
addWifiNetwork: (network: WifiNetworkScanner) => void;
|
||||
|
||||
clearAll: () => void;
|
||||
}
|
||||
|
||||
const useNetworkStore = create<NetworkStore>((set) => ({
|
||||
devices: [],
|
||||
setDevices: (devices) => set({ devices }),
|
||||
addDevice: (device) =>
|
||||
set((state) => ({ devices: [...state.devices, device] })),
|
||||
|
||||
wifiNetworks: [],
|
||||
setWifiNetworks: (networks) => set({ wifiNetworks: networks }),
|
||||
addWifiNetwork: (network) =>
|
||||
set((state) => ({ wifiNetworks: [...state.wifiNetworks, network] })),
|
||||
|
||||
clearAll: () => set({ devices: [], wifiNetworks: [] })
|
||||
}));
|
||||
|
||||
export default useNetworkStore;
|
||||
Loading…
Add table
Add a link
Reference in a new issue