From df9e278f278e8c628de788c9bd40ea77da949a70 Mon Sep 17 00:00:00 2001 From: Roshaan Siddiqui Date: Thu, 30 Nov 2023 17:13:53 -0600 Subject: [PATCH] feat: add reload table button --- frontend/src/components/Logs/IndexerLogs.jsx | 14 +++++++++++++- frontend/src/components/Logs/LogButtons.jsx | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Logs/IndexerLogs.jsx b/frontend/src/components/Logs/IndexerLogs.jsx index a2b2f22d2..10e04c190 100644 --- a/frontend/src/components/Logs/IndexerLogs.jsx +++ b/frontend/src/components/Logs/IndexerLogs.jsx @@ -116,7 +116,7 @@ const IndexerLogsComponent = () => { return mergedEntries; }; - useEffect(() => { + const initializeTable = () => { const grid = new Grid({ columns: [ { @@ -204,8 +204,19 @@ const IndexerLogsComponent = () => { }); grid.render(indexerLogsRef.current); + }; + + useEffect(() => { + initializeTable(); }, []); + const reloadData = () => { + indexerLogsRef.current.innerHTML = ""; + setTimeout(() => { + initializeTable(); + }, 500); + }; + return ( <>
{ setHeights={setHeights} latestHeight={height} isUserIndexer={indexerDetails.accountId === currentUserAccountId} + reloadData={reloadData} /> { const { indexerName, @@ -93,6 +94,20 @@ const LogButtons = ({ aria-label="Action Button Group" > <> + Reload Data} + > + + Open Editor}