feat: add hide IP toggle in sidebar

- Add hideIp / toggleHideIp to canvasStore (UI-only, not persisted)
- Add maskIp util: 192.168.1.115 → 192.168.XX.XX (non-IPv4 passthrough)
- BaseNode reads hideIp from store and masks last two octets when active
- Sidebar shows Eye/EyeOff toggle below Scan Network, highlights when active
This commit is contained in:
Pouzor
2026-03-11 16:15:22 +01:00
parent 8affcda09d
commit 271bbf2d01
5 changed files with 48 additions and 3 deletions
+6
View File
@@ -35,6 +35,8 @@ interface CanvasState {
markUnsaved: () => void
loadCanvas: (nodes: Node<NodeData>[], edges: Edge<EdgeData>[]) => void
notifyScanDeviceFound: () => void
hideIp: boolean
toggleHideIp: () => void
}
export const useCanvasStore = create<CanvasState>((set) => ({
@@ -43,6 +45,7 @@ export const useCanvasStore = create<CanvasState>((set) => ({
hasUnsavedChanges: false,
selectedNodeId: null,
editingGroupRectId: null,
hideIp: false,
scanEventTs: 0,
onNodesChange: (changes) =>
@@ -160,6 +163,9 @@ export const useCanvasStore = create<CanvasState>((set) => ({
notifyScanDeviceFound: () => set({ scanEventTs: Date.now() }),
hideIp: false,
toggleHideIp: () => set((s) => ({ hideIp: !s.hideIp })),
loadCanvas: (nodes, edges) => {
// React Flow requires parents before children in the array
const parents = nodes.filter((n) => !n.parentId)