A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat: rounded nodes
dextmorgndc4382be1a22
diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsxindex 87c1464c..cc0ffc17 100644--- a/src/app/dashboard/layout.tsx+++ b/src/app/dashboard/layout.tsx@@ -2,11 +2,36 @@ import React from 'react'import { createClient } from "@/src/lib/supabase/server";import { redirect } from "next/navigation";import Logo from '@/src/components/logo';-import { Flex, ScrollArea, TextField } from '@radix-ui/themes';+import { Box, Flex, ScrollArea, TextField, Text } from '@radix-ui/themes';import NewCase from '@/src/components/dashboard/new-case';import { MagnifyingGlassIcon } from '@radix-ui/react-icons';import User from '@/src/components/user';+import Link from 'next/link';+const navigation = [+ {+ name: "Dashboard",+ children: [+ {+ name: "Your investigations",+ href: "/dashboard"+ }+ ]+ },+ {+ name: "Configuration",+ children: [+ {+ name: "Settings",+ href: "/dashboard/settings"+ },+ {+ name: "API keys",+ href: "/dashboard/keys"+ }+ ]+ }+]const DashboardLayout = async ({children,}: {@@ -17,6 +42,7 @@ const DashboardLayout = async ({if (error || !data?.user) {redirect('/login')}+return (<Flex className='h-screen w-screen flex'><Flex className='h-screen'>@@ -28,9 +54,18 @@ const DashboardLayout = async ({</Flex></div><ScrollArea type="auto" scrollbars="vertical" className='p-3 w-full !h-[calc(100vh_-48px)] grow overflow-y-auto'>- <div className="flex flex-col">-- </div>+ <Flex direction={"column"} gap="4" className='p-4'>+ {navigation.map((nav, i) => (+ <Flex direction={"column"} gap="1" key={i}>+ <Text className='opacity-60' weight="light">{nav.name}</Text>+ <Flex direction={"column"} gap="1">+ {nav?.children?.map((child, i) => (+ <Link className='hover:text-sky-400 hover:underline' key={i} href={child.href}><Text weight={"medium"} truncate>{child.name}</Text></Link>+ ))}+ </Flex>+ </Flex>+ ))}+ </Flex></ScrollArea></div>diff --git a/src/components/contexts/investigation-provider.tsx b/src/components/contexts/investigation-provider.tsxindex 1b6445fd..a5c64b9c 100644--- a/src/components/contexts/investigation-provider.tsx+++ b/src/components/contexts/investigation-provider.tsx@@ -45,7 +45,8 @@ export const InvestigationProvider: React.FC<InvestigationProviderProps> = ({ chshowNodeLabel: true,showEdgeLabel: true,showMiniMap: true,- showCopyIcon: true+ showCopyIcon: true,+ showNodeToolbar: true});const createQueryString = useCallback(@@ -94,6 +95,7 @@ export const InvestigationProvider: React.FC<InvestigationProviderProps> = ({ ch<SettingSwitch setting={"showEdgeLabel"} value={settings.showEdgeLabel} title={"Show labels on edges"} description={"Displays the labels on the edges, like relation type."} /><SettingSwitch setting={"showMiniMap"} value={settings.showMiniMap} title={"Show minimap on the canva"} description={"Displays the minimap on canva."} /><SettingSwitch setting={"showCopyIcon"} value={settings.showCopyIcon} title={"Show copy button on nodes"} description={"Displays a copy button on the nodes."} />+ <SettingSwitch setting={"showNodeToolbar"} value={settings.showNodeToolbar} title={"Show toolbar on nodes"} description={"Displays a toolbar with actions on the nodes."} /><div className="flex items-center justify-between gap-4"><div className="flex flex-col gap-1"><p className="font-medium">Theme</p>diff --git a/src/components/investigations/graph.tsx b/src/components/investigations/graph.tsxindex e8234757..37f6252d 100644--- a/src/components/investigations/graph.tsx+++ b/src/components/investigations/graph.tsx@@ -185,6 +185,10 @@ const LayoutFlow = ({ initialNodes, initialEdges, theme }: { initialNodes: any,...node,disabled: false,draggable: true,+ data: {+ ...node.data,+ forceToolbarVisible: false+ },style: {...node.style,opacity: 1,@@ -235,7 +239,7 @@ const LayoutFlow = ({ initialNodes, initialEdges, theme }: { initialNodes: any,if (currentNode) {const internalNode = getNode(currentNode)if (!internalNode) return- updateNode(internalNode.id, { ...internalNode, zIndex: 5000, style: { ...internalNode.style, opacity: 1 } })+ updateNode(internalNode.id, { ...internalNode, zIndex: 5000, data: { ...internalNode.data, forceToolbarVisible: true }, style: { ...internalNode.style, opacity: 1 } })//@ts-ignoresetCenter(internalNode?.position.x + (internalNode?.measured?.width / 2), internalNode?.position.y + (internalNode?.measured?.height / 2) + 20, { duration: 1000, zoom: 1.5 })highlightPath(internalNode);diff --git a/src/components/investigations/nodes/email.tsx b/src/components/investigations/nodes/email.tsxindex 4286fa51..97ad7168 100644--- a/src/components/investigations/nodes/email.tsx+++ b/src/components/investigations/nodes/email.tsx@@ -20,7 +20,7 @@ function EmailNode({ data }: any) {<ContextMenu.Trigger><Box className={cn(loading ? "!opacity-40" : "!opacity-100")}>{settings.showNodeLabel && showContent ?- <Card className={cn('border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>+ <Card data-radius='full' className={cn('!pr-4 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}><Inset><Flex className='items-center p-0'><Badge color='green' className='!h-[24px] !rounded-r-none'>diff --git a/src/components/investigations/nodes/individual.tsx b/src/components/investigations/nodes/individual.tsxindex 35943172..7cc698d2 100644--- a/src/components/investigations/nodes/individual.tsx+++ b/src/components/investigations/nodes/individual.tsx@@ -1,9 +1,9 @@"use client"import React, { memo } from 'react';-import { Handle, Position, useStore } from '@xyflow/react';+import { Handle, NodeToolbar, Position, useStore } from '@xyflow/react';import { useInvestigationContext } from '../../contexts/investigation-provider';-import { Avatar, Card, Box, Flex, Text, ContextMenu, Spinner, Badge, Tooltip } from '@radix-ui/themes';-import { AtSignIcon, CameraIcon, FacebookIcon, InstagramIcon, LocateIcon, MessageCircleDashedIcon, PhoneIcon, SendIcon, UserIcon, MapPinHouseIcon, ZapIcon, BotIcon } from 'lucide-react';+import { Avatar, Card, Box, Flex, Text, ContextMenu, Spinner, Badge, Tooltip, IconButton, Button } from '@radix-ui/themes';+import { AtSignIcon, CameraIcon, FacebookIcon, InstagramIcon, LocateIcon, MessageCircleDashedIcon, PhoneIcon, SendIcon, UserIcon, MapPinHouseIcon, ZapIcon, BotIcon, EditIcon } from 'lucide-react';import { NodeProvider, useNodeContext } from '../../contexts/node-context';import { useSearchContext } from '../../contexts/search-context';import { cn, zoomSelector } from '@/src/lib/utils';@@ -20,14 +20,26 @@ function Custom(props: any) {const { data } = propsreturn (<>+ {settings.showNodeToolbar &&+ <NodeToolbar+ isVisible={data.forceToolbarVisible || undefined}+ position={Position.Top}+ >+ <Card data-radius='full' className='!p-1'>+ <Flex gap={"1"}>+ <Button variant='soft' onClick={() => handleOpenIndividualModal(data.id)}><EditIcon className='h-4 w-4' />Edit</Button>+ <Button variant='soft' onClick={() => setOpenChat(true)}><ZapIcon color='orange' className='h-4 w-4' />Ask AI</Button>+ </Flex>+ </Card>+ </NodeToolbar>}<ContextMenu.Root><ContextMenu.Trigger onContextMenu={(e) => { e.stopPropagation() }}>- <Box className={cn(loading ? "!opacity-40" : "!opacity-100")}>{settings.showNodeLabel && showContent ?- <Card onDoubleClick={() => handleOpenIndividualModal(data.id)} className={cn('!py-1 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>- <Flex gap="2" align="center">+ <Box className={cn(loading ? "!opacity-40" : "!opacity-100", "overflow-hidden")}>{settings.showNodeLabel && showContent ?+ <Card data-radius='full' onDoubleClick={() => handleOpenIndividualModal(data.id)} className={cn('!p-1 !pr-2 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>+ <Flex gap="2" align="center" className='rounded-full'><Avatarcolor='gray'- size="2"+ size="1"src={data?.image_url}radius="full"fallback={loading ? <Spinner /> : data.full_name[0]}@@ -44,6 +56,7 @@ function Custom(props: any) {<Tooltip content={data.full_name}><button onDoubleClick={() => handleOpenIndividualModal(data.id)} className={cn('rounded-full border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}><Avatar+ color='gray'size="3"src={data?.image_url}radius="full"diff --git a/src/components/investigations/nodes/ip_address.tsx b/src/components/investigations/nodes/ip_address.tsxindex 60cd96a3..76520b55 100644--- a/src/components/investigations/nodes/ip_address.tsx+++ b/src/components/investigations/nodes/ip_address.tsx@@ -21,7 +21,7 @@ function Custom({ data }: any) {<ContextMenu.Trigger><Box className={cn(loading ? "!opacity-40" : "!opacity-100")}>{settings.showNodeLabel && showContent ?- <Card className={cn('border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>+ <Card data-radius='full' className={cn('!pr-4 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}><Inset><Flex className='items-center p-0'><Badge color='orange' className='!h-[24px] !rounded-r-none'>diff --git a/src/components/investigations/nodes/phone.tsx b/src/components/investigations/nodes/phone.tsxindex 8bc09f6d..59b394d7 100644--- a/src/components/investigations/nodes/phone.tsx+++ b/src/components/investigations/nodes/phone.tsx@@ -21,7 +21,7 @@ function Custom({ data }: any) {<ContextMenu.Trigger><Box className={cn(loading ? "!opacity-40" : "!opacity-100")}>{settings.showNodeLabel && showContent ?- <Card className={cn('border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>+ <Card data-radius='full' className={cn('!pr-4 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}><Inset><Flex className='items-center p-0'><Badge color='violet' className='!h-[24px] !rounded-r-none'>diff --git a/src/components/investigations/nodes/physical_address.tsx b/src/components/investigations/nodes/physical_address.tsxindex c734eeed..66e69d2b 100644--- a/src/components/investigations/nodes/physical_address.tsx+++ b/src/components/investigations/nodes/physical_address.tsx@@ -20,7 +20,7 @@ function AddressNode({ data }: any) {<ContextMenu.Trigger><Box className={cn(loading ? "!opacity-40" : "!opacity-100")}>{settings.showNodeLabel && showContent ?- <Card className={cn('border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>+ <Card data-radius='full' className={cn('!pr-4 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}><Inset><Flex className='items-center p-0'><Badge color='ruby' className='!h-[24px] !rounded-r-none'>diff --git a/src/components/investigations/nodes/social.tsx b/src/components/investigations/nodes/social.tsxindex a1f21576..6d9a0230 100644--- a/src/components/investigations/nodes/social.tsx+++ b/src/components/investigations/nodes/social.tsx@@ -23,7 +23,7 @@ function Custom({ data }: any) {<ContextMenu.Trigger><Box className={cn(loading ? "!opacity-40" : "!opacity-100")}>{settings.showNodeLabel && showContent ?- <Card className={cn('border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}>+ <Card data-radius='full' className={cn('!pr-4 border border-transparent hover:border-sky-400', currentNode === data.id && "border-sky-400")}><Inset><Flex className='items-center p-0'>{/* @ts-ignore */}diff --git a/styles/globals.css b/styles/globals.cssindex f1d8c73c..9d979b1e 100644--- a/styles/globals.css+++ b/styles/globals.css@@ -1 +1,7 @@@import "tailwindcss";++[data-radius='full'] {+ --radius-factor: 3!important;+ --radius-full: 999999px!important;+ --radius-thumb: 999999px!important;+}\ No newline at end of file