From f5648a02ccd4e137ef0a8f0ab8580044dd9b4b27 Mon Sep 17 00:00:00 2001 From: "bingshen.wbs" Date: Mon, 29 Jan 2024 14:36:08 +0800 Subject: [PATCH] bugfix: fix title not update on Login Signed-off-by: bingshen.wbs --- webui/src/pages/capture/index.tsx | 7 +++++++ webui/src/pages/config/index.tsx | 7 +++++++ webui/src/pages/diagnosis/index.tsx | 8 ++++++++ webui/src/pages/index/index.tsx | 6 ++++++ webui/src/pages/monitoring/dashboard/index.tsx | 7 +++++++ webui/src/pages/monitoring/events/index.tsx | 7 +++++++ webui/src/pages/monitoring/flow/index.tsx | 8 ++++++++ webui/src/pages/pingmesh/index.tsx | 7 +++++++ 8 files changed, 57 insertions(+) diff --git a/webui/src/pages/capture/index.tsx b/webui/src/pages/capture/index.tsx index 40f4687a..81b4e03b 100644 --- a/webui/src/pages/capture/index.tsx +++ b/webui/src/pages/capture/index.tsx @@ -6,6 +6,7 @@ import { CaptureTask } from "@/services/capture"; import captureService from "@/services/capture" import { useEffect, useState } from "react"; import { getErrorMessage } from "@/utils"; +import {definePageConfig} from "ice"; const submitCapture = (props, callback) => { const task: CaptureTask = { @@ -76,3 +77,9 @@ export default function Capture() { ) } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Capture', + }; +}); diff --git a/webui/src/pages/config/index.tsx b/webui/src/pages/config/index.tsx index 74fa4219..4f3ea8d7 100644 --- a/webui/src/pages/config/index.tsx +++ b/webui/src/pages/config/index.tsx @@ -7,6 +7,7 @@ import AddDialog, { SelectableItem, Selection } from "./components/AddDialog"; import probeTypes from "./types.json" import { getErrorMessage } from "@/utils" import _ from "lodash" +import {definePageConfig} from "ice"; const METRIC_PROBE = "metric_probe" const EVENT_PROBE = "event_probe" @@ -189,3 +190,9 @@ export default function Config() { ); } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Node Configuration', + }; +}); diff --git a/webui/src/pages/diagnosis/index.tsx b/webui/src/pages/diagnosis/index.tsx index edba4570..1b6e9e17 100644 --- a/webui/src/pages/diagnosis/index.tsx +++ b/webui/src/pages/diagnosis/index.tsx @@ -7,6 +7,7 @@ import { DiagnosisResult, DiagnosisTask } from "@/services/diagnosis" import { Link } from "@ice/runtime" import diagnosisService from '@/services/diagnosis' import { getErrorMessage } from "@/utils" +import {definePageConfig} from "ice"; const makeAction = (d: DiagnosisResult, showMessageDialog: (message: string) => void): JSX.Element | null => { @@ -119,3 +120,10 @@ export default function Diagnosis() { ); } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Diagnose', + }; +}); + diff --git a/webui/src/pages/index/index.tsx b/webui/src/pages/index/index.tsx index 45b6ab59..33cab369 100644 --- a/webui/src/pages/index/index.tsx +++ b/webui/src/pages/index/index.tsx @@ -1,3 +1,9 @@ import FlowDashboard from "../monitoring/flow"; +import {definePageConfig} from "ice"; export default FlowDashboard; +export const pageConfig = definePageConfig(() => { + return { + title: 'Network Graph', + }; +}); diff --git a/webui/src/pages/monitoring/dashboard/index.tsx b/webui/src/pages/monitoring/dashboard/index.tsx index 23b9d44c..7d0647c6 100644 --- a/webui/src/pages/monitoring/dashboard/index.tsx +++ b/webui/src/pages/monitoring/dashboard/index.tsx @@ -4,6 +4,7 @@ import { useEffect, useState } from 'react'; import Exception from '@/components/Exception'; import { Loading, Message } from '@alifd/next'; import store from '@/store' +import {definePageConfig} from "ice"; export default function Dashboard() { const [loading, setLoading] = useState(true) @@ -50,3 +51,9 @@ export default function Dashboard() { ); } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Dashboard', + }; +}); diff --git a/webui/src/pages/monitoring/events/index.tsx b/webui/src/pages/monitoring/events/index.tsx index b79ef716..db8323be 100644 --- a/webui/src/pages/monitoring/events/index.tsx +++ b/webui/src/pages/monitoring/events/index.tsx @@ -10,6 +10,7 @@ import { getErrorMessage } from '@/utils'; import EventList from './components/EventList'; import styles from './index.module.css' import { useRequest } from '@ice/plugin-request/hooks'; +import {definePageConfig} from "ice"; export default function Events() { const [eventData, setEventData] = useState([]); @@ -151,3 +152,9 @@ export default function Events() { ); } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Events', + }; +}); diff --git a/webui/src/pages/monitoring/flow/index.tsx b/webui/src/pages/monitoring/flow/index.tsx index aa345384..901e86fc 100644 --- a/webui/src/pages/monitoring/flow/index.tsx +++ b/webui/src/pages/monitoring/flow/index.tsx @@ -8,6 +8,7 @@ import flowService, { FlowData } from '@/services/flow' import { getErrorMessage } from '@/utils'; import { Dayjs } from 'dayjs'; import * as dayjs from 'dayjs'; +import {definePageConfig} from "ice"; const getNamespaces = (data: any) => { return data.nodes.map((node: any) => { @@ -149,3 +150,10 @@ export default function FlowDashboard() { ); } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Network Graph', + }; +}); + diff --git a/webui/src/pages/pingmesh/index.tsx b/webui/src/pages/pingmesh/index.tsx index 42a0c4f2..2b95f045 100644 --- a/webui/src/pages/pingmesh/index.tsx +++ b/webui/src/pages/pingmesh/index.tsx @@ -5,6 +5,7 @@ import PingForm from "@/pages/pingmesh/pingForm"; import PingGraph from "@/pages/pingmesh/pingGraph"; import pingMeshService from "@/services/pingmesh"; import {getErrorMessage} from "@/utils"; +import {definePageConfig} from "ice"; export default function Capture() { const [latency, setLatency] = useState() @@ -34,3 +35,9 @@ export default function Capture() { ) } + +export const pageConfig = definePageConfig(() => { + return { + title: 'Latency Detection', + }; +});