mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 19:58:59 +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) => {
|
||||
const [showExpandedLogs, setShowExpandedLogs] = useState(true);
|
||||
const [showExpandedLogs, setShowExpandedLogs] = useState(false);
|
||||
const { data, loading, error, refetch } = useGetIngestionExecutionRequestQuery({ variables: { urn } });
|
||||
const output = data?.executionRequest?.result?.report || 'No output found.';
|
||||
|
||||
useEffect(() => {
|
||||
if (output.length > 100) {
|
||||
setShowExpandedLogs(false);
|
||||
}
|
||||
}, [output, setShowExpandedLogs]);
|
||||
|
||||
const downloadLogs = () => {
|
||||
downloadFile(output, `exec-${urn}.log`);
|
||||
};
|
||||
@ -167,7 +161,7 @@ export const ExecutionDetailsModal = ({ urn, visible, onClose }: Props) => {
|
||||
</Button>
|
||||
</SectionSubHeader>
|
||||
<Typography.Paragraph ellipsis>
|
||||
<pre>{`${logs}${!showExpandedLogs ? '...' : ''}`}</pre>
|
||||
<pre>{`${logs}${!showExpandedLogs && isOutputExpandable ? '...' : ''}`}</pre>
|
||||
{isOutputExpandable && (
|
||||
<ShowMoreButton type="link" onClick={() => setShowExpandedLogs(!showExpandedLogs)}>
|
||||
{showExpandedLogs ? 'Hide' : 'Show More'}
|
||||
|
||||
@ -137,6 +137,7 @@ export const IngestionSourceList = () => {
|
||||
}
|
||||
} else if (refreshInterval) {
|
||||
clearInterval(refreshInterval);
|
||||
setRefreshInterval(null);
|
||||
}
|
||||
}, [filteredSources, refreshInterval, onRefresh]);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user