import "@mantine/core/styles.css"; import "@mantine/code-highlight/styles.css"; import "@mantine/notifications/styles.css"; import "@mantine/dates/styles.css"; import classes from "./App.module.css"; import PrometheusLogo from "./images/prometheus-logo.svg"; import { ActionIcon, AppShell, Box, Burger, Button, Group, MantineProvider, Menu, Skeleton, Text, createTheme, rem, } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { IconAdjustments, IconBellFilled, IconChevronDown, IconChevronRight, IconCloudDataConnection, IconDatabase, IconDatabaseSearch, IconFileAnalytics, IconFlag, IconHeartRateMonitor, IconInfoCircle, IconServerCog, IconSettings, } from "@tabler/icons-react"; import { BrowserRouter, NavLink, Navigate, Route, Routes, } from "react-router-dom"; import { IconTable } from "@tabler/icons-react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; // import { ReactQueryDevtools } from "react-query/devtools"; import QueryPage from "./pages/query/QueryPage"; import AlertsPage from "./pages/AlertsPage"; import RulesPage from "./pages/RulesPage"; import TargetsPage from "./pages/TargetsPage"; import ServiceDiscoveryPage from "./pages/ServiceDiscoveryPage"; import StatusPage from "./pages/StatusPage"; import TSDBStatusPage from "./pages/TSDBStatusPage"; import FlagsPage from "./pages/FlagsPage"; import ConfigPage from "./pages/ConfigPage"; import AgentPage from "./pages/AgentPage"; import { Suspense, useContext } from "react"; import ErrorBoundary from "./ErrorBoundary"; import { ThemeSelector } from "./ThemeSelector"; import { SettingsContext } from "./settings"; import { Notifications } from "@mantine/notifications"; const queryClient = new QueryClient(); const monitoringStatusPages = [ { title: "Targets", path: "/targets", icon: , element: , }, { title: "Rules", path: "/rules", icon: , element: , }, { title: "Service discovery", path: "/service-discovery", icon: ( ), element: , }, ]; const serverStatusPages = [ { title: "Runtime & build information", path: "/status", icon: , element: , }, { title: "TSDB status", path: "/tsdb-status", icon: , element: , }, { title: "Command-line flags", path: "/flags", icon: , element: , }, { title: "Configuration", path: "/config", icon: , element: , }, ]; const allStatusPages = [...monitoringStatusPages, ...serverStatusPages]; const theme = createTheme({ colors: { "codebox-bg": [ "#f5f5f5", "#e7e7e7", "#cdcdcd", "#b2b2b2", "#9a9a9a", "#8b8b8b", "#848484", "#717171", "#656565", "#575757", ], }, }); const navLinkIconSize = 15; const navLinkXPadding = "md"; function App() { const [opened, { toggle }] = useDisclosure(); const { agentMode } = useContext(SettingsContext); const navLinks = ( <> {allStatusPages.map((p) => ( } /> ))} } /> Monitoring status {monitoringStatusPages.map((p) => ( {p.title} ))} Server status {serverStatusPages.map((p) => ( {p.title} ))} {/* */} ); return ( Prometheus{agentMode && " Agent"} {navLinks} {} } > Settings {navLinks} {Array.from(Array(10), (_, i) => ( ))} } > } /> } /> } /> } /> {allStatusPages.map((p) => ( ))} {/* */} ); } export default App;