From e6dc99f403133692f5db3279543c4bd510661099 Mon Sep 17 00:00:00 2001 From: shats Date: Sun, 26 Apr 2026 13:56:10 +0700 Subject: [PATCH] Refactor Dashboard and App components to utilize new UI elements - Updated App.jsx to enhance the SidebarInset and main content layout with improved styling. - Refactored Dashboard.jsx to replace traditional HTML elements with Card, CardContent, Button, and Badge components for a more consistent UI. - Improved error handling display and button interactions for better user experience. Made-with: Cursor --- frontend/src/App.jsx | 6 ++-- frontend/src/Dashboard.jsx | 61 +++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 12450d0..1c2838e 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -211,8 +211,8 @@ function MainLayout() { - -
+ +
@@ -237,7 +237,7 @@ function MainLayout() {
-
+
Версия UI: {import.meta?.env?.VITE_APP_VERSION || 'dev'}
diff --git a/frontend/src/Dashboard.jsx b/frontend/src/Dashboard.jsx index b8e6c13..0ff5078 100644 --- a/frontend/src/Dashboard.jsx +++ b/frontend/src/Dashboard.jsx @@ -32,11 +32,14 @@ import LastSaved from './components/LastSaved.jsx'; import Tooltip from './components/Tooltip.jsx'; import Sparkline from './components/Sparkline.jsx'; import { useAlerts } from './contexts/AlertsContext.jsx'; +import { Card, CardContent } from '@/components/ui/card'; +import { Button } from '@/components/ui/button'; +import { Badge } from '@/components/ui/badge'; function StatCard({ icon: _Icon, color, value, title, subtitle, to, trend, previousValue }) { return ( -
-
+ + <_Icon size={32} /> @@ -56,18 +59,18 @@ function StatCard({ icon: _Icon, color, value, title, subtitle, to, trend, previ
{subtitle}
)}
-
+ {to && ( )} - + ); } function MetricCard({ title, value, icon: _Icon, color, description }) { return ( -
-
+ + <_Icon size={32} /> @@ -79,8 +82,8 @@ function MetricCard({ title, value, icon: _Icon, color, description }) {
{description}
)}
-
- + + ); } @@ -357,10 +360,12 @@ function Dashboard() { if (error) { return ( -
- - {error} -
+ + + + {error} + + ); } @@ -377,9 +382,9 @@ function Dashboard() { )} - + )} @@ -389,15 +394,16 @@ function Dashboard() {

Пинг сервисов

- +
@@ -429,28 +435,29 @@ function Dashboard() { Активные оповещения {alerts.length > 0 && ( - {alerts.length} + {alerts.length} )} - +
{alerts.length === 0 && !alertsLoading && ( -
-
+ + Нет активных оповещений -
-
+ + )} {alerts.length > 0 && ( -
+
{alerts.map((alert) => { const Icon = ALERT_ICONS[alert.type] || IconAlertTriangle; @@ -471,7 +478,7 @@ function Dashboard() { ); })}
-
+ )}