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

Commit 3f2b528

Browse files
committed
rebase
2 parents 2c52ca6 + 68fd658 commit 3f2b528

File tree

15 files changed

+109
-57
lines changed

15 files changed

+109
-57
lines changed

src/components/Header/RefreshInterval.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { Button, Menu, Text, Tooltip, px } from '@mantine/core';
22
import { IconRefresh, IconRefreshOff } from '@tabler/icons-react';
3-
import ms from 'ms';
4-
import type { FC } from 'react';
3+
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
4+
import { logsStoreReducers, useLogsStore } from '@/pages/Stream/providers/LogsProvider';
55
import { useEffect, useMemo, useRef } from 'react';
6+
7+
import type { FC } from 'react';
68
import { REFRESH_INTERVALS } from '@/constants/timeConstants';
7-
import classes from './styles/LogQuery.module.css';
8-
import { useLogsStore, logsStoreReducers } from '@/pages/Stream/providers/LogsProvider';
99
import _ from 'lodash';
10-
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
10+
import classes from './styles/LogQuery.module.css';
11+
import ms from 'ms';
1112

1213
const { setRefreshInterval, getCleanStoreForRefetch } = logsStoreReducers;
1314
const { syncTimeRange } = appStoreReducers;
@@ -66,14 +67,18 @@ const RefreshInterval: FC = () => {
6667

6768
return (
6869
<Menu.Item key={interval} onClick={() => onSelectedInterval(interval)}>
69-
<Text>{ms(interval)}</Text>
70+
<Text style={{ fontSize: '0.65rem', fontWeight: 500 }} c="#495057">
71+
{ms(interval)}
72+
</Text>
7073
</Menu.Item>
7174
);
7275
})}
7376

7477
{refreshInterval !== null && (
7578
<Menu.Item onClick={() => onSelectedInterval(null)}>
76-
<Text>Off</Text>
79+
<Text style={{ fontSize: '0.65rem', fontWeight: 500 }} c="#495057">
80+
Off
81+
</Text>
7782
</Menu.Item>
7883
)}
7984
</Menu.Dropdown>

src/components/Header/RefreshNow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/Ap
88
const { getCleanStoreForRefetch } = logsStoreReducers;
99
const { syncTimeRange } = appStoreReducers;
1010

11-
const renderRefreshIcon = () => <IconReload size={px('1rem')} stroke={1.5} />;
11+
const renderRefreshIcon = () => <IconReload color="#495057" size={px('1rem')} stroke={1.5} />;
1212

