Skip to content

Commit

Permalink
added source selection
Browse files Browse the repository at this point in the history
  • Loading branch information
javajohnHub committed Jan 30, 2018
1 parent d3ab75a commit 0d43f1b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/components/home/btfg.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class BtfgService {

constructor(private _http: HttpClient) {}

getPaymentInfo() {
return this._http.get('http://104.128.234.137/pool-payments.json');
getPaymentInfo(source) {
return this._http.get(source);
}
getBlockchainStatus() {
return this._http.get('https://wallet.burst.cryptoguru.org:8125/burst?requestType=getBlockchainStatus');
Expand Down
5 changes: 5 additions & 0 deletions src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
<br/>
<div class="ui-g ui-fluid animated fadeIn">
<div class="ui-g-12">
<div class="ui-g-6">
<p-dropdown [options]="currencies" [(ngModel)]="selectedCurrency" appendTo="body" [style]="{'width':'100%'}"></p-dropdown>
</div>
<div class="ui-g-6">
<p-dropdown [options]="sources" [(ngModel)]="selectedSource" appendTo="body" [style]="{'width':'100%'}"></p-dropdown>
</div>
<div style="background: white;color: black;">
<span *ngIf="this.selectedCurrency" style="color: darkgoldenrod">{{this.selectedCurrency.name}}:</span>
<span style="color: green">{{burstPrice}}</span>
Expand Down
19 changes: 17 additions & 2 deletions src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export class HomeComponent implements OnInit {
payoutThreshholdString;
currencies;
_selectedCurrency = { id: 1, name: 'USD' } ;
_selectedSource = { id: 1, url: 'http://burst.btfg.space/pool-payments.json' };
sources;
@ViewChild('myInput') myInput: ElementRef;
@ViewChild('teraInput') teraInput: ElementRef;
constructor(
Expand Down Expand Up @@ -85,6 +87,13 @@ export class HomeComponent implements OnInit {
{ label: 'TWD', value: { id: 31, name: 'TWD' } },
{ label: 'ZAR', value: { id: 32, name: 'ZAR' } },
];

this.sources = [
{ label: 'Select Source', value: { id: 1, url: 'http://burst.btfg.space/pool-payments.json' } },
{ label: '.space', value: { id: 1, url: 'http://burst.btfg.space/pool-payments.json' } },
{ label: '.com', value: { id: 2, url: 'http://burst.drecanis.com/pool-payments.json' } },
{ label: 'ip', value: { id: 3, url: 'http://104.128.234.137/pool-payments.json' } },
]
}

ngOnInit() {
Expand Down Expand Up @@ -245,7 +254,7 @@ export class HomeComponent implements OnInit {
this.blockReward = this.blockData['blocks'][0]['blockReward']
this.loading = false;
})
this._btfgService.getPaymentInfo()
this._btfgService.getPaymentInfo(this.selectedSource.url)
.subscribe((data) => {
this.loading = true;
this.blockShares = [];
Expand Down Expand Up @@ -364,8 +373,14 @@ export class HomeComponent implements OnInit {
this._selectedCurrency = currency;
this.reloadData();
}
get selectedSource(){
return this._selectedSource;
}
set selectedSource(source){
this._selectedSource = source;
this.reloadData();
}
get burstPrice(){
console.log(this._burstPrice)
return this._burstPrice;
}
set burstPrice(price){
Expand Down

0 comments on commit 0d43f1b

Please sign in to comment.