Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue102 #105

Merged
merged 4 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions neo-interface/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class App extends Component {
</div>
<Route exact path="/table" render={({match})=><NetworkTable/>} />
<Route path="/table/filterbyaddress/:addr" render={({match})=><NetworkTable addr_filter={match.params.addr}/>} />
<Route path="/table/filterbyblockheight/:bh" render={({match})=><NetworkTable blockheight_filter={match.params.bh}/>} />
<Route path="/table/filterbyversion/:v" render={({match})=><NetworkTable version_filter={match.params.v}/>} />

<Route exact path="/history" render={({match})=><HistoryTest/>} />
Expand Down
15 changes: 12 additions & 3 deletions neo-interface/src/components/NetworkTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import filterFactory, { textFilter, selectFilter } from 'react-bootstrap-table2-

class NetworkTable extends Component {
render() {
const { networktable, addr_filter, version_filter } = this.props;
const { networktable, addr_filter, version_filter, blockheight_filter } = this.props;

if (networktable.pending) {
return (
Expand All @@ -33,10 +33,17 @@ class NetworkTable extends Component {
false: "false"
};

function hyperlinkFormatter(cell, row){
return (
<a href={"/" + cell}>{cell}</a>
)
}

const columns = [{
dataField: 'id',
text: 'ID',
sort: true
sort: true,
formatter: hyperlinkFormatter
}, {
dataField: 'health_score',
text: 'Health Score',
Expand All @@ -46,7 +53,9 @@ class NetworkTable extends Component {
dataField: 'blockheight',
text: 'Blockheight',
sort: true,
filter: textFilter(),
filter: textFilter({
defaultValue: blockheight_filter
}),
formatter: (cell) => { return max_bh - cell > 0 ? String(cell) + " (-" + (max_bh - cell) + ")" : cell }
}, {
dataField: 'address',
Expand Down
2 changes: 1 addition & 1 deletion neo-interface/src/components/UnconfirmedTxInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class UnconfirmedTxInfo extends Component {
if (unconfirmTxInfo.fulfilled) {
let vins = unconfirmTxInfo.value.data.result.vin
let vin_txs = vins.map((v, i, arr) => {
return v.txid.substring(2);
return v.txid.length == 66 ? v.txid.substring(2) : v.txid;
})
console.log(vin_txs);
let y = JSON.stringify(unconfirmTxInfo.value, null, 4, 50)
Expand Down