Browse Source

web-ui: Small fixes to merge #31

- The Transaction model was updated.
- Useless code removed.
- Added missing details to the AddressDetails component.
prometheus-integration v2018.06.24
Alexis Hernandez 7 years ago
parent
commit
2a339a5678
  1. 4
      web-ui/src/app/components/address-details/address-details.component.html
  2. 9
      web-ui/src/app/components/address-details/address-details.component.ts
  3. 2
      web-ui/src/app/models/transaction.ts

4
web-ui/src/app/components/address-details/address-details.component.html

@ -32,7 +32,7 @@
</tr> </tr>
<tr> <tr>
<td>{{'label.spent' | translate}}</td> <td>{{'label.spent' | translate}}</td>
<td>{{getSent(address)}} {{'label.coinName' | translate}}</td> <td>{{address.spent}} {{'label.coinName' | translate}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -67,7 +67,7 @@
</td> </td>
<td>{{item.time * 1000 | date:'MMMM d, y, h:mm:ss a'}}</td> <td>{{item.time * 1000 | date:'MMMM d, y, h:mm:ss a'}}</td>
<td>{{item.received >= item.sent ? '+' : ''}}{{item.received - item.sent}} {{'label.coinName' | translate}}</td> <td>{{item.received >= item.sent ? '+' : ''}}{{item.received - item.sent}} {{'label.coinName' | translate}}</td>
<td>{{item.size}}</td> <td>{{item.size}} bytes</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

9
web-ui/src/app/components/address-details/address-details.component.ts

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
@ -8,7 +8,6 @@ import { Transaction } from '../../models/transaction';
import { AddressesService } from '../../services/addresses.service'; import { AddressesService } from '../../services/addresses.service';
import { ErrorService } from '../../services/error.service'; import { ErrorService } from '../../services/error.service';
import { NavigatorService } from '../../services/navigator.service';
@Component({ @Component({
selector: 'app-address-details', selector: 'app-address-details',
@ -28,8 +27,6 @@ export class AddressDetailsComponent implements OnInit {
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router,
private navigatorService: NavigatorService,
private addressesService: AddressesService, private addressesService: AddressesService,
private errorService: ErrorService) { } private errorService: ErrorService) { }
@ -61,8 +58,4 @@ export class AddressDetailsComponent implements OnInit {
private onError(response: any) { private onError(response: any) {
this.errorService.renderServerErrors(null, response); this.errorService.renderServerErrors(null, response);
} }
getSent(address: Balance): number {
return address.received - address.available;
}
} }

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

@ -8,6 +8,8 @@ export class Transaction {
confirmations: number; confirmations: number;
input: TransactionValue[]; input: TransactionValue[];
output: TransactionValue[]; output: TransactionValue[];
sent: number;
received: number;
} }
class TransactionValue { class TransactionValue {

Loading…
Cancel
Save