Browse Source

web-ui: Add a column for label the richest addresses

Add a column in the richest-addresses component
Update address title
develop
Adinael Perez Ruelas 5 years ago
parent
commit
317aa4c624
  1. 1
      web-ui/src/app/app.component.ts
  2. 4
      web-ui/src/app/components/address-details/address-details.component.html
  3. 2
      web-ui/src/app/components/address-details/address-details.component.ts
  4. 4
      web-ui/src/app/components/richest-addresses/richest-addresses.component.html
  5. 6
      web-ui/src/app/components/richest-addresses/richest-addresses.component.ts
  6. 6
      web-ui/src/app/config.ts

1
web-ui/src/app/app.component.ts

@ -145,6 +145,7 @@ export class AppComponent implements OnInit {
'label.richestAddresses': 'Richest addresses', 'label.richestAddresses': 'Richest addresses',
'label.masternodes': 'Masternodes', 'label.masternodes': 'Masternodes',
'label.percentOfCoins': 'Percent of coins', 'label.percentOfCoins': 'Percent of coins',
'label.addressLabel': 'Label',
'label.protocol': 'Protocol', 'label.protocol': 'Protocol',
'label.status': 'Status', 'label.status': 'Status',
'label.lastSeen': 'Last seen', 'label.lastSeen': 'Last seen',

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

@ -4,7 +4,9 @@
</div> </div>
<div *ngIf="address != null"> <div *ngIf="address != null">
<div class="row"> <div class="row">
<h2 class="col-xs-12">{{'label.address' | translate}}</h2> <h2 *ngIf="!addressLabel[addressString]" class="col-xs-12">{{'label.address' | translate}}</h2>
<h2 *ngIf="addressLabel[addressString]" class="col-xs-12">{{ addressLabel[addressString]}}</h2>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-4">

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

@ -9,6 +9,7 @@ import { ErrorService } from '../../services/error.service';
import { LightWalletTransaction } from '../..//models/light-wallet-transaction'; import { LightWalletTransaction } from '../..//models/light-wallet-transaction';
import { getNumberOfRowsForScreen } from '../../utils'; import { getNumberOfRowsForScreen } from '../../utils';
import { addressLabels } from '../../config';
@Component({ @Component({
selector: 'app-address-details', selector: 'app-address-details',
@ -19,6 +20,7 @@ export class AddressDetailsComponent implements OnInit {
address: Balance; address: Balance;
addressString: string; addressString: string;
addressLabel = addressLabels;
// pagination // pagination
limit = 30; limit = 30;

4
web-ui/src/app/components/richest-addresses/richest-addresses.component.html

@ -11,6 +11,7 @@
<th class="col-xs-2 col-md-1">{{'label.address' | translate}}</th> <th class="col-xs-2 col-md-1">{{'label.address' | translate}}</th>
<th class="col-xs-2 col-md-1">{{'label.amount' | translate}}</th> <th class="col-xs-2 col-md-1">{{'label.amount' | translate}}</th>
<th class="col-xs-2 col-md-1">{{'label.percentOfCoins' | translate}}</th> <th class="col-xs-2 col-md-1">{{'label.percentOfCoins' | translate}}</th>
<th class="col-xs-2 col-md-1">{{'label.addressLabel' | translate}}</th>
</tr> </tr>
</thead> </thead>
@ -35,6 +36,9 @@
{{getPercent(item) | number:'1.2-2'}} % {{getPercent(item) | number:'1.2-2'}} %
</div> </div>
</td> </td>
<td>
<span class="label label-primary">{{addressLabel[item.address]}}</span>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

6
web-ui/src/app/components/richest-addresses/richest-addresses.component.ts

@ -2,9 +2,6 @@
import {tap} from 'rxjs/operators'; import {tap} from 'rxjs/operators';
import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; import { Component, OnInit, OnDestroy, HostListener } from '@angular/core';
import { Balance } from '../../models/balance'; import { Balance } from '../../models/balance';
import { BalancesService } from '../../services/balances.service'; import { BalancesService } from '../../services/balances.service';
@ -12,6 +9,7 @@ import { TickerService } from '../../services/ticker.service';
import { ServerStats } from '../../models/ticker'; import { ServerStats } from '../../models/ticker';
import { getNumberOfRowsForScreen } from '../../utils'; import { getNumberOfRowsForScreen } from '../../utils';
import { addressLabels } from '../../config';
@Component({ @Component({
selector: 'app-richest-addresses', selector: 'app-richest-addresses',
@ -27,6 +25,8 @@ export class RichestAddressesComponent implements OnInit {
limit = 30; limit = 30;
items: Balance[] = []; items: Balance[] = [];
addressLabel = addressLabels;
constructor( constructor(
private balancesService: BalancesService, private balancesService: BalancesService,
private tickerService: TickerService) { } private tickerService: TickerService) { }

6
web-ui/src/app/config.ts

@ -1,3 +1,9 @@
export class Config { export class Config {
static currentCurrency = 'XSN'; static currentCurrency = 'XSN';
} }
export const addressLabels = {
'7jqffPwhzkVGbYFf525muhas6uVrhERwAm': 'Cryptopia',
'7iYWrbBhYczSYPZ3Naesd9Yk4X5qn4dNAg': 'Livecoin',
'Xi1BEVHFRYg1QQfrNJF8L9yXvREAADxCLk': 'Stakenet.io Cloud Staking'
};

Loading…
Cancel
Save