Browse Source

web-ui: Support multiple inputs on the Transaction view

scalafmt-draft
Alexis Hernandez 7 years ago
parent
commit
c27f48e427
  1. 8
      web-ui/src/app/components/transaction-details/transaction-details.component.html
  2. 4
      web-ui/src/app/components/transaction-details/transaction-details.component.ts
  3. 2
      web-ui/src/app/models/transaction.ts

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

@ -61,15 +61,15 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngIf="transaction.input == null"> <tr *ngIf="transaction.input == null || transaction.input.length == 0">
<td>{{'label.coinbase' | translate}}</td> <td>{{'label.coinbase' | translate}}</td>
<td></td> <td></td>
</tr> </tr>
<tr *ngIf="transaction.input != null"> <tr *ngFor="let item of transaction.input">
<td> <td>
<a routerLink="/addresses/{{transaction.input.address}}">{{transaction.input.address}}</a> <a routerLink="/addresses/{{item.address}}">{{item.address}}</a>
</td> </td>
<td>{{transaction.input.value}} {{'label.coinName' | translate}}</td> <td>{{item.value}} {{'label.coinName' | translate}}</td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>

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

@ -47,10 +47,10 @@ export class TransactionDetailsComponent implements OnInit {
} }
private getVIN(tx): number { private getVIN(tx): number {
if (tx.input == null) { if (tx.input == null || tx.input.length === 0) {
return 0; return 0;
} else { } else {
return tx.input.value; return tx.input.map(t => t.value).reduce((a, b) => a + b, 0);
} }
} }
} }

2
web-ui/src/app/models/transaction.ts

@ -6,7 +6,7 @@ export class Transaction {
time: number; time: number;
blocktime: number; blocktime: number;
confirmations: number; confirmations: number;
input: TransactionValue; input: TransactionValue[];
output: TransactionValue[]; output: TransactionValue[];
} }

Loading…
Cancel
Save