CI / changes (push) Successful in 9s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Successful in 52s
CI / go (push) Successful in 59s
CI / bird2 (push) Successful in 15s
CI / release (push) Successful in 4m20s
Refactored the DashboardQuickLinkCard to enhance its structure and presentation by integrating FramePanel. Updated the DashboardQuickLinks component to utilize Frame for better organization, including a header and description. Removed the previous DashboardFramePanel integration in the DashboardComponent to streamline the layout, ensuring a more cohesive user experience.
85 lines
2.7 KiB
TypeScript
85 lines
2.7 KiB
TypeScript
import { Gauge, Network, Play, Plus, Share2, Tags } from 'lucide-react'
|
|
import type { ReactNode } from 'react'
|
|
|
|
import { DashboardQuickLinkCard } from '@/components/dashboard/dashboard-quick-link-card'
|
|
import {
|
|
Frame,
|
|
FrameDescription,
|
|
FrameHeader,
|
|
FrameTitle,
|
|
} from '@/components/reui/frame'
|
|
|
|
type QuickLink = {
|
|
icon: ReactNode
|
|
label: string
|
|
description: string
|
|
to: string
|
|
search?: Record<string, string>
|
|
iconClass: string
|
|
}
|
|
|
|
const LINKS: QuickLink[] = [
|
|
{
|
|
icon: <Plus aria-hidden />,
|
|
label: 'Создать модуль',
|
|
description: 'Новый модуль маршрутизации и источники префиксов.',
|
|
to: '/modules/new',
|
|
iconClass: 'bg-primary text-primary-foreground [&_svg]:text-primary-foreground',
|
|
},
|
|
{
|
|
icon: <Tags aria-hidden />,
|
|
label: 'BGP-сообщества',
|
|
description: 'Справочник communities для политик экспорта.',
|
|
to: '/directories',
|
|
iconClass: 'bg-info text-info-foreground [&_svg]:text-info-foreground',
|
|
},
|
|
{
|
|
icon: <Network aria-hidden />,
|
|
label: 'Сеть',
|
|
description: 'Обзор пиров, спикеров и live-сессий BGP.',
|
|
to: '/network',
|
|
search: { tab: 'overview' },
|
|
iconClass: 'bg-success text-success-foreground [&_svg]:text-success-foreground',
|
|
},
|
|
{
|
|
icon: <Share2 aria-hidden />,
|
|
label: 'Добавить пира',
|
|
description: 'Настройка BGP-соседа и шаблонов сессии.',
|
|
to: '/network',
|
|
search: { tab: 'peers' },
|
|
iconClass: 'bg-warning text-warning-foreground [&_svg]:text-warning-foreground',
|
|
},
|
|
{
|
|
icon: <Play aria-hidden />,
|
|
label: 'Деплой',
|
|
description: 'Ревизии конфигурации и применение на нодах.',
|
|
to: '/operations',
|
|
search: { tab: 'revisions' },
|
|
iconClass: 'bg-focus text-focus-foreground [&_svg]:text-focus-foreground',
|
|
},
|
|
{
|
|
icon: <Gauge aria-hidden />,
|
|
label: 'Мониторинг',
|
|
description: 'Состояние системы, BIRD и PostgreSQL.',
|
|
to: '/monitoring',
|
|
search: { tab: 'system' },
|
|
iconClass: 'bg-destructive text-destructive-foreground [&_svg]:text-destructive-foreground',
|
|
},
|
|
]
|
|
|
|
export function DashboardQuickLinks() {
|
|
return (
|
|
<Frame className="@container w-full">
|
|
<FrameHeader>
|
|
<FrameTitle>Быстрые действия</FrameTitle>
|
|
<FrameDescription>Частые переходы к настройке и деплою</FrameDescription>
|
|
</FrameHeader>
|
|
<div className="grid gap-1 sm:grid-cols-2 xl:grid-cols-3">
|
|
{LINKS.map((link) => (
|
|
<DashboardQuickLinkCard key={link.label} {...link} />
|
|
))}
|
|
</div>
|
|
</Frame>
|
|
)
|
|
}
|