diff --git a/api/src/main/java/io/kafbat/ui/emitter/ConsumingStats.java b/api/src/main/java/io/kafbat/ui/emitter/ConsumingStats.java index a2c8d94f3..27ceb43b6 100644 --- a/api/src/main/java/io/kafbat/ui/emitter/ConsumingStats.java +++ b/api/src/main/java/io/kafbat/ui/emitter/ConsumingStats.java @@ -32,6 +32,9 @@ void sendFinishEvent(FluxSink sink, @Nullable Cursor.Track sink.next( new TopicMessageEventDTO() .type(TopicMessageEventDTO.TypeEnum.DONE) + .prevCursor( // FIXME + null + ) .nextCursor( cursor != null ? new TopicMessagePageCursorDTO().id(cursor.registerCursor()) diff --git a/contract/src/main/resources/swagger/kafbat-ui-api.yaml b/contract/src/main/resources/swagger/kafbat-ui-api.yaml index 53b6fc5ea..1e64dc3b7 100644 --- a/contract/src/main/resources/swagger/kafbat-ui-api.yaml +++ b/contract/src/main/resources/swagger/kafbat-ui-api.yaml @@ -2954,6 +2954,8 @@ components: $ref: "#/components/schemas/TopicMessagePhase" consuming: $ref: "#/components/schemas/TopicMessageConsuming" + prevCursor: + $ref: "#/components/schemas/TopicMessagePageCursor" nextCursor: $ref: "#/components/schemas/TopicMessagePageCursor" diff --git a/frontend/src/components/Topics/Topic/Messages/MessagesTable.tsx b/frontend/src/components/Topics/Topic/Messages/MessagesTable.tsx index c0fb72c08..2a5590caa 100644 --- a/frontend/src/components/Topics/Topic/Messages/MessagesTable.tsx +++ b/frontend/src/components/Topics/Topic/Messages/MessagesTable.tsx @@ -5,7 +5,7 @@ import { TopicMessage } from 'generated-sources'; import React, { useState } from 'react'; import { Button } from 'components/common/Button/Button'; import * as S from 'components/common/NewTable/Table.styled'; -import { useGoToNextPage, useIsLiveMode } from 'lib/hooks/useMessagesFilters'; +import { useGoToPrevPage, useGoToNextPage, useIsLiveMode } from 'lib/hooks/useMessagesFilters'; import { useMessageFiltersStore } from 'lib/hooks/useMessageFiltersStore'; import PreviewModal from './PreviewModal'; @@ -21,11 +21,13 @@ const MessagesTable: React.FC = ({ isFetching, }) => { const goToNextPage = useGoToNextPage(); + const goToPrevPage = useGoToPrevPage(); const [previewFor, setPreviewFor] = useState(null); const [keyFilters, setKeyFilters] = useState([]); const [contentFilters, setContentFilters] = useState([]); const nextCursor = useMessageFiltersStore((state) => state.nextCursor); + const prevCursor = useMessageFiltersStore((state) => state.prevCursor); const isLive = useIsLiveMode(); return ( @@ -97,6 +99,14 @@ const MessagesTable: React.FC = ({ +