diff --git a/src/components/Header/SubHeader.tsx b/src/components/Header/SubHeader.tsx
index 4c9b34d9..e29bd09d 100644
--- a/src/components/Header/SubHeader.tsx
+++ b/src/components/Header/SubHeader.tsx
@@ -1,7 +1,7 @@
import useMountedState from '@/hooks/useMountedState';
import { Box, Breadcrumbs, Button, Menu, Text, TextInput, UnstyledButton, px } from '@mantine/core';
import { DateTimePicker } from '@mantine/dates';
-import { IconClock, IconRefresh, IconRefreshOff, IconSearch } from '@tabler/icons-react';
+import { IconClock,IconRefresh, IconReload , IconRefreshOff, IconSearch } from '@tabler/icons-react';
import dayjs from 'dayjs';
import ms from 'ms';
import type { ChangeEvent, FC, KeyboardEvent } from 'react';
@@ -35,18 +35,16 @@ const SubHeader: FC = () => {
Streams
{streamName}
- {useMatch("/:streamName/logs")? "Logs": "Query" }
+ {useMatch("/:streamName/logs") ? "Logs" : "Query"}
-
- {useMatch("/:streamName/logs")
- &&
-
- }
-
+
+ {useMatch("/:streamName/logs") && }
+ {useMatch("/:streamName/logs") && }
+
@@ -105,6 +103,33 @@ const Search: FC = () => {
);
};
+const RefreshNow: FC = () => {
+ const {
+ state: { subLogQuery, subLogSelectedTimeRange },
+ } = useHeaderContext();
+
+
+ const onRefresh = () => {
+ if (subLogSelectedTimeRange.get().includes('Past')) {
+ const now = dayjs();
+ const timeDiff = subLogQuery.get().endTime.getTime() - subLogQuery.get().startTime.getTime();
+ subLogQuery.set((state) => {
+ state.startTime = now.subtract(timeDiff).toDate();
+ state.endTime = now.toDate();
+ });
+ }
+ };
+ const { classes } = useLogQueryStyles();
+ const { refreshNowBtn } = classes;
+
+ return (
+
+
+ );
+};
+
const RefreshInterval: FC = () => {
const {
state: { subRefreshInterval },
@@ -195,7 +220,7 @@ const TimeRange: FC = () => {
} = classes;
return (
-