Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

live tail hidden #421

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const HOME_ROUTE = '/';
export const LOGIN_ROUTE = '/login';
// -----
export const MANAGE_ROUTE = '/:streamName/manage';
export const LIVE_TAIL_ROUTE = '/:streamName/live-tail';
// export const LIVE_TAIL_ROUTE = '/:streamName/live-tail';
export const EXPLORE_ROUTE = '/:streamName/explore';
// -----
export const USERS_MANAGEMENT_ROUTE = '/users';
Expand All @@ -13,14 +13,18 @@ export const STREAM_ROUTE = '/:streamName/:view?';
export const DASHBOARDS_ROUTE = '/dashboards';
export const CORRELATION_ROUTE = '/correlation';

export const STREAM_VIEWS = ['explore', 'manage', 'live-tail'];
export const STREAM_VIEWS = [
'explore',
'manage',
// 'live-tail'
];

export const PATHS = {
all: '/*',
home: '/',
explore: '/:streamName/:view?',
login: '/login',
liveTail: '/:streamName/:view?',
// liveTail: '/:streamName/:view?',
stats: '/:streamName/stats',
config: '/:streamName/config',
users: '/users',
Expand Down
55 changes: 30 additions & 25 deletions src/pages/Stream/components/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Stack, Tooltip } from '@mantine/core';
import classes from '../styles/SideBar.module.css';
import { IconBolt, IconChevronsRight, IconFilterSearch, IconSettings2 } from '@tabler/icons-react';
import {
// IconBolt,
IconChevronsRight,
IconFilterSearch,
IconSettings2,
} from '@tabler/icons-react';
import { useCallback } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
Expand Down Expand Up @@ -80,32 +85,32 @@ const ExpandCollapseButton = () => {
);
};

const LiveTailMenu = (props: MenuItemProps) => {
const viewName = 'live-tail';
const isActive = props.currentView === viewName;
const additionalClassNames = `${isActive ? classes.activeMenuItem : ''}`;
return (
<Stack
onClick={() => props.setCurrentView(viewName)}
className={classes.menuItemContainer}
style={{ padding: '4px 0', alignItems: 'center' }}>
<Tooltip label="Live Tail" position="right">
<Stack className={additionalClassNames} style={{ padding: '4px 4px' }}>
<IconBolt
stroke={isActive ? 1.4 : 1.2}
size="1.2rem"
className={classes.icon}
{...(isActive && { color: 'black' })}
/>
</Stack>
</Tooltip>
</Stack>
);
};
// const LiveTailMenu = (props: MenuItemProps) => {
// const viewName = 'live-tail';
// const isActive = props.currentView === viewName;
// const additionalClassNames = `${isActive ? classes.activeMenuItem : ''}`;
// return (
// <Stack
// onClick={() => props.setCurrentView(viewName)}
// className={classes.menuItemContainer}
// style={{ padding: '4px 0', alignItems: 'center' }}>
// <Tooltip label="Live Tail" position="right">
// <Stack className={additionalClassNames} style={{ padding: '4px 4px' }}>
// <IconBolt
// stroke={isActive ? 1.4 : 1.2}
// size="1.2rem"
// className={classes.icon}
// {...(isActive && { color: 'black' })}
// />
// </Stack>
// </Tooltip>
// </Stack>
// );
// };

const SideBar = () => {
const [currentStream] = useAppStore((store) => store.currentStream);
const [isStandAloneMode] = useAppStore((store) => store.isStandAloneMode);
// const [isStandAloneMode] = useAppStore((store) => store.isStandAloneMode);
const { view } = useParams();
const navigate = useNavigate();

Expand All @@ -122,7 +127,7 @@ const SideBar = () => {
<Stack className={classes.container} style={{ gap: 0 }}>
<Stack gap={0}>
<AllLogsButton setCurrentView={setCurrentView} currentView={view || ''} />
{isStandAloneMode && <LiveTailMenu setCurrentView={setCurrentView} currentView={view || ''} />}
{/* {isStandAloneMode && <LiveTailMenu setCurrentView={setCurrentView} currentView={view || ''} />} */}
<ConfigButton setCurrentView={setCurrentView} currentView={view || ''} />
</Stack>
<Stack style={{ marginTop: 'auto' }}>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/Stream/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Stack } from '@mantine/core';
import { useDocumentTitle, useHotkeys } from '@mantine/hooks';
import { FC, useCallback, useEffect } from 'react';
import LiveLogTable from './Views/LiveTail/LiveLogTable';

import ViewLog from './components/ViewLog';
import { useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
import SideBar from './components/Sidebar';
Expand Down Expand Up @@ -116,8 +116,6 @@ const Stream: FC = () => {
) : (
<LogsView schemaLoading={isSchemaFetching} infoLoading={isInfoLoading} />
)
) : view === 'live-tail' ? (
<LiveLogTable />
) : (
<Management schemaLoading={isSchemaFetching} />
)}
Expand Down
Loading