CI / changes (push) Successful in 11s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Successful in 49s
CI / go (push) Successful in 1m2s
CI / bird2 (push) Successful in 16s
CI / release (push) Successful in 3m57s
Added the AnalyticsDashboardSkeleton component to improve loading states in the dashboard and monitoring pages. Refactored the dashboard to utilize the new skeleton for initial loading, replacing the previous SectionCardsSkeleton. Updated the overview queries to increase job limit from 10 to 100 for better data handling. Enhanced the network and operations components to incorporate new analytics cards, streamlining the user experience and improving data presentation.
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { AlertTriangle, CheckCircle, Info } from 'lucide-react'
|
|
|
|
import { cn } from '@evobgp/ui/lib/utils'
|
|
|
|
import { StatusBadge } from '@/components/status-badge'
|
|
import type { PlatformActivityItem } from '@/lib/metrics'
|
|
|
|
const KIND_ICON = {
|
|
job: Info,
|
|
revision: CheckCircle,
|
|
network: AlertTriangle,
|
|
} as const
|
|
|
|
const KIND_ICON_CLASS = {
|
|
job: 'text-info',
|
|
revision: 'text-success',
|
|
network: 'text-warning',
|
|
} as const
|
|
|
|
export function AnalyticsActivityList({
|
|
items,
|
|
className,
|
|
}: {
|
|
items: PlatformActivityItem[]
|
|
className?: string
|
|
}) {
|
|
if (items.length === 0) {
|
|
return <p className="text-sm text-muted-foreground">Нет недавних событий</p>
|
|
}
|
|
|
|
return (
|
|
<ul className={cn('space-y-3', className)}>
|
|
{items.map((item) => {
|
|
const Icon = KIND_ICON[item.kind]
|
|
return (
|
|
<li key={item.id} className="flex items-start justify-between gap-3">
|
|
<div className="flex min-w-0 items-start gap-2.5">
|
|
<span
|
|
className={cn(
|
|
'mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-full bg-muted/60',
|
|
KIND_ICON_CLASS[item.kind],
|
|
)}
|
|
>
|
|
<Icon className="size-3.5" />
|
|
</span>
|
|
<p className="text-sm leading-snug">{item.message}</p>
|
|
</div>
|
|
<StatusBadge status={item.status} label={item.statusLabel} />
|
|
</li>
|
|
)
|
|
})}
|
|
</ul>
|
|
)
|
|
}
|