Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Settings from './pages/Settings'
import Scans from './pages/Scans'
import TaskDetails from './pages/TaskDetails'
import Workflows from './pages/Workflows'

import AssetInventory from './pages/AssetInventory'
import { ThemeProvider } from './components/ThemeContext'
import { ToastProvider, ToastContainer } from './components/ToastContext'
import { I18nProvider } from './components/I18nContext'
Expand All @@ -26,7 +26,7 @@ export function AppRoutes() {
<Route path={routes.scans} element={<Scans />} />
<Route path={routes.reports} element={<Reports />} />
<Route path={routes.workflows} element={<Workflows />} />
<Route path={routes.settings} element={<Settings />} />
<Route path={routes.inventory} element={<AssetInventory />} />
<Route path={routes.task} element={<TaskDetails />} />

<Route path="*" element={<Navigate to={routes.dashboard} replace />} />
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ export function startTask(plugin_id: string, inputs: Record<string, unknown>, co
body: JSON.stringify({ plugin_id, inputs, consent_granted, preset }),
})
}

export function getAssets() {
return request('/assets')
}
export function deleteTask(taskId: string) {
return request<{ task_id: string; deleted: boolean }>(`/task/${taskId}`, {
method: 'DELETE',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function AppShell({ children }: AppShellProps) {
{ to: routes.reports, label: 'Reports' },
{ to: routes.workflows, label: 'Workflows' },
{ to: routes.toolkit, label: 'Toolkit' },
{ to: routes.settings, label: 'Settings' },
{ to: routes.inventory, label: 'Inventory' },
]


Expand Down
63 changes: 63 additions & 0 deletions frontend/src/components/ScanHistory.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { useEffect, useState } from "react";
import { getTasks } from "../api";

interface ScanMeta {
task_id: string;
tool_name: string;
target: string;
status: string;
created_at: string;
duration_seconds?: number;
}

interface Props {
onSelect: (taskId: string) => void;
activeTaskId?: string;
}

export function ScanHistory({ onSelect, activeTaskId }: Props) {
const [history, setHistory] = useState<ScanMeta[]>([]);

useEffect(() => {
const params = new URLSearchParams({ per_page: "20", page: "1" });
getTasks(params)
.then((data: any) => setHistory(data.tasks || []))
.catch(console.error);
}, []);

if (history.length === 0) {
return (
<div className="text-silver/40 text-xs font-mono uppercase tracking-[0.15em] p-4">
No past scans found.
</div>
);
}

return (
<div className="flex flex-col gap-1 p-2">
<h3 className="text-[10px] font-black uppercase tracking-[0.2em] text-silver/40 px-2 mb-1">
Load Past Scan
</h3>
{history.map((scan) => (
<button
key={scan.task_id}
onClick={() => onSelect(scan.task_id)}
className={`text-left rounded-md px-3 py-2 text-sm transition-colors ${
activeTaskId === scan.task_id
? "bg-silver-bright/10 text-silver-bright border-l-2 border-rag-red"
: "text-silver/70 hover:bg-silver-bright/5 hover:text-silver-bright"
}`}
>
<div className="font-medium truncate">{scan.target || scan.tool_name}</div>
<div className="text-xs text-muted-foreground flex gap-2 mt-0.5">
<span>{new Date(scan.created_at).toLocaleDateString()}</span>
<span>·</span>
<span className={scan.status === "completed" ? "text-green-500" : scan.status === "failed" ? "text-red-500" : ""}>
{scan.status}
</span>
</div>
</button>
))}
</div>
);
}
2 changes: 1 addition & 1 deletion frontend/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default function Sidebar() {
<NavItem to={routes.scans} icon="history" label="Registry" isExpanded={isExpanded} />

<NavSection label="Analyze" isExpanded={isExpanded} />
<NavItem to={routes.findings} icon="emergency_home" label="Findings" isExpanded={isExpanded} />
<NavItem to={routes.inventory} icon="inventory_2" label="Inventory" isExpanded={isExpanded} />

<NavItem to={routes.reports} icon="summarize" label="Reports" isExpanded={isExpanded} />
<NavItem to={routes.workflows} icon="account_tree" label="Workflows" isExpanded={isExpanded} />
Expand Down
Loading
Loading