mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-15 19:03:43 +00:00
feat(ingestion) Followups to live ingestion logs in UI (#5676)
* fix live logs collapsing repeatedly * set refresh interval to null Co-authored-by: Chris Collins <chriscollins@Chriss-MBP-2.lan>
This commit is contained in:
parent
6f585607de
commit
9da6f12c18
@ -90,16 +90,10 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ExecutionDetailsModal = ({ urn, visible, onClose }: Props) => {
|
export const ExecutionDetailsModal = ({ urn, visible, onClose }: Props) => {
|
||||||
const [showExpandedLogs, setShowExpandedLogs] = useState(true);
|
const [showExpandedLogs, setShowExpandedLogs] = useState(false);
|
||||||
const { data, loading, error, refetch } = useGetIngestionExecutionRequestQuery({ variables: { urn } });
|
const { data, loading, error, refetch } = useGetIngestionExecutionRequestQuery({ variables: { urn } });
|
||||||
const output = data?.executionRequest?.result?.report || 'No output found.';
|
const output = data?.executionRequest?.result?.report || 'No output found.';
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (output.length > 100) {
|
|
||||||
setShowExpandedLogs(false);
|
|
||||||
}
|
|
||||||
}, [output, setShowExpandedLogs]);
|
|
||||||
|
|
||||||
const downloadLogs = () => {
|
const downloadLogs = () => {
|
||||||
downloadFile(output, `exec-${urn}.log`);
|
downloadFile(output, `exec-${urn}.log`);
|
||||||
};
|
};
|
||||||
@ -167,7 +161,7 @@ export const ExecutionDetailsModal = ({ urn, visible, onClose }: Props) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</SectionSubHeader>
|
</SectionSubHeader>
|
||||||
<Typography.Paragraph ellipsis>
|
<Typography.Paragraph ellipsis>
|
||||||
<pre>{`${logs}${!showExpandedLogs ? '...' : ''}`}</pre>
|
<pre>{`${logs}${!showExpandedLogs && isOutputExpandable ? '...' : ''}`}</pre>
|
||||||
{isOutputExpandable && (
|
{isOutputExpandable && (
|
||||||
<ShowMoreButton type="link" onClick={() => setShowExpandedLogs(!showExpandedLogs)}>
|
<ShowMoreButton type="link" onClick={() => setShowExpandedLogs(!showExpandedLogs)}>
|
||||||
{showExpandedLogs ? 'Hide' : 'Show More'}
|
{showExpandedLogs ? 'Hide' : 'Show More'}
|
||||||
|
|||||||
@ -137,6 +137,7 @@ export const IngestionSourceList = () => {
|
|||||||
}
|
}
|
||||||
} else if (refreshInterval) {
|
} else if (refreshInterval) {
|
||||||
clearInterval(refreshInterval);
|
clearInterval(refreshInterval);
|
||||||
|
setRefreshInterval(null);
|
||||||
}
|
}
|
||||||
}, [filteredSources, refreshInterval, onRefresh]);
|
}, [filteredSources, refreshInterval, onRefresh]);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user