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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user