Skip to content

Commit

Permalink
save offset in dateandtime format
Browse files Browse the repository at this point in the history
Signed-off-by: hemahg <[email protected]>
  • Loading branch information
hemahg committed Aug 30, 2024
1 parent 0406990 commit 3c26c8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions ui/api/consumerGroups/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,12 @@
},
},
};
console.log(body)
log.debug({ url, body }, "calling updateConsumerGroup");
const res = await fetch(url, {
headers: await getHeaders(),
method: "PATCH",
body: JSON.stringify(body),
});
console.log(res)
try {
const success = res.status === 204;
log.debug({ status: res.status }, "updateConsumerGroup response");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export function ResetConsumerOffset({
router.push(`${baseurl}`)
}

const handleDateTimeChange = (value: string) => {
setOffset((prev) => ({ ...prev, offset: value }));
};


const handleSave = async () => {
setIsLoading(true);
try {
Expand All @@ -105,7 +110,7 @@ export function ResetConsumerOffset({
partitions.map((partition) => ({
topicId: topic,
partition: partition,
offset: selectedOffset === "custom" ? offset.offset : selectedOffset,
offset: selectedOffset === "custom" || selectedOffset === "specificDateTime" ? offset.offset : selectedOffset,
}))
);

Expand All @@ -116,8 +121,7 @@ export function ResetConsumerOffset({
offsets = Array.from(uniquePartitions).map((partition) => ({
topicId: offset.topicName,
partition,
offset: selectedOffset === "custom" ? offset.offset : selectedOffset,
metadata: `Last reset @ ${new Date().toISOString()}`
offset: selectedOffset === "custom" || selectedOffset === "specificDateTime" ? offset.offset : selectedOffset,
}));
}

Expand Down Expand Up @@ -235,7 +239,9 @@ export function ResetConsumerOffset({
<TextInput
id="date-input"
name={"date-input"}
type="datetime-local"
type="text"
placeholder={selectDateTimeFormat === "ISO" ? "yyyy-MM-dd'T'HH:mm:ss.SSS" : "Enter ISO date to convert to Epoch"}
onChange={(_event, value) => handleDateTimeChange(value)}
/>
</FormGroup>
</>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ async function AsyncConnectedConsumerGroupsTable({
: undefined;
const prevPageCursor = prevPageQuery?.get("page[after]");

console.log(consumerGroups.data)

return (
<ConnectedConsumerGroupsTable
kafkaId={kafkaId}
Expand Down

0 comments on commit 3c26c8a

Please sign in to comment.