1313
const RefreshNow: FC = () => {
1414
const [, setLogsStore] = useLogsStore(() => null);

src/components/Header/ShareButton.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { Stack, Menu, px } from '@mantine/core';
2-
import { IconCopy, IconShare, IconFileTypeCsv, IconBraces } from '@tabler/icons-react';
1+
import { IconBraces, IconCopy, IconFileTypeCsv, IconShare } from '@tabler/icons-react';
2+
import { Menu, Stack, px } from '@mantine/core';
3+
import { downloadDataAsCSV, downloadDataAsJson } from '@/utils/exportHelpers';
4+
import { makeExportData, useLogsStore } from '@/pages/Stream/providers/LogsProvider';
5+
36
import IconButton from '../Button/IconButton';
7+
import { copyTextToClipboard } from '@/utils';
48
import { useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
59
import { useCallback } from 'react';
6-
import { copyTextToClipboard } from '@/utils';
7-
import { downloadDataAsCSV, downloadDataAsJson } from '@/utils/exportHelpers';
8-
import { makeExportData, useLogsStore } from '@/pages/Stream/providers/LogsProvider';
910

10-
const renderShareIcon = () => <IconShare size={px('1rem')} stroke={1.5} />;
11+
const renderShareIcon = () => <IconShare color="#495057" size={px('1rem')} stroke={1.5} />;
1112

1213
export default function ShareButton() {
1314
const [isSecureHTTPContext] = useAppStore((store) => store.isSecureHTTPContext);

src/components/Header/TimeRange.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import useMountedState from '@/hooks/useMountedState';
21
import { Box, Button, Divider, Menu, NumberInput, Stack, Text, Tooltip, px } from '@mantine/core';
32
import { DatePicker, TimeInput } from '@mantine/dates';
3+
import { Fragment, useCallback, useMemo, useRef, useState } from 'react';
44
import { IconCalendarEvent, IconCheck, IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
5-
import dayjs from 'dayjs';
5+
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
6+
import { logsStoreReducers, useLogsStore } from '@/pages/Stream/providers/LogsProvider';
7+
68
import type { FC } from 'react';
7-
import { Fragment, useCallback, useMemo, useRef, useState } from 'react';
89
import { FIXED_DURATIONS } from '@/constants/timeConstants';
9-
import classes from './styles/LogQuery.module.css';
10-
import { useOuterClick } from '@/hooks/useOuterClick';
1110
import _ from 'lodash';
11+
import classes from './styles/LogQuery.module.css';
12+
import dayjs from 'dayjs';
1213
import timeRangeUtils from '@/utils/timeRangeUtils';
13-
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
14-
import { logsStoreReducers, useLogsStore } from '@/pages/Stream/providers/LogsProvider';
14+
import useMountedState from '@/hooks/useMountedState';
15+
import { useOuterClick } from '@/hooks/useOuterClick';
1516

1617
const { getRelativeStartAndEndDate } = timeRangeUtils;
1718
const { setTimeRange, setshiftInterval } = appStoreReducers;
@@ -131,7 +132,7 @@ const TimeRange: FC = () => {
131132
<Stack className={classes.timeRangeBtnContainer}>
132133
<Tooltip label={`${shiftLabelPrefix} Back`}>
133134
<Stack className={classes.timeRangeCtrlIcon} onClick={() => shiftTimeRange('left')}>
134-
<IconChevronLeft stroke={2} size="1rem" style={{ cursor: 'pointer' }} />
135+
<IconChevronLeft color="#495057" stroke={1.5} size="1rem" style={{ cursor: 'pointer' }} />
135136
</Stack>
136137
</Tooltip>
137138
<Stack style={{ flexDirection: 'row', alignItems: 'center' }} gap={0}>
@@ -143,12 +144,12 @@ const TimeRange: FC = () => {
143144
</Text>
144145
)}
145146
<Stack onClick={toggleMenu} px={10} className="calenderIcon">
146-
<IconCalendarEvent size={px('1rem')} stroke={1.5} style={{ cursor: 'pointer' }} />
147+
<IconCalendarEvent color="#495057" size={px('1rem')} stroke={1.5} style={{ cursor: 'pointer' }} />
147148
</Stack>
148149
</Stack>
149150
<Tooltip label={`${shiftLabelPrefix} Forward`}>
150151
<Stack className={classes.timeRangeCtrlIcon} onClick={() => shiftTimeRange('right')}>
151-
<IconChevronRight stroke={2} size="1rem" style={{ cursor: 'pointer' }} />
152+
<IconChevronRight color="#495057" stroke={1.5} size="1rem" style={{ cursor: 'pointer' }} />
152153
</Stack>
153154
</Tooltip>
154155
</Stack>

src/components/Header/styles/LogQuery.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
color: var(--mantine-color-gray-7);
4242
border: 1px #e9ecef solid;
4343
border-radius: rem(8px);
44+
font-size: 0.65rem;
45+
font-weight: 500;
4446

4547
&:hover {
4648
color: black;
@@ -76,6 +78,9 @@
7678
text-transform: capitalize;
7779
cursor: pointer;
7880
border-radius: 0.65rem;
81+
font-size: 0.65rem;
82+
font-weight: 500;
83+
color: var(--mantine-color-gray-7);
7984

8085
&:hover {
8186
/* color: black !important; */
@@ -204,6 +209,7 @@
204209
background: #545beb !important;
205210
font-weight: 500;
206211
color: white;
212+
font-size: 0.65rem;
207213
}
208214

209215
.fixedRangeBtnSelected:hover {
@@ -239,6 +245,9 @@
239245
cursor: pointer;
240246
border: 1px var(--mantine-color-gray-2) solid;
241247
border-radius: rem(8px);
248+
color: var(--mantine-color-gray-7);
249+
font-weight: 500;
250+
font-size: 0.65rem;
242251
}
243252

244253
.chevronDown {

src/hooks/useLogStream.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { useMutation, useQuery } from 'react-query';
1+
import { AxiosError, isAxiosError } from 'axios';
2+
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
23
import {
4+
createLogStream,
35
deleteLogStream,
6+
detectLogStreamSchema,
47
getLogStreamList,
5-
createLogStream,
68
updateLogStream,
7-
detectLogStreamSchema,
89
} from '@/api/logStream';
9-
import { AxiosError, isAxiosError } from 'axios';
1010
import { notifyError, notifySuccess } from '@/utils/notification';
11+
import { useMutation, useQuery } from 'react-query';
12+
1113
import { LogStreamSchemaData } from '@/@types/parseable/api/stream';
12-
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
1314

1415
type CreateStreamOpts = {
1516
streamName: string;
@@ -40,7 +41,7 @@ export const useLogStream = () => {
4041
isError: detectLogStreamSchemaIsError,
4142
isLoading: detectLogStreamSchemaIsLoading,
4243
} = useMutation(
43-
(data: { sampleLogs: any[]; onSuccess: (data: LogStreamSchemaData) => void }) =>
44+
(data: { sampleLogs: Record<string, any>; onSuccess: (data: LogStreamSchemaData) => void }) =>
4445
detectLogStreamSchema(data.sampleLogs),
4546
{
4647
onSuccess: (data, variables) => {

src/pages/Correlation/components/SavedCorrelationsModal.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ const SavedCorrelationsModal = () => {
2323
}, []);
2424

2525
const hasNoSavedFilters = _.isEmpty(correlations) || _.isNil(correlations) || fetchCorrelationsError;
26+
useEffect(() => {
27+
const handleKeyPress = (event: { key: string }) => {
28+
if (event.key === 'Escape') {
29+
closeModal();
30+
}
31+
};
32+
33+
window.addEventListener('keydown', handleKeyPress);
34+
35+
return () => {
36+
window.removeEventListener('keydown', handleKeyPress);
37+
};
38+
}, []);
2639

2740
return (
2841
<Modal

src/pages/Correlation/styles/SavedCorrelationsBtn.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
border: 1px #e9ecef solid;
55
border-radius: rem(8px);
66
font-size: 0.65rem;
7+
font-weight: 500;
78
&:hover {
89
color: black;
910
}

src/pages/Home/CreateStreamModal.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ import {
1919
Tooltip,
2020
} from '@mantine/core';
2121
import { FC, useCallback, useEffect, useState } from 'react';
22-
import styles from './styles/CreateStreamModal.module.css';
23-
import { useLogStream } from '@/hooks/useLogStream';
24-
import { useForm } from '@mantine/form';
22+
import { GetInputPropsReturnType, UseFormReturnType } from 'node_modules/@mantine/form/lib/types';
2523
import { IconInfoCircleFilled, IconPlus } from '@tabler/icons-react';
26-
import _ from 'lodash';
24+
import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider';
25+
2726
import { CreatableSelect } from '@/components/Misc/CreatableSelect';
28-
import { useAppStore, appStoreReducers } from '@/layouts/MainLayout/providers/AppProvider';
29-
import { GetInputPropsReturnType, UseFormReturnType } from 'node_modules/@mantine/form/lib/types';
30-
import { notifyError } from '@/utils/notification';
3127
import { LogStreamSchemaData } from '@/@types/parseable/api/stream';
28+
import _ from 'lodash';
29+
import { notifyError } from '@/utils/notification';
30+
import styles from './styles/CreateStreamModal.module.css';
31+
import { useForm } from '@mantine/form';
32+
import { useLogStream } from '@/hooks/useLogStream';
3233

3334
const { toggleCreateStreamModal } = appStoreReducers;
3435

@@ -461,9 +462,7 @@ const DetectSchemaSection = (props: { form: StreamFormType }) => {
461462
} catch (e) {
462463
console.error('Error parsing json', e);
463464
}
464-
if (!_.isArray(logRecords)) {
465-
return notifyError({ message: 'Invalid JSON' });
466-
} else if (_.isEmpty(logRecords)) {
465+
if (_.isEmpty(logRecords)) {
467466
return notifyError({ message: 'No records found' });
468467
} else if (_.size(logRecords) > 10) {
469468
return notifyError({ message: 'More than 10 records found' });

src/pages/Stream/Views/Explore/JSONView.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ const Row = (props: {
9090

9191
return (
9292
<Stack
93-
style={{ flexDirection: 'row', background: isRowHighlighted ? '#E8EDFE' : 'white' }}
93+
style={{
94+
flexDirection: 'row',
95+
background: isRowHighlighted ? '#E8EDFE' : 'white',
96+
paddingLeft: showEllipses ? '5px' : '',
97+
gap: showEllipses ? '5px' : '',
98+
}}
9499
className={classes.rowContainer}
95100
gap={0}>
96101
{showEllipses && (
@@ -374,7 +379,7 @@ const JsonView = (props: {
374379
<Box
375380
className={classes.innerContainer}
376381
style={{ display: 'flex', flexDirection: 'row', maxHeight: `calc(100vh - ${primaryHeaderHeight}px )` }}>
377-
<Stack gap={0}>
382+
<Stack gap={0} style={{ width: '100%' }}>
378383
<Stack style={{ overflowY: 'scroll' }}>
379384
<JsonRows isSearching={isSearching} setContextMenu={setContextMenu} />
380385
</Stack>

0 commit comments

Comments
 (0)