refactor(web): update layout and styling in c-tabs-2 and DashboardPage
Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m30s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 2m0s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 6s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m30s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 2m0s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 6s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
- Changed CardContent and inner divs in c-tabs-2 to use flexbox for improved spacing and layout consistency. - Refactored KPI card creation in DashboardPage to eliminate useMemo, simplifying the code structure and enhancing readability. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -121,58 +121,46 @@ function DashboardPage() {
|
||||
)
|
||||
}, [isLoading, summary, statusChartData, groupChartData, domains, groups])
|
||||
|
||||
const kpiCards = useMemo<KpiStatCard[]>(
|
||||
() => [
|
||||
{
|
||||
id: 'domains',
|
||||
label: 'Домены',
|
||||
value: domains?.length ?? 0,
|
||||
hint:
|
||||
ungroupedCount > 0
|
||||
? `${ungroupedCount} без группы`
|
||||
: 'Все в группах',
|
||||
to: '/domains',
|
||||
},
|
||||
{
|
||||
id: 'groups',
|
||||
label: 'Группы',
|
||||
value: groups?.length ?? 0,
|
||||
hint: `${groupChartData.filter((g) => g.count > 0).length} с зонами`,
|
||||
to: '/groups',
|
||||
},
|
||||
{
|
||||
id: 'services',
|
||||
label: 'Сервисы',
|
||||
value: serviceCount,
|
||||
hint: serviceData?.ungrouped.length
|
||||
? `${serviceData.ungrouped.length} без группы`
|
||||
: undefined,
|
||||
to: '/services',
|
||||
search: { domainId: undefined },
|
||||
},
|
||||
{
|
||||
id: 'certs',
|
||||
label: 'Сертификаты',
|
||||
value: certs?.length ?? 0,
|
||||
hint:
|
||||
certWarnings > 0
|
||||
? `${certOk} в норме · ${certWarnings} внимания`
|
||||
: `${certOk} в норме`,
|
||||
to: '/certificates',
|
||||
},
|
||||
],
|
||||
[
|
||||
domains?.length,
|
||||
ungroupedCount,
|
||||
groups?.length,
|
||||
groupChartData,
|
||||
serviceCount,
|
||||
serviceData?.ungrouped.length,
|
||||
certs?.length,
|
||||
certWarnings,
|
||||
certOk,
|
||||
],
|
||||
)
|
||||
const ungroupedServiceCount = serviceData?.ungrouped.length ?? 0
|
||||
const kpiCards: KpiStatCard[] = [
|
||||
{
|
||||
id: 'domains',
|
||||
label: 'Домены',
|
||||
value: domains?.length ?? 0,
|
||||
hint:
|
||||
ungroupedCount > 0
|
||||
? `${ungroupedCount} без группы`
|
||||
: 'Все в группах',
|
||||
to: '/domains',
|
||||
},
|
||||
{
|
||||
id: 'groups',
|
||||
label: 'Группы',
|
||||
value: groups?.length ?? 0,
|
||||
hint: `${groupChartData.filter((g) => g.count > 0).length} с зонами`,
|
||||
to: '/groups',
|
||||
},
|
||||
{
|
||||
id: 'services',
|
||||
label: 'Сервисы',
|
||||
value: serviceCount,
|
||||
hint: ungroupedServiceCount
|
||||
? `${ungroupedServiceCount} без группы`
|
||||
: undefined,
|
||||
to: '/services',
|
||||
search: { domainId: undefined },
|
||||
},
|
||||
{
|
||||
id: 'certs',
|
||||
label: 'Сертификаты',
|
||||
value: certs?.length ?? 0,
|
||||
hint:
|
||||
certWarnings > 0
|
||||
? `${certOk} в норме · ${certWarnings} внимания`
|
||||
: `${certOk} в норме`,
|
||||
to: '/certificates',
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<PageShell>
|
||||
|
||||
Reference in New Issue
Block a user