From 2828313f719e710fd7570fb9339f2840d673836b Mon Sep 17 00:00:00 2001 From: Nitpicks Agent Date: Thu, 31 Jul 2025 09:35:55 +0000 Subject: [PATCH] feat: improve dashboard layout consistency and spacing --- ui/app/(prowler)/page.tsx | 30 +++--- .../findings-by-severity-chart.tsx | 98 +++++++++---------- .../skeleton-findings-severity-chart.tsx | 16 +-- .../findings-by-status-chart.tsx | 6 +- .../skeleton-findings-status-chart.tsx | 22 +++-- .../provider-overview/provider-overview.tsx | 10 +- .../skeleton-provider-overview.tsx | 16 +-- 7 files changed, 104 insertions(+), 94 deletions(-) diff --git a/ui/app/(prowler)/page.tsx b/ui/app/(prowler)/page.tsx index 9e949983b7..378dacf27d 100644 --- a/ui/app/(prowler)/page.tsx +++ b/ui/app/(prowler)/page.tsx @@ -36,19 +36,19 @@ export default function Home({
-
+
}>
-
+
}>
-
+
}> @@ -72,10 +72,12 @@ const SSRProvidersOverview = async () => { const providersOverview = await getProvidersOverview({}); return ( - <> +

Providers Overview

- - +
+ +
+
); }; @@ -95,10 +97,12 @@ const SSRFindingsByStatus = async ({ const findingsByStatus = await getFindingsByStatus({ filters }); return ( - <> +

Findings by Status

- - +
+ +
+
); }; @@ -118,10 +122,12 @@ const SSRFindingsBySeverity = async ({ const findingsBySeverity = await getFindingsBySeverity({ filters }); return ( - <> +

Findings by Severity

- - +
+ +
+
); }; diff --git a/ui/components/overview/findings-by-severity-chart/findings-by-severity-chart.tsx b/ui/components/overview/findings-by-severity-chart/findings-by-severity-chart.tsx index ae4d704731..4a176c0580 100644 --- a/ui/components/overview/findings-by-severity-chart/findings-by-severity-chart.tsx +++ b/ui/components/overview/findings-by-severity-chart/findings-by-severity-chart.tsx @@ -71,59 +71,57 @@ export const FindingsBySeverityChart = ({ return ( - -
- - + + + + chartConfig[value as keyof typeof chartConfig]?.label + } + /> + + + + } + /> + - - chartConfig[value as keyof typeof chartConfig]?.label + radius={12} + barSize={20} + onClick={(data) => { + const severity = data.severity as keyof typeof chartConfig; + const link = chartConfig[severity]?.link; + if (link) { + window.location.href = link; } + }} + style={{ cursor: "pointer" }} + > + - - - - } - /> - { - const severity = data.severity as keyof typeof chartConfig; - const link = chartConfig[severity]?.link; - if (link) { - window.location.href = link; - } - }} - style={{ cursor: "pointer" }} - > - - - - -
+ + +
); diff --git a/ui/components/overview/findings-by-severity-chart/skeleton-findings-severity-chart.tsx b/ui/components/overview/findings-by-severity-chart/skeleton-findings-severity-chart.tsx index e3eb51b49f..164ff102c6 100644 --- a/ui/components/overview/findings-by-severity-chart/skeleton-findings-severity-chart.tsx +++ b/ui/components/overview/findings-by-severity-chart/skeleton-findings-severity-chart.tsx @@ -2,14 +2,15 @@ import { Card, CardBody, CardHeader, Skeleton } from "@nextui-org/react"; export const SkeletonFindingsBySeverityChart = () => { return ( - - - -
+
+
+ +
- - -
+
+ + +
{/* Critical */}
@@ -58,5 +59,6 @@ export const SkeletonFindingsBySeverityChart = () => {
+
); }; diff --git a/ui/components/overview/findings-by-status-chart/findings-by-status-chart.tsx b/ui/components/overview/findings-by-status-chart/findings-by-status-chart.tsx index f928c1fee9..949a6afcb4 100644 --- a/ui/components/overview/findings-by-status-chart/findings-by-status-chart.tsx +++ b/ui/components/overview/findings-by-status-chart/findings-by-status-chart.tsx @@ -120,11 +120,11 @@ export const FindingsByStatusChart: React.FC = ({ return ( - +
} /> @@ -170,7 +170,7 @@ export const FindingsByStatusChart: React.FC = ({ -
+
{ return ( - - - -
+
+
+ +
- - -
+
+ + +
{/* Circle Chart Skeleton */} - -
+ +
{/* Text Details Skeleton */} -
+
{/* Pass Findings */}
@@ -50,5 +51,6 @@ export const SkeletonFindingsByStatusChart = () => {
+
); }; diff --git a/ui/components/overview/provider-overview/provider-overview.tsx b/ui/components/overview/provider-overview/provider-overview.tsx index 41d518eb8a..daad842f1b 100644 --- a/ui/components/overview/provider-overview/provider-overview.tsx +++ b/ui/components/overview/provider-overview/provider-overview.tsx @@ -49,8 +49,8 @@ export const ProvidersOverview = ({ if (!providersOverview || !Array.isArray(providersOverview.data)) { return ( - -
+ +
Provider @@ -97,8 +97,8 @@ export const ProvidersOverview = ({ return ( - -
+ +
Provider @@ -177,7 +177,7 @@ export const ProvidersOverview = ({
-
+
{ const rows = 4; return ( - - - -
+
+
+ +
- - -
+
+ + +
{/* Header Skeleton */}
@@ -60,5 +61,6 @@ export const SkeletonProvidersOverview = () => {
+
); };