From 83a71c9c49c8fad2561079da357cc18daa208464 Mon Sep 17 00:00:00 2001 From: gujiangjiang Date: Wed, 8 Oct 2025 05:01:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Navbar.tsx | 62 ++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index 42b0b39..c8468f4 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -5,6 +5,7 @@ import { Button, Avatar, AvatarImage, + AvatarFallback, DropdownMenu, DropdownMenuContent, DropdownMenuItem, @@ -23,7 +24,7 @@ import { PieChartIcon, BellIcon, HamburgerMenuIcon, - DownloadIcon + DownloadIcon, } from "@radix-ui/react-icons"; import { useAuth } from "../providers/AuthProvider"; import { useState, useEffect } from "react"; @@ -66,17 +67,13 @@ const Navbar = () => { return ( - + - + {/* 移动端屏幕菜单栏 */} - { isAuthenticated ? ( - <> + {isAuthenticated ? ( + <> @@ -85,10 +82,14 @@ const Navbar = () => { - navigate("/dashboard")}> + navigate("/dashboard")} + > - {t("navbar.dashboard")} + + {t("navbar.dashboard")} + navigate("/monitors")}> @@ -107,13 +108,19 @@ const Navbar = () => { - navigate("/status/config")}> + navigate("/status/config")} + > - {t("navbar.statusPage")} + + {t("navbar.statusPage")} + - navigate("/notifications")}> + navigate("/notifications")} + > @@ -133,16 +140,18 @@ const Navbar = () => { - + - ) : null } - + ) : null} {/* Logo 部分 */} - + - + @@ -239,7 +248,10 @@ const Navbar = () => { - + {/* 语言选择器 */} @@ -255,10 +267,18 @@ const Navbar = () => { > + + {user?.username ? ( + user.username.charAt(0).toUpperCase() + ) : ( + + )} + {user?.username} @@ -325,4 +345,4 @@ const Navbar = () => { ); }; -export default Navbar; +export default Navbar; \ No newline at end of file