diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index c1050fd..9685338 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -260,6 +260,8 @@ const en = { }, ne: { title: "Network elements", + showPanel: "Expand", + hidePanel: "Collapse", keywordPh: "keyword(ne_id/ne_name/user_label/ip/host_name)", clearTitle: "Clear keyword and reset to page 1", expand: "Expand details", @@ -267,6 +269,8 @@ const en = { }, alarms: { title: "Current alarms", + showPanel: "Expand", + hidePanel: "Collapse", keywordPh: "keyword(alarm key/cause/ne_name/host_name/ip…)", hostNamePh: "host_name (contains)", allSeverity: "All severities", diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index db65dd3..f1a2d10 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -259,6 +259,8 @@ const zh = { }, ne: { title: "网元清单", + showPanel: "展开", + hidePanel: "收起", keywordPh: "keyword(ne_id/ne_name/user_label/ip/host_name)", clearTitle: "清空 keyword,回到第 1 页", expand: "展开详情", @@ -266,6 +268,8 @@ const zh = { }, alarms: { title: "当前告警", + showPanel: "展开", + hidePanel: "收起", keywordPh: "keyword(告警键/原因/ne_name/host_name/ip 等)", hostNamePh: "host_name(含匹配)", allSeverity: "全部级别", diff --git a/web/src/pages/UmePage.tsx b/web/src/pages/UmePage.tsx index 6e4df9c..6a30171 100644 --- a/web/src/pages/UmePage.tsx +++ b/web/src/pages/UmePage.tsx @@ -34,12 +34,14 @@ export function UmePage() { const [nePage, setNePage] = useState(1); const [nePageSize, setNePageSize] = useState(50); const [expandedNeId, setExpandedNeId] = useState(""); + const [nePanelOpen, setNePanelOpen] = useState(false); const [curSeverity, setCurSeverity] = useState(""); const [curCleared, setCurCleared] = useState(""); const [curHostName, setCurHostName] = useState(""); const [curKeyword, setCurKeyword] = useState(""); const [curPage, setCurPage] = useState(1); const [curPageSize, setCurPageSize] = useState(50); + const [alarmsPanelOpen, setAlarmsPanelOpen] = useState(false); const syncMutation = useMutation({ mutationFn: async (domains: string[]) => apiPost<{ ok: boolean; jobs: unknown[] }>("/v1/ume/sync", { domains }), @@ -700,7 +702,14 @@ export function UmePage() { - {t("ume.ne.title")} + + {t("ume.ne.title")} + setNePanelOpen((x) => !x)}> + {nePanelOpen ? t("ume.ne.hidePanel") : t("ume.ne.showPanel")} + + + {nePanelOpen ? ( + <> setNeKeyword(e.target.value)} /> queryClient.invalidateQueries({ queryKey: queryKeys.umeNEAll })}> @@ -801,10 +810,19 @@ export function UmePage() { + > + ) : null} - {t("ume.alarms.title")} + + {t("ume.alarms.title")} + setAlarmsPanelOpen((x) => !x)}> + {alarmsPanelOpen ? t("ume.alarms.hidePanel") : t("ume.alarms.showPanel")} + + + {alarmsPanelOpen ? ( + <> setCurKeyword(e.target.value)} /> setCurHostName(e.target.value)} /> @@ -903,6 +921,8 @@ export function UmePage() { + > + ) : null} > );