|
@@ -1,6 +1,5 @@
|
|
import React, { Suspense, useCallback } from 'react';
|
|
import React, { Suspense, useCallback } from 'react';
|
|
import { Routes, Route, useLocation } from 'react-router-dom';
|
|
import { Routes, Route, useLocation } from 'react-router-dom';
|
|
-import { GIT_TAG, GIT_COMMIT } from 'lib/constants';
|
|
|
|
import { clusterPath, getNonExactPath } from 'lib/paths';
|
|
import { clusterPath, getNonExactPath } from 'lib/paths';
|
|
import Nav from 'components/Nav/Nav';
|
|
import Nav from 'components/Nav/Nav';
|
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
|
@@ -18,8 +17,9 @@ import Logo from 'components/common/Logo/Logo';
|
|
import GitIcon from 'components/common/Icons/GitIcon';
|
|
import GitIcon from 'components/common/Icons/GitIcon';
|
|
import DiscordIcon from 'components/common/Icons/DiscordIcon';
|
|
import DiscordIcon from 'components/common/Icons/DiscordIcon';
|
|
|
|
|
|
-import { ConfirmContextProvider } from './contexts/ConfirmContext';
|
|
|
|
import ConfirmationModal from './common/ConfirmationModal/ConfirmationModal';
|
|
import ConfirmationModal from './common/ConfirmationModal/ConfirmationModal';
|
|
|
|
+import { ConfirmContextProvider } from './contexts/ConfirmContext';
|
|
|
|
+import { GlobalSettingsProvider } from './contexts/GlobalSettingsContext';
|
|
|
|
|
|
const queryClient = new QueryClient({
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
defaultOptions: {
|
|
@@ -46,89 +46,91 @@ const App: React.FC = () => {
|
|
|
|
|
|
return (
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
<QueryClientProvider client={queryClient}>
|
|
- <ThemeProvider theme={theme}>
|
|
|
|
- <ConfirmContextProvider>
|
|
|
|
- <GlobalCSS />
|
|
|
|
- <S.Layout>
|
|
|
|
- <S.Navbar role="navigation" aria-label="Page Header">
|
|
|
|
- <S.NavbarBrand>
|
|
|
|
|
|
+ <GlobalSettingsProvider>
|
|
|
|
+ <ThemeProvider theme={theme}>
|
|
|
|
+ <ConfirmContextProvider>
|
|
|
|
+ <GlobalCSS />
|
|
|
|
+ <S.Layout>
|
|
|
|
+ <S.Navbar role="navigation" aria-label="Page Header">
|
|
<S.NavbarBrand>
|
|
<S.NavbarBrand>
|
|
- <S.NavbarBurger
|
|
|
|
- onClick={onBurgerClick}
|
|
|
|
- onKeyDown={onBurgerClick}
|
|
|
|
- role="button"
|
|
|
|
- tabIndex={0}
|
|
|
|
- aria-label="burger"
|
|
|
|
- >
|
|
|
|
- <S.Span role="separator" />
|
|
|
|
- <S.Span role="separator" />
|
|
|
|
- <S.Span role="separator" />
|
|
|
|
- </S.NavbarBurger>
|
|
|
|
|
|
+ <S.NavbarBrand>
|
|
|
|
+ <S.NavbarBurger
|
|
|
|
+ onClick={onBurgerClick}
|
|
|
|
+ onKeyDown={onBurgerClick}
|
|
|
|
+ role="button"
|
|
|
|
+ tabIndex={0}
|
|
|
|
+ aria-label="burger"
|
|
|
|
+ >
|
|
|
|
+ <S.Span role="separator" />
|
|
|
|
+ <S.Span role="separator" />
|
|
|
|
+ <S.Span role="separator" />
|
|
|
|
+ </S.NavbarBurger>
|
|
|
|
|
|
- <S.Hyperlink to="/">
|
|
|
|
- <Logo />
|
|
|
|
- UI for Apache Kafka
|
|
|
|
- </S.Hyperlink>
|
|
|
|
|
|
+ <S.Hyperlink to="/">
|
|
|
|
+ <Logo />
|
|
|
|
+ UI for Apache Kafka
|
|
|
|
+ </S.Hyperlink>
|
|
|
|
|
|
- <S.NavbarItem>
|
|
|
|
- {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
|
|
|
|
- </S.NavbarItem>
|
|
|
|
|
|
+ <S.NavbarItem>
|
|
|
|
+ <Version />
|
|
|
|
+ </S.NavbarItem>
|
|
|
|
+ </S.NavbarBrand>
|
|
</S.NavbarBrand>
|
|
</S.NavbarBrand>
|
|
- </S.NavbarBrand>
|
|
|
|
- <S.NavbarSocial>
|
|
|
|
- <S.LogoutLink href="/logout">
|
|
|
|
- <S.LogoutButton buttonType="primary" buttonSize="M">
|
|
|
|
- Log out
|
|
|
|
- </S.LogoutButton>
|
|
|
|
- </S.LogoutLink>
|
|
|
|
- <S.SocialLink
|
|
|
|
- href="https://github.com/provectus/kafka-ui"
|
|
|
|
- target="_blank"
|
|
|
|
- >
|
|
|
|
- <GitIcon />
|
|
|
|
- </S.SocialLink>
|
|
|
|
- <S.SocialLink
|
|
|
|
- href="https://discord.com/invite/4DWzD7pGE5"
|
|
|
|
- target="_blank"
|
|
|
|
- >
|
|
|
|
- <DiscordIcon />
|
|
|
|
- </S.SocialLink>
|
|
|
|
- </S.NavbarSocial>
|
|
|
|
- </S.Navbar>
|
|
|
|
|
|
+ <S.NavbarSocial>
|
|
|
|
+ <S.LogoutLink href="/logout">
|
|
|
|
+ <S.LogoutButton buttonType="primary" buttonSize="M">
|
|
|
|
+ Log out
|
|
|
|
+ </S.LogoutButton>
|
|
|
|
+ </S.LogoutLink>
|
|
|
|
+ <S.SocialLink
|
|
|
|
+ href="https://github.com/provectus/kafka-ui"
|
|
|
|
+ target="_blank"
|
|
|
|
+ >
|
|
|
|
+ <GitIcon />
|
|
|
|
+ </S.SocialLink>
|
|
|
|
+ <S.SocialLink
|
|
|
|
+ href="https://discord.com/invite/4DWzD7pGE5"
|
|
|
|
+ target="_blank"
|
|
|
|
+ >
|
|
|
|
+ <DiscordIcon />
|
|
|
|
+ </S.SocialLink>
|
|
|
|
+ </S.NavbarSocial>
|
|
|
|
+ </S.Navbar>
|
|
|
|
|
|
- <S.Container>
|
|
|
|
- <S.Sidebar aria-label="Sidebar" $visible={isSidebarVisible}>
|
|
|
|
- <Suspense fallback={<PageLoader />}>
|
|
|
|
- <Nav />
|
|
|
|
- </Suspense>
|
|
|
|
- </S.Sidebar>
|
|
|
|
- <S.Overlay
|
|
|
|
- $visible={isSidebarVisible}
|
|
|
|
- onClick={closeSidebar}
|
|
|
|
- onKeyDown={closeSidebar}
|
|
|
|
- tabIndex={-1}
|
|
|
|
- aria-hidden="true"
|
|
|
|
- aria-label="Overlay"
|
|
|
|
- />
|
|
|
|
- <Routes>
|
|
|
|
- {['/', '/ui', '/ui/clusters'].map((path) => (
|
|
|
|
|
|
+ <S.Container>
|
|
|
|
+ <S.Sidebar aria-label="Sidebar" $visible={isSidebarVisible}>
|
|
|
|
+ <Suspense fallback={<PageLoader />}>
|
|
|
|
+ <Nav />
|
|
|
|
+ </Suspense>
|
|
|
|
+ </S.Sidebar>
|
|
|
|
+ <S.Overlay
|
|
|
|
+ $visible={isSidebarVisible}
|
|
|
|
+ onClick={closeSidebar}
|
|
|
|
+ onKeyDown={closeSidebar}
|
|
|
|
+ tabIndex={-1}
|
|
|
|
+ aria-hidden="true"
|
|
|
|
+ aria-label="Overlay"
|
|
|
|
+ />
|
|
|
|
+ <Routes>
|
|
|
|
+ {['/', '/ui', '/ui/clusters'].map((path) => (
|
|
|
|
+ <Route
|
|
|
|
+ key="Home" // optional: avoid full re-renders on route changes
|
|
|
|
+ path={path}
|
|
|
|
+ element={<Dashboard />}
|
|
|
|
+ />
|
|
|
|
+ ))}
|
|
<Route
|
|
<Route
|
|
- key="Home" // optional: avoid full re-renders on route changes
|
|
|
|
- path={path}
|
|
|
|
- element={<Dashboard />}
|
|
|
|
|
|
+ path={getNonExactPath(clusterPath())}
|
|
|
|
+ element={<ClusterPage />}
|
|
/>
|
|
/>
|
|
- ))}
|
|
|
|
- <Route
|
|
|
|
- path={getNonExactPath(clusterPath())}
|
|
|
|
- element={<ClusterPage />}
|
|
|
|
- />
|
|
|
|
- </Routes>
|
|
|
|
- </S.Container>
|
|
|
|
- <Toaster position="bottom-right" />
|
|
|
|
- </S.Layout>
|
|
|
|
- <ConfirmationModal />
|
|
|
|
- </ConfirmContextProvider>
|
|
|
|
- </ThemeProvider>
|
|
|
|
|
|
+ </Routes>
|
|
|
|
+ </S.Container>
|
|
|
|
+ <Toaster position="bottom-right" />
|
|
|
|
+ </S.Layout>
|
|
|
|
+ <ConfirmationModal />
|
|
|
|
+ </ConfirmContextProvider>
|
|
|
|
+ </ThemeProvider>
|
|
|
|
+ </GlobalSettingsProvider>
|
|
</QueryClientProvider>
|
|
</QueryClientProvider>
|
|
);
|
|
);
|
|
};
|
|
};
|