A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat: more node options
dextmorgn54448f4bd10f
diff --git a/flowsint-web/src/components/investigations/new-actions.tsx b/flowsint-web/src/components/investigations/new-actions.tsxindex c89fdf5e..fc5913bf 100644--- a/flowsint-web/src/components/investigations/new-actions.tsx+++ b/flowsint-web/src/components/investigations/new-actions.tsx@@ -100,7 +100,9 @@ export default function NewActions({ addNodes }: { addNodes: any }) {</DropdownMenuSubTrigger><DropdownMenuPortal><DropdownMenuSubContent>- {item.children.map((childItem) => renderMenuItem(childItem))}+ <div className="grid grid-cols-1 md:grid-cols-2 gap-1">+ {item.children.map((childItem) => renderMenuItem(childItem))}+ </div></DropdownMenuSubContent></DropdownMenuPortal></DropdownMenuSub>@@ -111,9 +113,10 @@ export default function NewActions({ addNodes }: { addNodes: any }) {key={item.id}disabled={item.disabled}onClick={(e) => handleOpenAddNodeModal(e, item.key)}+ className="flex items-center"><Icon className="mr-2 h-4 w-4 opacity-70" />- {item.label}+ <span className="truncate">{item.label}</span>{item.comingSoon && (<Badge variant="outline" className="ml-2">soon@@ -123,6 +126,24 @@ export default function NewActions({ addNodes }: { addNodes: any }) {)}+ // Divide items into two columns+ const splitIntoColumns = (items: ActionItem[]) => {+ const middleIndex = Math.ceil(items.length / 2);+ const column1 = items.slice(0, middleIndex);+ const column2 = items.slice(middleIndex);++ return (+ <div className="grid grid-cols-1 md:grid-cols-2 gap-x-4 min-w-[400px]">+ <div className="space-y-1">+ {column1.map((item) => renderMenuItem(item))}+ </div>+ <div className="space-y-1 md:border-l md:pl-4">+ {column2.map((item) => renderMenuItem(item))}+ </div>+ </div>+ );+ };+return (<><DropdownMenu>@@ -131,7 +152,9 @@ export default function NewActions({ addNodes }: { addNodes: any }) {<PlusIcon /></Button></DropdownMenuTrigger>- <DropdownMenuContent className="w-48" align="start">{actionItems.map((item) => renderMenuItem(item))}</DropdownMenuContent>+ <DropdownMenuContent className="p-2" align="start">+ {splitIntoColumns(actionItems)}+ </DropdownMenuContent></DropdownMenu><Dialog open={openAddNodeModal && currentNodeType} onOpenChange={setOpenNodeModal}><DialogContent>@@ -171,5 +194,4 @@ export default function NewActions({ addNodes }: { addNodes: any }) {</Dialog></>)-}-+}\ No newline at end of filediff --git a/flowsint-web/src/components/investigations/sketch/graph.tsx b/flowsint-web/src/components/investigations/sketch/graph.tsxindex 6cb3c8ca..4fc8f0e7 100644--- a/flowsint-web/src/components/investigations/sketch/graph.tsx+++ b/flowsint-web/src/components/investigations/sketch/graph.tsx@@ -51,6 +51,7 @@ import { TooltipProvider } from "@/components/ui/tooltip"import NodeContextMenu from "./nodes/node-context-menu"import GroupNode from "./nodes/group"import CustomEdge from "./nodes/custom-edge"+import { BaseNode } from "@/components/ui/base-node"const edgeTypes = {custom: CustomEdge,}@@ -63,6 +64,7 @@ const nodeTypes = {social: SocialNode,address: AddressNode,group: GroupNode,+ default: BaseNode}// Split selectors to minimize re-rendersdiff --git a/flowsint-web/src/components/investigations/sketch/nodes/button-edge.tsx b/flowsint-web/src/components/investigations/sketch/nodes/button-edge.tsxindex cdc94ecd..088bc14a 100644--- a/flowsint-web/src/components/investigations/sketch/nodes/button-edge.tsx+++ b/flowsint-web/src/components/investigations/sketch/nodes/button-edge.tsx@@ -5,6 +5,7 @@ import {EdgeLabelRenderer,EdgeProps,getBezierPath,+ getStraightPath,} from "@xyflow/react";export const ButtonEdge = ({@@ -12,19 +13,15 @@ export const ButtonEdge = ({sourceY,targetX,targetY,- sourcePosition,- targetPosition,style = {},markerEnd,children,}: EdgeProps & { children: ReactNode }) => {- const [edgePath, labelX, labelY] = getBezierPath({+ const [edgePath, labelX, labelY] = getStraightPath({sourceX,sourceY,- sourcePosition,targetX,targetY,- targetPosition,});return (diff --git a/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx b/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsxindex 6a3ec1ba..d263708b 100644--- a/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx+++ b/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx@@ -72,7 +72,7 @@ const EditableEdge = memo((props: EdgeProps) => {value={editValue}onChange={handleInputChange}onBlur={handleInputBlur}- className="h-5 text-xs rounded-sm"+ className="h-5 text-xs max-w-28 rounded-sm"/><Buttonref={submitButtonRef}diff --git a/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx b/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsxindex ade6fac3..77061049 100644--- a/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx+++ b/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx@@ -221,7 +221,9 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {<Icon className="mr-3 h-4 w-4 opacity-50" />{item.label}</DropdownMenuSubTrigger>- <DropdownMenuSubContent>{item.children.map((childItem) => renderMenuItem(childItem))}</DropdownMenuSubContent>+ <DropdownMenuSubContent>+ {item.children.map((childItem) => renderMenuItem(childItem))}+ </DropdownMenuSubContent></DropdownMenuSub>)}@@ -231,9 +233,10 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {key={item.id}disabled={item.disabled}onClick={(e) => handleOpenAddNodeModal(e, item.key)}+ className="flex items-center">- <Icon className="mr-3 h-4 w-4 opacity-70" />- {item.label}+ <Icon className="mr-2 h-4 w-4 opacity-70" />+ <span className="truncate">{item.label}</span>{item.comingSoon && (<Badge variant="outline" className="ml-2">soon@@ -261,7 +264,7 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {</DropdownMenuItem><DropdownMenuSub><DropdownMenuSubTrigger>New</DropdownMenuSubTrigger>- <DropdownMenuSubContent className="w-48">{actionItems.map((item) => renderMenuItem(item))}</DropdownMenuSubContent>+ <DropdownMenuSubContent className="grid grid-cols-1 md:grid-cols-2 gap-2">{actionItems.map((item) => renderMenuItem(item))}</DropdownMenuSubContent></DropdownMenuSub><DropdownMenuItem onClick={handleEditClick}>View and edit</DropdownMenuItem><DropdownMenuItem onClick={handleDuplicateClick}>Duplicate</DropdownMenuItem>diff --git a/flowsint-web/src/components/nav-user.tsx b/flowsint-web/src/components/nav-user.tsxindex 5a1542d5..04b20773 100644--- a/flowsint-web/src/components/nav-user.tsx+++ b/flowsint-web/src/components/nav-user.tsx@@ -47,6 +47,7 @@ export function NavUser({<DropdownMenuTrigger asChild><SidebarMenuButtonsize="lg"+ className="p-0 h-auto"><Avatar className="h-8 w-8 rounded-lg"><AvatarImage src={user.avatar} alt={user.name} />