A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat: section-cards
dextmorgn05d412acd133
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsxindex 976eb290..d60cbde0 100644--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx@@ -18,6 +18,7 @@ import { cn } from "@/lib/utils"import { InvestigationNavigation } from "@/components/investigations/investigation-navigation"import { Card } from "@/components/ui/card"import { AvatarList } from "@/components/avatar-list"+import { SectionCards } from "@/components/investigations/section-cards"const DashboardPage = () => {const { investigation_id } = useParams()@@ -63,6 +64,7 @@ const DashboardPage = () => {<InvestigationNavigation investigation_id={investigation_id as string} /></div><div className="w-full space-y-8 container mx-auto py-12 px-8">+ <SectionCards /><div className="flex items-center gap-2 justify-between mb-6"><div className="relative w-full max-w-md"><Search className="absolute left-2.5 top-2.5 h-4 w-4 bg-background text-muted-foreground" />@@ -75,11 +77,6 @@ const DashboardPage = () => {/></div><div className="flex items-center gap-2">- <NewSketch>- <Button size="sm" className="gap-2">- <PlusIcon className="h-4 w-4" /> New- </Button>- </NewSketch><DropdownMenu><DropdownMenuTrigger asChild><Button variant="outline" className="gap-2">@@ -98,6 +95,11 @@ const DashboardPage = () => {<Button onClick={handleRefetch} disabled={isLoading || isRefetching} variant={"outline"} className="gap-2"><RotateCwIcon className={cn("h-4 w-4", isLoading || isRefetching && "animate-spin")} /> Refresh</Button>+ <NewSketch>+ <Button size="sm" className="gap-2">+ <PlusIcon className="h-4 w-4" /> New+ </Button>+ </NewSketch></div></div>{isLoadingInvestigations ? (diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsxindex 11e83886..67512a3c 100644--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsx+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsx@@ -296,7 +296,7 @@ export function DataTable({refetch,isRefetching}: {- data: any[],+ data: any,pageCount: numberpagination: anysetPagination: any@@ -319,7 +319,7 @@ export function DataTable({)const dataIds = React.useMemo<UniqueIdentifier[]>(- () => data?.map(({ id }) => id) || [],+ () => !data?.error && data?.map(({ id }: any) => id) || [],[data])@@ -351,7 +351,7 @@ export function DataTable({function handleDragEnd(event: DragEndEvent) {const { active, over } = eventif (active && over && active.id !== over.id) {- setData((data) => {+ setData((data: any) => {const oldIndex = dataIds.indexOf(active.id)const newIndex = dataIds.indexOf(over.id)return arrayMove(data, oldIndex, newIndex)@@ -494,7 +494,7 @@ export function DataTable({colSpan={columns.length}className="h-24 text-center">- No individual.+ No data yet.</TableCell></TableRow>)}diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/page.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/page.tsxindex 805b2fc8..3a7ef92a 100644--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/page.tsx+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/page.tsx@@ -15,12 +15,12 @@ const IndividualsPage = () => {return response.json()}- const { data, isLoading, isError, refetch, isRefetching } = useQuery({+ const { data, isLoading, error, refetch, isRefetching } = useQuery({queryKey: ['individuals', 'table', sketch_id, pagination.pageIndex, pagination.pageSize],queryFn: fetchIndividuals,})- if (isError) return <div>Error fetching deliveries</div>+ if (error) return <div>Error fetching data.</div>return (<div className="w-full space-y-8 mx-auto py-12 px-8">{isLoading ? <TableSkeleton /> :diff --git a/flowsint-web/src/components/download-button.tsx b/flowsint-web/src/components/download-button.tsxindex a5195909..bb6f55c5 100644--- a/flowsint-web/src/components/download-button.tsx+++ b/flowsint-web/src/components/download-button.tsx@@ -34,7 +34,7 @@ export const DownloadButton = ({ endpoint, name = "sketch" }: { endpoint: string};return (<Button variant={"ghost"} disabled={loading} onClick={handleDownload} className="flex gap-2 h-full text-sm rounded-none">- <Download /> {loading ? <>Loading...</> : <>Download</>}+ {loading ? <Download /> : <Download />}</Button>);};diff --git a/flowsint-web/src/components/investigations/section-cards.tsx b/flowsint-web/src/components/investigations/section-cards.tsxnew file mode 100644index 00000000..8468e7e0--- /dev/null+++ b/flowsint-web/src/components/investigations/section-cards.tsx@@ -0,0 +1,101 @@+import { TrendingDownIcon, TrendingUpIcon } from "lucide-react"++import { Badge } from "@/components/ui/badge"+import {+ Card,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+} from "@/components/ui/card"++export function SectionCards() {+ return (+ <div className="*:data-[slot=card]:shadow-xs grid-cols-2 xl:grid-cols-4 grid grid-cols-1 gap-4">+ <Card className="bg-background">+ <CardHeader className="relative">+ <CardDescription>Total sketches</CardDescription>+ <CardTitle className="@[250px]/card:text-3xl text-2xl font-semibold tabular-nums">+ 23+ </CardTitle>+ <div className="absolute right-4 top-4">+ <Badge variant="outline" className="flex gap-1 rounded-lg text-xs">+ <TrendingUpIcon className="size-3" />+ +3+ </Badge>+ </div>+ </CardHeader>+ <CardFooter className="flex-col items-start gap-1 text-sm">+ <div className="line-clamp-1 flex gap-2 font-medium">+ Trending up this month <TrendingUpIcon className="size-4" />+ </div>+ <div className="text-muted-foreground">+ New sketches created+ </div>+ </CardFooter>+ </Card>+ <Card className="bg-background">+ <CardHeader className="relative">+ <CardDescription>New entities</CardDescription>+ <CardTitle className="@[250px]/card:text-3xl text-2xl font-semibold tabular-nums">+ 237+ </CardTitle>+ <div className="absolute right-4 top-4">+ <Badge variant="outline" className="flex gap-1 rounded-lg text-xs">+ <TrendingDownIcon className="size-3" />+ -20%+ </Badge>+ </div>+ </CardHeader>+ <CardFooter className="flex-col items-start gap-1 text-sm">+ <div className="line-clamp-1 flex gap-2 font-medium">+ Down 20% this period <TrendingDownIcon className="size-4" />+ </div>+ <div className="text-muted-foreground">+ Entities found+ </div>+ </CardFooter>+ </Card>+ <Card className="bg-background">+ <CardHeader className="relative">+ <CardDescription>Verified accounts</CardDescription>+ <CardTitle className="@[250px]/card:text-3xl text-2xl font-semibold tabular-nums">+ 45+ </CardTitle>+ <div className="absolute right-4 top-4">+ <Badge variant="outline" className="flex gap-1 rounded-lg text-xs">+ <TrendingUpIcon className="size-3" />+ +12.5%+ </Badge>+ </div>+ </CardHeader>+ <CardFooter className="flex-col items-start gap-1 text-sm">+ <div className="line-clamp-1 flex gap-2 font-medium">+ Social accounts discovered <TrendingUpIcon className="size-4" />+ </div>+ <div className="text-muted-foreground">Amount of verified social accounts</div>+ </CardFooter>+ </Card>+ <Card className="bg-background">+ <CardHeader className="relative">+ <CardDescription>Collaborators</CardDescription>+ <CardTitle className="@[250px]/card:text-3xl text-2xl font-semibold tabular-nums">+ 3+ </CardTitle>+ <div className="absolute right-4 top-4">+ <Badge variant="outline" className="flex gap-1 rounded-lg text-xs">+ <TrendingUpIcon className="size-3" />+ +2+ </Badge>+ </div>+ </CardHeader>+ <CardFooter className="flex-col items-start gap-1 text-sm">+ <div className="line-clamp-1 flex gap-2 font-medium">+ Active collaborators <TrendingUpIcon className="size-4" />+ </div>+ <div className="text-muted-foreground">Collaborators actively participating</div>+ </CardFooter>+ </Card>+ </div>+ )+}diff --git a/flowsint-web/src/components/sketches/sketch/nodes-panel.tsx b/flowsint-web/src/components/sketches/sketch/nodes-panel.tsxindex bee11a90..837808ce 100644--- a/flowsint-web/src/components/sketches/sketch/nodes-panel.tsx+++ b/flowsint-web/src/components/sketches/sketch/nodes-panel.tsx@@ -149,12 +149,14 @@ const NodesPanel = memo(({ nodes }: { nodes: Node[] }) => {/></div><DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant={"outline"} className="h-7 w-8 relative" size={"icon"}>- <FilterIcon className={cn("opacity-60 h-3 w-3", filters && 'opacity-100')} />- {filters && <Badge className='absolute -top-2 -right-1 text-xs rounded-full h-4 w-4' variant={"default"}>{filters.length}</Badge>}- </Button>- </DropdownMenuTrigger>+ <div>+ <DropdownMenuTrigger asChild>+ <Button variant={"outline"} className="h-7 w-8 relative" size={"icon"}>+ <FilterIcon className={cn("opacity-60 h-3 w-3", filters && 'opacity-100')} />+ {filters && <Badge className='absolute -top-2 -right-1 text-xs rounded-full h-4 w-4' variant={"default"}>{filters.length}</Badge>}+ </Button>+ </DropdownMenuTrigger>+ </div><DropdownMenuContent className="w-48 max-h-[50vh] space-y-1 overflow-y-auto"><DropdownMenuLabel>{filters ? <Badge variant={"outline"} className='flex items-center gap-1 pr-1'>{filters?.length} filter(s)<Button size={"icon"} variant={"ghost"} className='h-5 w-5 rounded-full' onClick={clearFilters}><XIcon className='h-3 w-3' /></Button></Badge> : "filters"}</DropdownMenuLabel><DropdownMenuSeparator />