Browse Source

web-ui: Update TransactionDetails to link addresses and blocks

scalafmt-draft
Alexis Hernandez 7 years ago
parent
commit
011479a341
  1. 11
      web-ui/src/app/components/transaction-details/transaction-details.component.html
  2. 2
      web-ui/src/app/components/transaction-details/transaction-details.component.ts

11
web-ui/src/app/components/transaction-details/transaction-details.component.html

@ -14,7 +14,8 @@
<!-- TODO: Add link to block view -->
<div class="row">
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{'label.blockhash' | translate}}</label>
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{transaction.blockhash}}</label>
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">
<a routerLink="/blocks/{{transaction.blockhash}}">{{transaction.blockhash}}</a></label>
</div>
<div class="row">
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{'label.blocktime' | translate}}</label>
@ -36,7 +37,9 @@
<div *ngIf="transaction.input != null">
<div class="row">
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{'label.from' | translate}}</label>
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{transaction.input.address}}</label>
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">
<a routerLink="/addresses/{{transaction.input.address}}">{{transaction.input.address}}</a>
</label>
</div>
<div class="row">
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{'label.value' | translate}}</label>
@ -53,7 +56,9 @@
<div *ngFor="let item of transaction.output">
<div class="row">
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{'label.to' | translate}}</label>
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{item.address}}</label>
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">
<a routerLink="/addresses/{{item.address}}">{{item.address}}</a>
</label>
</div>
<div class="row">
<label class="col-sm-2 col-md-1 col-xs-1 col-lg-1">{{'label.value' | translate}}</label>

2
web-ui/src/app/components/transaction-details/transaction-details.component.ts

@ -42,7 +42,7 @@ export class TransactionDetailsComponent implements OnInit {
}
getFee(tx: Transaction): number {
const vout = tx.output.map(t => t.value).reduce((a, b) => a + b);
const vout = tx.output.map(t => t.value).reduce((a, b) => a + b, 0);
return Math.max(0, this.getVIN(tx) - vout);
}

Loading…
Cancel
Save