diff --git a/web/ui/mantine-ui/src/App.tsx b/web/ui/mantine-ui/src/App.tsx
index 60376ae92a..5592ece217 100644
--- a/web/ui/mantine-ui/src/App.tsx
+++ b/web/ui/mantine-ui/src/App.tsx
@@ -74,12 +74,14 @@ const mainNavPages = [
path: "/query",
icon: ,
element: ,
+ inAgentMode: false,
},
{
title: "Alerts",
path: "/alerts",
icon: ,
element: ,
+ inAgentMode: false,
},
];
@@ -89,18 +91,21 @@ const monitoringStatusPages = [
path: "/targets",
icon: ,
element: ,
+ inAgentMode: true,
},
{
title: "Rule health",
path: "/rules",
icon: ,
element: ,
+ inAgentMode: false,
},
{
title: "Service discovery",
path: "/service-discovery",
icon: ,
element: ,
+ inAgentMode: true,
},
];
@@ -110,29 +115,32 @@ const serverStatusPages = [
path: "/status",
icon: ,
element: ,
+ inAgentMode: true,
},
{
title: "TSDB status",
path: "/tsdb-status",
icon: ,
element: ,
+ inAgentMode: false,
},
{
title: "Command-line flags",
path: "/flags",
icon: ,
element: ,
+ inAgentMode: true,
},
{
title: "Configuration",
path: "/config",
icon: ,
element: ,
+ inAgentMode: true,
},
];
const allStatusPages = [...monitoringStatusPages, ...serverStatusPages];
-const allPages = [...mainNavPages, ...allStatusPages];
const theme = createTheme({
colors: {
@@ -159,7 +167,13 @@ const getPathPrefix = (path: string) => {
path = path.slice(0, -1);
}
- const pagePath = allPages.find((p) => path.endsWith(p.path))?.path;
+ const pagePaths = [
+ ...mainNavPages,
+ ...allStatusPages,
+ { path: "/agent" },
+ ].map((p) => p.path);
+
+ const pagePath = pagePaths.find((p) => path.endsWith(p));
return path.slice(0, path.length - (pagePath || "").length);
};
@@ -176,41 +190,45 @@ function App() {
const navLinks = (
<>
- {mainNavPages.map((p) => (
-
- ))}
+ {mainNavPages
+ .filter((p) => !agentMode || p.inAgentMode)
+ .map((p) => (
+
+ ))}
@@ -350,12 +372,20 @@ function App() {
+
}
/>
- } />
- } />
- } />
+ {agentMode ? (
+ } />
+ ) : (
+ <>
+ } />
+ } />
+ >
+ )}
{allStatusPages.map((p) => (
))}
diff --git a/web/web.go b/web/web.go
index d4d2198d5e..4f65cf39d7 100644
--- a/web/web.go
+++ b/web/web.go
@@ -70,7 +70,6 @@ var reactRouterPaths = []string{
"/service-discovery",
"/status",
"/targets",
- "/starting",
}
// Paths that are handled by the React router when the Agent mode is set.
@@ -367,12 +366,12 @@ func New(logger log.Logger, o *Options) *Handler {
}
homePage := "/graph"
- if o.IsAgent {
- homePage = "/agent"
- }
if o.UseNewUI {
homePage = "/query"
}
+ if o.IsAgent {
+ homePage = "/agent"
+ }
readyf := h.testReady