Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: status

dextmorgn9260175a0b63
diff --git a/flowsint-web/src/app/api/investigations/route.ts b/flowsint-web/src/app/api/investigations/route.ts
index b50b1a1b..e54fca2b 100644
--- a/flowsint-web/src/app/api/investigations/route.ts
+++ b/flowsint-web/src/app/api/investigations/route.ts
@@ -12,7 +12,7 @@ export async function GET() {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 })
}
const { data: investigations, error } = await supabase.from("investigations")
- .select("*, sketches(*), owner_id, members:investigations_profiles(profile:profiles(id, first_name, last_name), role)")
+ .select("*, sketches(*), status, owner_id, members:investigations_profiles(profile:profiles(id, first_name, last_name), role)")
if (error) {
return NextResponse.json({ error: error.message }, { status: 500 })
}
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx
index d60cbde0..1c843b06 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/page.tsx
@@ -64,6 +64,15 @@ const DashboardPage = () => {
<InvestigationNavigation investigation_id={investigation_id as string} />
</div>
<div className="w-full space-y-8 container mx-auto py-12 px-8">
+ <div className="flex items-center justify-between">
+ <div>
+ <h1 className="font-semibold text-2xl">{investigation?.name}</h1>
+ <p>{investigation?.description}</p>
+ </div>
+ <div>
+ <AvatarList size="lg" users={investigation?.members?.map(({ profile }: { profile: { first_name: string, last_name: string, id: string } }) => ({ id: profile.id, name: `${profile.first_name} ${profile.last_name}`, owner: profile.id === investigation.owner_id })) || []} />
+ </div>
+ </div>
<SectionCards />
<div className="flex items-center gap-2 justify-between mb-6">
<div className="relative w-full max-w-md">
@@ -139,7 +148,7 @@ const DashboardPage = () => {
<TableRow key={sketch.id}>
<TableCell>
<Link href={`/dashboard/investigations/${sketch.investigation_id}/sketches/${sketch.id}`} className="flex items-center gap-2 hover:underline">
- <Waypoints className="h-5 w-5 text-primary" />
+ <Waypoints className="h-5 w-5 text-muted-foreground opacity-60" />
<span>{sketch.title}</span>
</Link>
</TableCell>
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/map/page.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/map/page.tsx
index 9c48a8ee..84ebd67d 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/map/page.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/map/page.tsx
@@ -22,7 +22,6 @@ export default function MapPage() {
if (width < 1024) return 60 // Medium screens
return 80 // Large screens
}
-
return (
<div className="flex flex-col grow w-full">
<div id="map-container" className="grow w-full relative overflow-hidden">
diff --git a/flowsint-web/src/app/dashboard/page.tsx b/flowsint-web/src/app/dashboard/page.tsx
index 20ae67f2..e82a2892 100644
--- a/flowsint-web/src/app/dashboard/page.tsx
+++ b/flowsint-web/src/app/dashboard/page.tsx
@@ -18,6 +18,7 @@ import { AvatarList } from "@/components/avatar-list"
import { cn } from "@/lib/utils"
import { SubNav } from "@/components/dashboard/sub-nav"
import { Card } from "@/components/ui/card"
+import StatusBadge from "@/components/investigations/status-badge"
const DashboardPage = () => {
const [searchQuery, setSearchQuery] = useState("")
@@ -138,6 +139,7 @@ const DashboardPage = () => {
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
+ <TableHead className="hidden md:table-cell">Status</TableHead>
<TableHead className="hidden md:table-cell">Size</TableHead>
<TableHead className="hidden sm:table-cell">Last modified</TableHead>
<TableHead className="hidden sm:table-cell">Members</TableHead>
@@ -164,10 +166,13 @@ const DashboardPage = () => {
<TableRow key={investigation.id}>
<TableCell>
<Link href={`dashboard/investigations/${investigation.id}`} className="flex items-center gap-2 hover:underline">
- <FolderLockIcon className="h-5 w-5 text-primary" />
+ <FolderLockIcon className="h-5 w-5 text-muted-foreground opacity-60" />
<span>{investigation.name}</span>
</Link>
</TableCell>
+ <TableCell className="hidden md:table-cell text-muted-foreground">
+ <StatusBadge status={investigation.status as string} />
+ </TableCell>
<TableCell className="hidden md:table-cell text-muted-foreground">
{(investigation.sketches?.length || 0) > 0 ? `${investigation.sketches.length} items` : "Empty"}
</TableCell>
diff --git a/flowsint-web/src/components/avatar-list.tsx b/flowsint-web/src/components/avatar-list.tsx
index 695339f3..b1c7a4a3 100644
--- a/flowsint-web/src/components/avatar-list.tsx
+++ b/flowsint-web/src/components/avatar-list.tsx
@@ -47,8 +47,8 @@ export function AvatarList({
more: "h-8 w-8 text-sm",
},
lg: {
- avatar: "h-10 w-10",
- container: "space-x-[-15px]",
+ avatar: "h-8 w-8",
+ container: "space-x-[-10px]",
more: "h-10 w-10 text-base",
},
}
diff --git a/flowsint-web/src/components/dashboard/recent-sketches.tsx b/flowsint-web/src/components/dashboard/recent-sketches.tsx
index 43581517..63289ee0 100644
--- a/flowsint-web/src/components/dashboard/recent-sketches.tsx
+++ b/flowsint-web/src/components/dashboard/recent-sketches.tsx
@@ -70,12 +70,15 @@ const RecentSketches = () => {
</div>
<div className="w-full truncate">
<h3 className="font-medium w-full truncate text-ellispsis transition-colors">
- {sketch?.investigation?.name}<span className="mx-1 opacity-40 text-sm">/</span>{sketch.title}
+ {sketch.title}
</h3>
- <span className="text-xs opacity-60">Last updated {formatDistanceToNow(sketch.last_updated_at, { addSuffix: true })}</span>
+ <div>
+ <span className="opacity-60 block text-xs">{sketch?.investigation?.name}</span>
+ </div>
</div>
</div>
- <div className="flex items-center justify-end">
+ <div className="flex items-center justify-between gap-2">
+ <span className="text-xs block truncate text-ellipsis opacity-60">Last updated {formatDistanceToNow(sketch.last_updated_at, { addSuffix: true })}</span>
<AvatarList users={sketch?.members?.map(({ profile }: { profile: { first_name: string, last_name: string, id: string } }) => ({ id: profile.id, name: `${profile.first_name} ${profile.last_name}`, owner: profile.id === sketch.owner_id })) || []} size="sm" />
</div>
</CardContent>
diff --git a/flowsint-web/src/components/investigations/status-badge.tsx b/flowsint-web/src/components/investigations/status-badge.tsx
new file mode 100644
index 00000000..65033977
--- /dev/null
+++ b/flowsint-web/src/components/investigations/status-badge.tsx
@@ -0,0 +1,35 @@
+import { Activity, CheckIcon, Hourglass, Package } from 'lucide-react'
+import React from 'react'
+import { Badge } from '../ui/badge'
+import { cn } from '@/lib/utils';
+const statuses = {
+ "active": {
+ "icon": Activity,
+ "className": "bg-gradient-to-br from-slate-50 to-slate-100 border-slate-200 shadow dark:from-slate-800 text-slate-700 dark:text-slate-100 dark:to-slate-900 dark:border-slate-700 dark:shadow-slate-900/30",
+ },
+ "pending": {
+ "icon": Hourglass,
+ "className": "bg-gradient-to-br from-violet-50 to-violet-100 border-ovioletrange-200 shadow dark:from-violet-800 text-violet-700 dark:text-violet-100 dark:to-violet-900 dark:border-violet-700 dark:shadow-violet-900/30",
+ },
+ "archived": {
+ "icon": Package,
+ "className": "bg-gradient-to-br from-orange-50 to-orange-100 border-orange-200 shadow dark:from-orange-800 text-orange-700 dark:text-orange-100 dark:to-orange-900 dark:border-orange-700 dark:shadow-orange-900/30",
+ },
+ "closed": {
+ "icon": CheckIcon,
+ "className": "bg-gradient-to-br from-green-50 to-green-100 border-green-200 shadow dark:from-green-800 text-green-700 dark:text-green-100 dark:to-green-900 dark:border-green-700 dark:shadow-green-900/30",
+ }
+} as const;
+
+
+const StatusBadge = ({ status }: { status: string }) => {
+
+ const statusFound = statuses[status.toLowerCase() as "active" || "pending" || "archived" || "close"] || statuses["active"]
+ const Icon = statusFound.icon
+
+ return (
+ <Badge variant="outline" className={cn('opacity-60 flex items-center gap-1')}>{status} <Icon /></Badge>
+ )
+}
+
+export default StatusBadge
\ No newline at end of file
diff --git a/flowsint-web/src/components/sketches/new-actions.tsx b/flowsint-web/src/components/sketches/new-actions.tsx
index 89ccf1cb..0355514e 100644
--- a/flowsint-web/src/components/sketches/new-actions.tsx
+++ b/flowsint-web/src/components/sketches/new-actions.tsx
@@ -80,8 +80,10 @@ export default function NewActions({ addNodes, children }: { addNodes: any, chil
setError(null)
} catch (error) {
toast.error("An unexpected error occurred")
+ setOpenActionDialog(false)
} finally {
setLoading(false)
+ setOpenActionDialog(false)
}
}
diff --git a/flowsint-web/src/components/sketches/panel-context-menu.tsx b/flowsint-web/src/components/sketches/panel-context-menu.tsx
index 34ead18b..8cc4db98 100644
--- a/flowsint-web/src/components/sketches/panel-context-menu.tsx
+++ b/flowsint-web/src/components/sketches/panel-context-menu.tsx
@@ -73,12 +73,13 @@ export default function PanelContextMenu({ addNodes }: { addNodes: any }) {
}
addNodes(newNode)
setCurrentNode(newNode)
- setOpenNodeModal(false)
setError(null)
+ toast.success("Node successfully created.")
} catch (error) {
- toast.error("An unexpected error occurred")
+ toast.error("An unexpected error occurred.")
} finally {
setLoading(false)
+ setOpenNodeModal(false)
}
}
const navigateToSubItems = (item: ActionItem) => {
diff --git a/flowsint-web/src/types/investigation.ts b/flowsint-web/src/types/investigation.ts
index 90bfbcde..9c79db7a 100644
--- a/flowsint-web/src/types/investigation.ts
+++ b/flowsint-web/src/types/investigation.ts
@@ -10,4 +10,5 @@ export interface Investigation {
owner: any
owner_id: string,
members?: any[]
+ status: string
}
\ No newline at end of file