diff --git a/components/providers/table/column-providers.tsx b/components/providers/table/column-providers.tsx index eb67f731d2..1680fd8000 100644 --- a/components/providers/table/column-providers.tsx +++ b/components/providers/table/column-providers.tsx @@ -1,7 +1,6 @@ "use client"; import { ColumnDef } from "@tanstack/react-table"; -import { add } from "date-fns"; import { DateWithTime, SnippetId } from "@/components/ui/entities"; import { DataTableColumnHeader, StatusBadge } from "@/components/ui/table"; @@ -15,10 +14,10 @@ const getProviderData = (row: { original: ProviderProps }) => { }; export const ColumnProviders: ColumnDef[] = [ - { - header: " ", - cell: ({ row }) =>

{row.index + 1}

, - }, + // { + // header: " ", + // cell: ({ row }) =>

{row.index + 1}

, + // }, { accessorKey: "account", header: ({ column }) => ( @@ -73,27 +72,6 @@ export const ColumnProviders: ColumnDef[] = [ return ; }, }, - { - accessorKey: "nextScan", - header: "Next Scan", - cell: ({ row }) => { - const { - attributes: { updated_at }, - } = getProviderData(row); - const nextDay = add(new Date(updated_at), { - hours: 24, - }); - return ; - }, - }, - { - accessorKey: "resources", - header: "Resources", - cell: () => { - // Temporarily overwriting the value until the API is functional. - return

{288}

; - }, - }, { accessorKey: "added", header: ({ column }) => ( diff --git a/components/scans/table/scan-detail.tsx b/components/scans/table/scan-detail.tsx index 7124a11943..f9c14384ee 100644 --- a/components/scans/table/scan-detail.tsx +++ b/components/scans/table/scan-detail.tsx @@ -1,85 +1,98 @@ "use client"; -import { Card, CardBody, CardHeader, Chip, Divider } from "@nextui-org/react"; +import { Card, CardBody, CardHeader, Divider } from "@nextui-org/react"; +import { DateWithTime, SnippetId } from "@/components/ui/entities"; +import { StatusBadge } from "@/components/ui/table/status-badge"; import { ScanProps } from "@/types"; export const ScanDetail = ({ scanDetails }: { scanDetails: ScanProps }) => { + const scanOnDemand = scanDetails.attributes; return (
- - -

Scan Details

- - {scanDetails.attributes.state} - -
+
+
+

Scan Details -

+

{scanOnDemand.name}

+
- - - -
-
- - - - - - -
-
- - - - - -
+ +
+ +
+
+
+ } + /> + + + +
- - - +
+ + ) : ( + "Not Started" + ) + } + /> + + ) : ( + "Not Started" + ) + } + /> + + ) : ( + "Not Scheduled" + ) + } + /> + + } + /> + + } + /> +
+
+

Scan Arguments

@@ -91,9 +104,9 @@ export const ScanDetail = ({ scanDetails }: { scanDetails: ScanProps }) => {
@@ -102,7 +115,26 @@ export const ScanDetail = ({ scanDetails }: { scanDetails: ScanProps }) => { ); }; -const DetailItem = ({ label, value }: { label: string; value: string }) => ( +const DateItem = ({ + label, + value, +}: { + label: string; + value: React.ReactNode; +}) => ( +
+ {label}: + {value} +
+); + +const DetailItem = ({ + label, + value, +}: { + label: string; + value: React.ReactNode; +}) => (
{label}: {value} diff --git a/components/scans/table/scans/data-table-row-actions.tsx b/components/scans/table/scans/data-table-row-actions.tsx index 336ff37389..195851b68c 100644 --- a/components/scans/table/scans/data-table-row-actions.tsx +++ b/components/scans/table/scans/data-table-row-actions.tsx @@ -31,7 +31,6 @@ export function DataTableRowActions({ row, }: DataTableRowActionsProps) { const [isEditOpen, setIsEditOpen] = useState(false); - // const [isDeleteOpen, setIsDeleteOpen] = useState(false); const scanId = (row.original as { id: string }).id; const scanName = (row.original as any).attributes?.name; return ( @@ -49,16 +48,6 @@ export function DataTableRowActions({ /> - {/* */} - {/*

Hello

*/} - {/* */} - {/*
*/} -
@@ -83,23 +72,6 @@ export function DataTableRowActions({ Edit Scan - {/* - - } - onClick={() => setIsDeleteOpen(true)} - > - Delete Scan - - */}
diff --git a/components/scans/table/schedule-scans/column-get-scans-schedule.tsx b/components/scans/table/schedule-scans/column-get-scans-schedule.tsx index 583a9cdd16..69bb478ecc 100644 --- a/components/scans/table/schedule-scans/column-get-scans-schedule.tsx +++ b/components/scans/table/schedule-scans/column-get-scans-schedule.tsx @@ -42,37 +42,22 @@ export const ColumnGetScansSchedule: ColumnDef[] = [ }, }, { - accessorKey: "started_at", + accessorKey: "scheduled_at", header: ({ column }) => ( ), cell: ({ row }) => { const { - attributes: { started_at }, + attributes: { scheduled_at }, } = getScanData(row); - return ; - }, - }, - { - accessorKey: "lastScan", - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const { - attributes: { completed_at }, - } = getScanData(row); - return ; + return ; }, }, + { id: "moreInfo", header: "Details", diff --git a/components/ui/sheet/trigger-sheet.tsx b/components/ui/sheet/trigger-sheet.tsx index af8a2f988d..e97e2a45a5 100644 --- a/components/ui/sheet/trigger-sheet.tsx +++ b/components/ui/sheet/trigger-sheet.tsx @@ -23,7 +23,7 @@ export function TriggerSheet({ return ( {triggerComponent} - + {title} {description} diff --git a/components/ui/table/status-badge.tsx b/components/ui/table/status-badge.tsx index ca8b3e2a49..c0f0356407 100644 --- a/components/ui/table/status-badge.tsx +++ b/components/ui/table/status-badge.tsx @@ -21,15 +21,23 @@ const statusColorMap: Record< cancelled: "danger", }; -export const StatusBadge = ({ status }: { status: Status }) => { +export const StatusBadge = ({ + status, + size = "sm", + ...props +}: { + status: Status; + size?: "sm" | "md" | "lg"; +}) => { const color = statusColorMap[status as keyof typeof statusColorMap]; return ( {status}