Feat: logs UI fix

This commit is contained in:
Harshith Mullapudi 2025-08-22 21:08:38 +05:30
parent 162a565752
commit cfb0af6d08
4 changed files with 9 additions and 2 deletions

View File

@ -21,9 +21,10 @@ import { redirect, useFetcher } from "@remix-run/react";
interface LogOptionsProps {
id: string;
reset?: () => void;
}
export const LogOptions = ({ id }: LogOptionsProps) => {
export const LogOptions = ({ id, reset }: LogOptionsProps) => {
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const deleteFetcher = useFetcher<{ success: boolean }>();

View File

@ -36,6 +36,7 @@ export function LogTextCollapse({
error,
id,
log,
reset,
}: LogTextCollapseProps) {
const [dialogOpen, setDialogOpen] = useState(false);

View File

@ -24,6 +24,7 @@ function LogItemRenderer(
props: ListRowProps,
logs: LogItem[],
cache: CellMeasurerCache,
reset?: () => void,
) {
const { index, key, style, parent } = props;
const log = logs[index];
@ -60,6 +61,7 @@ function LogItemRenderer(
logData={log.data}
log={log}
id={log.id}
reset={reset}
/>
</div>
</div>
@ -72,6 +74,7 @@ export function VirtualLogsList({
hasMore,
loadMore,
isLoading,
reset,
}: VirtualLogsListProps) {
// Create a CellMeasurerCache instance using useRef to prevent recreation
const cacheRef = useRef<CellMeasurerCache | null>(null);
@ -100,7 +103,7 @@ export function VirtualLogsList({
};
const rowRenderer = (props: ListRowProps) => {
return LogItemRenderer(props, logs, cache);
return LogItemRenderer(props, logs, cache, reset);
};
const rowHeight = ({ index }: Index) => {

View File

@ -20,6 +20,7 @@ export default function LogsAll() {
availableSources,
isLoading,
isInitialLoad,
reset,
} = useLogs({
endpoint: "/api/v1/logs",
source: selectedSource,
@ -96,6 +97,7 @@ export default function LogsAll() {
loadMore={loadMore}
isLoading={isLoading}
height={600}
reset={reset}
/>
)}
</div>