Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 36071e9

Browse files
committed
Merge branch 'main' of https://github.com/praveen5959/console into json-default-view
2 parents 793d90c + 328e830 commit 36071e9

File tree

16 files changed

+243
-69
lines changed

16 files changed

+243
-69
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@mantine/hooks": "^7.8.1",
2727
"@mantine/notifications": "^7.8.1",
2828
"@monaco-editor/react": "^4.5.1",
29+
"@reduxjs/toolkit": "^2.5.0",
2930
"@tabler/icons-react": "^3.3.0",
3031
"@types/js-cookie": "^3.0.3",
3132
"axios": "^1.4.0",
@@ -52,6 +53,7 @@
5253
"react-grid-layout": "^1.4.4",
5354
"react-query": "^3.39.3",
5455
"react-querybuilder": "^6.5.5",
56+
"react-redux": "^9.2.0",
5557
"react-resizable": "^3.0.5",
5658
"react-resizable-panels": "^0.0.53",
5759
"react-router-dom": "^6.14.0",

pnpm-lock.yaml

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/@types/parseable/api/about.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
export type QueryEngineType = 'Trino' | 'Parseable' | undefined;
2+
3+
export type LicenseType = 'AGPL-3.0-only' | undefined;
4+
15
export type AboutData = {
26
commit: string;
37
deploymentId: string;
48
latestVersion: string;
5-
license: string;
9+
license: LicenseType;
610
mode: string;
711
staging: string;
812
store: { type: string; path: string };

src/components/Header/PrimaryHeader.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import { Button, Divider, Image, Stack } from '@mantine/core';
55
import { FC, useCallback } from 'react';
66
import styles from './styles/Header.module.css';
77
import HelpModal from './HelpModal';
8+
import _ from 'lodash';
89
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
10+
import { OSS_LICENSE_TYPE } from '@/constants';
911

1012
const PrimaryHeader: FC = () => {
1113
const classes = styles;
1214
const { logoContainer, imageSty } = classes;
1315
const [maximized, setAppStore] = useAppStore((store) => store.maximized);
16+
const [instanceConfig] = useAppStore((store) => store.instanceConfig);
1417
const toggleHelpModal = useCallback(() => setAppStore(appStoreReducers.toggleHelpModal), []);
1518
if (maximized) return null;
1619

@@ -31,14 +34,16 @@ const PrimaryHeader: FC = () => {
3134
className={classes.rightSection}
3235
style={{ flexDirection: 'row', height: '100%', justifyContent: 'flex-end' }}
3336
gap={8}>
34-
<Button
35-
variant="outline"
36-
style={{ border: 'none' }}
37-
component={'a'}
38-
href="mailto:[email protected]?subject=Production%20Support%20Query"
39-
target="_blank">
40-
Upgrade
41-
</Button>
37+
{instanceConfig?.license && _.isEqual(instanceConfig?.license, OSS_LICENSE_TYPE) && (
38+
<Button
39+
variant="outline"
40+
style={{ border: 'none' }}
41+
component={'a'}
42+
href="mailto:[email protected]?subject=Production%20Support%20Query"
43+
target="_blank">
44+
Upgrade
45+
</Button>
46+
)}
4247
<Divider orientation="vertical" />
4348
<Button onClick={toggleHelpModal} style={{ border: 'none' }} variant="outline">
4449
Help

src/components/Navbar/infoModal.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { useAbout } from '@/hooks/useGetAbout';
44
import { IconInfoCircle } from '@tabler/icons-react';
55
import styles from './styles/InfoModal.module.css';
66
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
7+
import { OSS_LICENSE_TYPE } from '@/constants';
8+
import _ from 'lodash';
79

810
const { setInstanceConfig } = appStoreReducers;
911

@@ -60,14 +62,16 @@ const InfoModal: FC<InfoModalProps> = (props) => {
6062
<Box className={aboutTextInnerBox}>
6163
<Text className={aboutTextKey}> License: </Text>
6264
<Text className={aboutTextValue}> {getAboutData?.data.license} </Text>
63-
<Button
64-
variant="outline"
65-
component={'a'}
66-
href="mailto:[email protected]?subject=Production%20Support%20Query"
67-
target="_blank"
68-
className={actionBtn}>
69-
Upgrade to production support
70-
</Button>
65+
{_.isEqual(getAboutData?.data.license, OSS_LICENSE_TYPE) && (
66+
<Button
67+
variant="outline"
68+
component={'a'}
69+
href="mailto:[email protected]?subject=Production%20Support%20Query"
70+
target="_blank"
71+
className={actionBtn}>
72+
Upgrade to production support
73+
</Button>
74+
)}
7175
</Box>
7276
</Box>
7377
<Box className={aboutTextBox}>

src/constants/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const OSS_LICENSE_TYPE = 'AGPL-3.0-only';
2+
3+
export { OSS_LICENSE_TYPE };

src/constants/routes.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export const HOME_ROUTE = '/';
33
export const LOGIN_ROUTE = '/login';
44
// -----
55
export const MANAGE_ROUTE = '/:streamName/manage';
6-
export const LIVE_TAIL_ROUTE = '/:streamName/live-tail';
6+
// export const LIVE_TAIL_ROUTE = '/:streamName/live-tail';
77
export const EXPLORE_ROUTE = '/:streamName/explore';
88
// -----
99
export const USERS_MANAGEMENT_ROUTE = '/users';
@@ -13,14 +13,18 @@ export const STREAM_ROUTE = '/:streamName/:view?';
1313
export const DASHBOARDS_ROUTE = '/dashboards';
1414
export const CORRELATION_ROUTE = '/correlation';
1515

16-
export const STREAM_VIEWS = ['explore', 'manage', 'live-tail'];
16+
export const STREAM_VIEWS = [
17+
'explore',
18+
'manage',
19+
// 'live-tail'
20+
];
1721

1822
export const PATHS = {
1923
all: '/*',
2024
home: '/',
2125
explore: '/:streamName/:view?',
2226
login: '/login',
23-
liveTail: '/:streamName/:view?',
27+
// liveTail: '/:streamName/:view?',
2428
stats: '/:streamName/stats',
2529
config: '/:streamName/config',
2630
users: '/users',

src/main.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import Mantine from '@/components/Mantine';
1313
import { BrowserRouter } from 'react-router-dom';
1414
import ErrorBoundary from './components/ErrorBoundary';
1515
import { QueryClient, QueryClientProvider } from 'react-query';
16+
import { Provider } from 'react-redux';
17+
import { store } from './store';
1618

1719
const queryClient = new QueryClient();
1820

@@ -21,7 +23,9 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
2123
<Mantine>
2224
<ErrorBoundary>
2325
<BrowserRouter>
24-
<App />
26+
<Provider store={store}>
27+
<App />
28+
</Provider>
2529
</BrowserRouter>
2630
</ErrorBoundary>
2731
</Mantine>

src/pages/Stream/Views/Explore/useLogsFetcher.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { useLogsStore, logsStoreReducers } from '../../providers/LogsProvider';
44
import { useQueryLogs } from '@/hooks/useQueryLogs';
55
import { useFetchCount } from '@/hooks/useQueryResult';
66
import { useStreamStore } from '../../providers/StreamProvider';
7+
import useParamsController from '@/pages/Stream/hooks/useParamsController';
78
import _ from 'lodash';
89

910
const { setCleanStoreForStreamChange } = logsStoreReducers;
1011
const { syncTimeRange } = appStoreReducers;
1112

1213
const useLogsFetcher = (props: { schemaLoading: boolean; infoLoading: boolean }) => {
14+
const { isStoreSynced } = useParamsController();
1315
const { schemaLoading, infoLoading } = props;
1416
const [currentStream] = useAppStore((store) => store.currentStream);
1517
const [{ timeRange }, setAppStore] = useAppStore((store) => store);
@@ -25,6 +27,7 @@ const useLogsFetcher = (props: { schemaLoading: boolean; infoLoading: boolean })
2527
const showTable = hasContentLoaded && !hasNoData && !queryLogsError;
2628

2729
useEffect(() => {
30+
if (!isStoreSynced) return;
2831
setAppStore(syncTimeRange);
2932
setLogsStore(setCleanStoreForStreamChange);
3033
}, [currentStream]);

src/pages/Stream/Views/Manage/Alerts.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ const Alerts = (props: {
674674
setAlertModalOpen(false);
675675
}, []);
676676

677-
const hideAlerts = !props.hasAlertsAccess || props.isStandAloneMode === false;
677+
const hideAlerts = true;
678678

679679
return (
680680
<Stack className={classes.sectionContainer} gap={0} style={{ flex: 1 }}>
@@ -683,7 +683,9 @@ const Alerts = (props: {
683683
{props.isError ? (
684684
<ErrorView />
685685
) : hideAlerts ? (
686-
<RestrictedView msg={!props.isStandAloneMode ? 'Alerts is unavailable on distributed mode.' : ''} />
686+
<RestrictedView
687+
msg={'Alerts are deprecated. \n New way to set alerts will be available in the next release.'}
688+
/>
687689
) : (
688690
<AlertList
689691
selectAlert={selectAlert}

0 commit comments

Comments
 (0)