diff --git a/src/actions/livepeer.js b/src/actions/livepeer.js index 2367f01..eaa7a07 100644 --- a/src/actions/livepeer.js +++ b/src/actions/livepeer.js @@ -153,7 +153,8 @@ export const getEvents = () => async dispatch => { transactionHash: currentTx, transactionUrl: currentUrl, transactionBlock: currentBlock, - transactionTime: currentTime + transactionTime: currentTime, + eventValue: (tmpAmount > tmpAmountOther) ? tmpAmount : tmpAmountOther }); } @@ -198,7 +199,8 @@ export const getEvents = () => async dispatch => { transactionHash: currentTx, transactionUrl: currentUrl, transactionBlock: currentBlock, - transactionTime: currentTime + transactionTime: currentTime, + eventValue: amount }); } else if (eventObj.name === "WithdrawFees") { const amount = parseFloat(eventObj.data.amount) / 1000000000000000000; @@ -216,7 +218,8 @@ export const getEvents = () => async dispatch => { transactionHash: currentTx, transactionUrl: currentUrl, transactionBlock: currentBlock, - transactionTime: currentTime + transactionTime: currentTime, + eventValue: amount }); } // Always split off TranscoderUpdate as a separate Update Event @@ -235,7 +238,8 @@ export const getEvents = () => async dispatch => { transactionHash: currentTx, transactionUrl: currentUrl, transactionBlock: currentBlock, - transactionTime: currentTime + transactionTime: currentTime, + eventValue: (amount1 > amount2) ? amount1 : amount2 }); } // Always split off EarningsClaimed as a separate Claim Event @@ -288,7 +292,8 @@ export const getEvents = () => async dispatch => { transactionHash: currentTx, transactionUrl: currentUrl, transactionBlock: currentBlock, - transactionTime: currentTime + transactionTime: currentTime, + eventValue: amount1 }); } // Extract useful info from other types of Event diff --git a/src/eventViewer.js b/src/eventViewer.js index 87cc23d..7f9f8df 100644 --- a/src/eventViewer.js +++ b/src/eventViewer.js @@ -16,6 +16,7 @@ const maxShown = 500; const EventViewer = (obj) => { const [searchTerm, setSearchTerm] = useState(obj.prefill || ""); + const [amountFilter, setAmountFilter] = useState("0"); const [filterActivated, setFilterActivated] = useState(true); const [rewardActivated, setRewardActivated] = useState(false); const [updateActivated, setUpdateActivated] = useState(true); @@ -50,20 +51,92 @@ const EventViewer = (obj) => {

Shows the latest {maxShown} entries of your search query

- setSearchTerm(evt.target.value)} - placeholder='Filter by Orchestrator address' - type="text" - /> +
+

Filter by Orchestrator address

+ setSearchTerm(evt.target.value)} + placeholder='Filter by Orchestrator address' + type="text" + /> +
+
+

+ +
+
+

+ +
+
+

+ +
+
+

Filter by minimum value

+ setAmountFilter(evt.target.value)} + placeholder='Filter by minimum value' + type="number" + /> +
+
+

+ +
+
+

+ +
+
+

+ +
{obj.events.map((eventObj, idx) => { + // Filter by minimum value + if (amountFilter !== "") { + if (parseFloat(amountFilter) > eventObj.eventValue) { + return null; + } + } // Filter name on from, to, caller if (searchTerm !== "") { let isFiltered = true; diff --git a/src/style.css b/src/style.css index b121843..0e042ad 100644 --- a/src/style.css +++ b/src/style.css @@ -7,6 +7,16 @@ a:hover, a:visited, a:link, a:active{ cursor: pointer; } +input[type="number"] { + -webkit-appearance: textfield; + -moz-appearance: textfield; + appearance: textfield; +} +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; +} + img { margin: 5px; -webkit-user-drag: none;