mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 17:56:04 +08:00
fix: table view logs on expand is updated (#3286)
This commit is contained in:
parent
ae3d4fece8
commit
c6ac8df707
@ -10,6 +10,7 @@ export type LogsTableViewProps = {
|
|||||||
logs: ILog[];
|
logs: ILog[];
|
||||||
fields: IField[];
|
fields: IField[];
|
||||||
linesPerRow: number;
|
linesPerRow: number;
|
||||||
|
onClickExpand?: (log: ILog) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UseTableViewResult = {
|
export type UseTableViewResult = {
|
||||||
|
@ -5,6 +5,7 @@ import RawLogView from 'components/Logs/RawLogView';
|
|||||||
import LogsTableView from 'components/Logs/TableView';
|
import LogsTableView from 'components/Logs/TableView';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import { contentStyle } from 'container/Trace/Search/config';
|
import { contentStyle } from 'container/Trace/Search/config';
|
||||||
|
import { useActiveLog } from 'hooks/logs/useActiveLog';
|
||||||
import useFontFaceObserver from 'hooks/useFontObserver';
|
import useFontFaceObserver from 'hooks/useFontObserver';
|
||||||
import { memo, useCallback, useMemo } from 'react';
|
import { memo, useCallback, useMemo } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
@ -26,6 +27,8 @@ type LogsTableProps = {
|
|||||||
function LogsTable(props: LogsTableProps): JSX.Element {
|
function LogsTable(props: LogsTableProps): JSX.Element {
|
||||||
const { viewMode, linesPerRow } = props;
|
const { viewMode, linesPerRow } = props;
|
||||||
|
|
||||||
|
const { onSetActiveLog } = useActiveLog();
|
||||||
|
|
||||||
useFontFaceObserver(
|
useFontFaceObserver(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -72,7 +75,12 @@ function LogsTable(props: LogsTableProps): JSX.Element {
|
|||||||
const renderContent = useMemo(() => {
|
const renderContent = useMemo(() => {
|
||||||
if (viewMode === 'table') {
|
if (viewMode === 'table') {
|
||||||
return (
|
return (
|
||||||
<LogsTableView logs={logs} fields={selected} linesPerRow={linesPerRow} />
|
<LogsTableView
|
||||||
|
onClickExpand={onSetActiveLog}
|
||||||
|
logs={logs}
|
||||||
|
fields={selected}
|
||||||
|
linesPerRow={linesPerRow}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +93,7 @@ function LogsTable(props: LogsTableProps): JSX.Element {
|
|||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}, [getItemContent, linesPerRow, logs, selected, viewMode]);
|
}, [getItemContent, linesPerRow, logs, onSetActiveLog, selected, viewMode]);
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <Spinner height={20} tip="Getting Logs" />;
|
return <Spinner height={20} tip="Getting Logs" />;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user