From c4e5100e9eafddaa9609bdfec746736693dd31c6 Mon Sep 17 00:00:00 2001 From: CHENPrime Date: Tue, 3 Jun 2025 09:37:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20Navbar=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BB=A5=E5=A2=9E=E5=BC=BA=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD=E5=92=8C=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=20CreateAgent=20=E5=92=8C=20CreateM?= =?UTF-8?q?onitor=20=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20NotificationsConfig=20=E9=A1=B5=E9=9D=A2=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=94=B9=E5=96=84=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=A1=B5=E9=85=8D=E7=BD=AE=E7=9A=84=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Navbar.tsx | 138 +++++++----------- frontend/src/pages/agents/CreateAgent.tsx | 12 +- frontend/src/pages/monitors/CreateMonitor.tsx | 2 +- .../notifications/NotificationsConfig.tsx | 42 +++--- .../src/pages/status/StatusPageConfig.tsx | 2 +- 5 files changed, 83 insertions(+), 113 deletions(-) diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index 2b177dd..b1e9daf 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -73,93 +73,63 @@ const Navbar = () => { > {/* 移动端屏幕菜单栏 */} - - - - - - - - - - - {t("navbar.dashboard")} + { isAuthenticated ? ( + <> + + + + + - - - - - - - - {t("navbar.apiMonitors")} - - - - - - - - - - {t("navbar.agentMonitors")} - - - - - - - - - {t("navbar.statusPage")} - - - - - - - - - {t("navbar.notifications")} - - - - - - - + + + navigate("/dashboard")}> + + + {t("navbar.dashboard")} + + + navigate("/monitors")}> + + + + {t("navbar.apiMonitors")} + + + + navigate("/agents")}> + + + + {t("navbar.agentMonitors")} + + + + navigate("/status/config")}> + + + {t("navbar.statusPage")} + + + navigate("/notifications")}> + + + + {t("navbar.notifications")} + + + + + + + + + + ) : null } - {/* Logo 部分 */} - + @@ -321,7 +291,7 @@ const Navbar = () => { {/* 语言选择器 */} - + @@ -119,8 +119,8 @@ const CreateAgent = () => { {t("agent.add.generatingToken")} ) : ( <> - - {token} + + {token} - - + + {t("notifications.channels.description")} @@ -642,12 +642,12 @@ const NotificationsConfig = () => { {t("notifications.channels.noChannels")} ) : ( - + {channels.map((channel) => ( - + - - + + {channel.name} {channel.type === "telegram" && channel.config && @@ -715,8 +715,8 @@ const NotificationsConfig = () => { ))} )} - - + + ); @@ -742,8 +742,8 @@ const NotificationsConfig = () => { - - + + {t("notifications.templates.description")} @@ -755,7 +755,7 @@ const NotificationsConfig = () => { ) : ( {templates.map((template) => ( - + @@ -801,7 +801,7 @@ const NotificationsConfig = () => { )} - + ); @@ -823,9 +823,9 @@ const NotificationsConfig = () => { {t("notifications.settings.monitors")} - + - + @@ -844,7 +844,7 @@ const NotificationsConfig = () => { {settings.monitors.enabled && ( - + { {/* 全局客户端通知设置 */} - + {t("notifications.settings.agents")} - + - + @@ -1102,7 +1102,7 @@ const NotificationsConfig = () => { }; return ( - + @@ -1216,7 +1216,7 @@ const NotificationsConfig = () => { }; return ( - + @@ -1766,7 +1766,7 @@ const NotificationsConfig = () => { {loading ? ( {t("common.loading")}... ) : ( - + diff --git a/frontend/src/pages/status/StatusPageConfig.tsx b/frontend/src/pages/status/StatusPageConfig.tsx index 6047296..151bc11 100644 --- a/frontend/src/pages/status/StatusPageConfig.tsx +++ b/frontend/src/pages/status/StatusPageConfig.tsx @@ -250,7 +250,7 @@ const StatusPageConfig = () => { - + {t("statusPageConfig.general")}