diff --git a/web/ui/react-app/src/App.tsx b/web/ui/react-app/src/App.tsx index 8c96a3f73b..7ba77d8f05 100755 --- a/web/ui/react-app/src/App.tsx +++ b/web/ui/react-app/src/App.tsx @@ -103,7 +103,7 @@ const App: FC = ({ consolesLink, agentMode }) => { - + diff --git a/web/ui/react-app/src/pages/status/Status.tsx b/web/ui/react-app/src/pages/status/Status.tsx index 20d2e9e99c..0d37db9619 100644 --- a/web/ui/react-app/src/pages/status/Status.tsx +++ b/web/ui/react-app/src/pages/status/Status.tsx @@ -83,28 +83,35 @@ const StatusWithStatusIndicator = withStatusIndicator(StatusContent); StatusContent.displayName = 'Status'; -const Status: FC = () => { +const StatusResult: FC<{ fetchPath: string; title: string }> = ({ fetchPath, title }) => { + const { response, isLoading, error } = useFetch(fetchPath); + return ( + + ); +}; + +const Status: FC<{ agentMode: boolean }> = ({ agentMode }) => { const pathPrefix = usePathPrefix(); const path = `${pathPrefix}/${API_PATH}`; return ( <> {[ - { fetchResult: useFetch>(`${path}/status/runtimeinfo`), title: 'Runtime Information' }, - { fetchResult: useFetch>(`${path}/status/buildinfo`), title: 'Build Information' }, - { fetchResult: useFetch>(`${path}/alertmanagers`), title: 'Alertmanagers' }, - ].map(({ fetchResult, title }) => { - const { response, isLoading, error } = fetchResult; - return ( - - ); + { fetchPath: `${path}/status/runtimeinfo`, title: 'Runtime Information' }, + { fetchPath: `${path}/status/buildinfo`, title: 'Build Information' }, + { fetchPath: `${path}/alertmanagers`, title: 'Alertmanagers' }, + ].map(({ fetchPath, title }) => { + if (agentMode && title === 'Alertmanagers') { + return null; + } + return ; })} );