mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 18:55:09 +02:00
Filter by minimum value
This commit is contained in:
parent
1ce78eb572
commit
59953d6888
@ -153,7 +153,8 @@ export const getEvents = () => async dispatch => {
|
|||||||
transactionHash: currentTx,
|
transactionHash: currentTx,
|
||||||
transactionUrl: currentUrl,
|
transactionUrl: currentUrl,
|
||||||
transactionBlock: currentBlock,
|
transactionBlock: currentBlock,
|
||||||
transactionTime: currentTime
|
transactionTime: currentTime,
|
||||||
|
eventValue: (tmpAmount > tmpAmountOther) ? tmpAmount : tmpAmountOther
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +199,8 @@ export const getEvents = () => async dispatch => {
|
|||||||
transactionHash: currentTx,
|
transactionHash: currentTx,
|
||||||
transactionUrl: currentUrl,
|
transactionUrl: currentUrl,
|
||||||
transactionBlock: currentBlock,
|
transactionBlock: currentBlock,
|
||||||
transactionTime: currentTime
|
transactionTime: currentTime,
|
||||||
|
eventValue: amount
|
||||||
});
|
});
|
||||||
} else if (eventObj.name === "WithdrawFees") {
|
} else if (eventObj.name === "WithdrawFees") {
|
||||||
const amount = parseFloat(eventObj.data.amount) / 1000000000000000000;
|
const amount = parseFloat(eventObj.data.amount) / 1000000000000000000;
|
||||||
@ -216,7 +218,8 @@ export const getEvents = () => async dispatch => {
|
|||||||
transactionHash: currentTx,
|
transactionHash: currentTx,
|
||||||
transactionUrl: currentUrl,
|
transactionUrl: currentUrl,
|
||||||
transactionBlock: currentBlock,
|
transactionBlock: currentBlock,
|
||||||
transactionTime: currentTime
|
transactionTime: currentTime,
|
||||||
|
eventValue: amount
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Always split off TranscoderUpdate as a separate Update Event
|
// Always split off TranscoderUpdate as a separate Update Event
|
||||||
@ -235,7 +238,8 @@ export const getEvents = () => async dispatch => {
|
|||||||
transactionHash: currentTx,
|
transactionHash: currentTx,
|
||||||
transactionUrl: currentUrl,
|
transactionUrl: currentUrl,
|
||||||
transactionBlock: currentBlock,
|
transactionBlock: currentBlock,
|
||||||
transactionTime: currentTime
|
transactionTime: currentTime,
|
||||||
|
eventValue: (amount1 > amount2) ? amount1 : amount2
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Always split off EarningsClaimed as a separate Claim Event
|
// Always split off EarningsClaimed as a separate Claim Event
|
||||||
@ -288,7 +292,8 @@ export const getEvents = () => async dispatch => {
|
|||||||
transactionHash: currentTx,
|
transactionHash: currentTx,
|
||||||
transactionUrl: currentUrl,
|
transactionUrl: currentUrl,
|
||||||
transactionBlock: currentBlock,
|
transactionBlock: currentBlock,
|
||||||
transactionTime: currentTime
|
transactionTime: currentTime,
|
||||||
|
eventValue: amount1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Extract useful info from other types of Event
|
// Extract useful info from other types of Event
|
||||||
|
@ -16,6 +16,7 @@ const maxShown = 500;
|
|||||||
|
|
||||||
const EventViewer = (obj) => {
|
const EventViewer = (obj) => {
|
||||||
const [searchTerm, setSearchTerm] = useState(obj.prefill || "");
|
const [searchTerm, setSearchTerm] = useState(obj.prefill || "");
|
||||||
|
const [amountFilter, setAmountFilter] = useState("0");
|
||||||
const [filterActivated, setFilterActivated] = useState(true);
|
const [filterActivated, setFilterActivated] = useState(true);
|
||||||
const [rewardActivated, setRewardActivated] = useState(false);
|
const [rewardActivated, setRewardActivated] = useState(false);
|
||||||
const [updateActivated, setUpdateActivated] = useState(true);
|
const [updateActivated, setUpdateActivated] = useState(true);
|
||||||
@ -50,20 +51,92 @@ const EventViewer = (obj) => {
|
|||||||
<h4>Shows the latest {maxShown} entries of your search query</h4>
|
<h4>Shows the latest {maxShown} entries of your search query</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<input className="searchField" style={{ marginLeft: '2em', width: '100%' }}
|
<div className="stroke" style={{ margin: "0", padding: 0 }}>
|
||||||
|
<h3>Filter by Orchestrator address</h3>
|
||||||
|
<input className="searchField" style={{ width: '100%' }}
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={(evt) => setSearchTerm(evt.target.value)}
|
onChange={(evt) => setSearchTerm(evt.target.value)}
|
||||||
placeholder='Filter by Orchestrator address'
|
placeholder='Filter by Orchestrator address'
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: 0, padding: 0 }}>
|
||||||
|
<h3></h3>
|
||||||
|
<button className={"nonHomeButton"} style={{ backgroundColor: greyColour, margin: 0, padding: '0', width: '5em' }} onClick={() => {
|
||||||
|
const curVal = parseFloat(amountFilter);
|
||||||
|
setAmountFilter(curVal - 1000);
|
||||||
|
}}>
|
||||||
|
<h3>-1000</h3>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: 0, padding: 0 }}>
|
||||||
|
<h3></h3>
|
||||||
|
<button className={"nonHomeButton"} style={{ backgroundColor: greyColour, margin: 0, padding: '0', width: '4em' }} onClick={() => {
|
||||||
|
const curVal = parseFloat(amountFilter);
|
||||||
|
setAmountFilter(curVal - 100);
|
||||||
|
}}>
|
||||||
|
<h3>-100</h3>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: 0, padding: 0 }}>
|
||||||
|
<h3></h3>
|
||||||
|
<button className={"nonHomeButton"} style={{ backgroundColor: greyColour, margin: 0, padding: '0', width: '3em' }} onClick={() => {
|
||||||
|
const curVal = parseFloat(amountFilter);
|
||||||
|
setAmountFilter(curVal - 10);
|
||||||
|
}}>
|
||||||
|
<h3>-10</h3>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: "0", padding: 0 }}>
|
||||||
|
<h3>Filter by minimum value</h3>
|
||||||
|
<input className="searchField" style={{ margin: 0, padding: 0, height: '2em', width: '80%', paddingLeft: '1em', paddingRight: '1em' }}
|
||||||
|
value={amountFilter}
|
||||||
|
onChange={(evt) => setAmountFilter(evt.target.value)}
|
||||||
|
placeholder='Filter by minimum value'
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: 0, padding: 0 }}>
|
||||||
|
<h3></h3>
|
||||||
|
<button className={"nonHomeButton"} style={{ backgroundColor: greyColour, margin: 0, padding: '0', width: '3em' }} onClick={() => {
|
||||||
|
const curVal = parseFloat(amountFilter);
|
||||||
|
setAmountFilter(curVal + 10);
|
||||||
|
}}>
|
||||||
|
<h3>+10</h3>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: 0, padding: 0 }}>
|
||||||
|
<h3></h3>
|
||||||
|
<button className={"nonHomeButton"} style={{ backgroundColor: greyColour, margin: 0, padding: '0', width: '4em' }} onClick={() => {
|
||||||
|
const curVal = parseFloat(amountFilter);
|
||||||
|
setAmountFilter(curVal + 100);
|
||||||
|
}}>
|
||||||
|
<h3>+100</h3>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="strokeSmollLeft" style={{ margin: 0, padding: 0 }}>
|
||||||
|
<h3></h3>
|
||||||
|
<button className={"nonHomeButton"} style={{ backgroundColor: greyColour, margin: 0, padding: '0', width: '5em' }} onClick={() => {
|
||||||
|
const curVal = parseFloat(amountFilter);
|
||||||
|
setAmountFilter(curVal + 1000);
|
||||||
|
}}>
|
||||||
|
<h3>+1000</h3>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="content-wrapper" style={{ alignItems: 'stretch', width: '100%' }}>
|
<div className="content-wrapper" style={{ alignItems: 'stretch', width: '100%' }}>
|
||||||
<ScrollContainer className="overflow-container" hideScrollbars={false}>
|
<ScrollContainer className="overflow-container" hideScrollbars={false}>
|
||||||
<div className="overflow-content" style={{ cursor: 'grab', paddingTop: 0 }}>
|
<div className="overflow-content" style={{ cursor: 'grab', paddingTop: 0 }}>
|
||||||
{obj.events.map((eventObj, idx) => {
|
{obj.events.map((eventObj, idx) => {
|
||||||
|
// Filter by minimum value
|
||||||
|
if (amountFilter !== "") {
|
||||||
|
if (parseFloat(amountFilter) > eventObj.eventValue) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Filter name on from, to, caller
|
// Filter name on from, to, caller
|
||||||
if (searchTerm !== "") {
|
if (searchTerm !== "") {
|
||||||
let isFiltered = true;
|
let isFiltered = true;
|
||||||
|
@ -7,6 +7,16 @@ a:hover, a:visited, a:link, a:active{
|
|||||||
cursor: pointer;
|
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 {
|
img {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
-webkit-user-drag: none;
|
-webkit-user-drag: none;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user