|
|
@ -83,18 +83,8 @@ const StatusWithStatusIndicator = withStatusIndicator(StatusContent);
|
|
|
|
|
|
|
|
|
|
|
|
StatusContent.displayName = 'Status';
|
|
|
|
StatusContent.displayName = 'Status';
|
|
|
|
|
|
|
|
|
|
|
|
const Status: FC = () => {
|
|
|
|
const StatusResult: FC<{ fetchPath: string; title: string; agentMode: boolean }> = ({ fetchPath, title, agentMode }) => {
|
|
|
|
const pathPrefix = usePathPrefix();
|
|
|
|
const { response, isLoading, error } = useFetch(fetchPath);
|
|
|
|
const path = `${pathPrefix}/${API_PATH}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
{[
|
|
|
|
|
|
|
|
{ fetchResult: useFetch<Record<string, string>>(`${path}/status/runtimeinfo`), title: 'Runtime Information' },
|
|
|
|
|
|
|
|
{ fetchResult: useFetch<Record<string, string>>(`${path}/status/buildinfo`), title: 'Build Information' },
|
|
|
|
|
|
|
|
{ fetchResult: useFetch<Record<string, string>>(`${path}/alertmanagers`), title: 'Alertmanagers' },
|
|
|
|
|
|
|
|
].map(({ fetchResult, title }) => {
|
|
|
|
|
|
|
|
const { response, isLoading, error } = fetchResult;
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<StatusWithStatusIndicator
|
|
|
|
<StatusWithStatusIndicator
|
|
|
|
key={title}
|
|
|
|
key={title}
|
|
|
@ -105,6 +95,23 @@ const Status: FC = () => {
|
|
|
|
componentTitle={title}
|
|
|
|
componentTitle={title}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Status: FC<{ agentMode: boolean }> = ({ agentMode }) => {
|
|
|
|
|
|
|
|
const pathPrefix = usePathPrefix();
|
|
|
|
|
|
|
|
const path = `${pathPrefix}/${API_PATH}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 <StatusResult fetchPath={fetchPath} title={title} agentMode={agentMode} />;
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|