Skip to content

Commit

Permalink
Add server version and fix links in info
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshelkovenkov committed Sep 21, 2023
1 parent 83c4ffc commit f32a025
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"email": "[email protected]",
"url": "https://www.defichain-income.com"
},
"version": "10.2.19",
"version": "10.2.20",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"package": {
"productName": "DefiChain-Income",
"version": "10.2.19"
"version": "10.2.20"
},
"build": {
"distDir": "../dist/defichain-income",
Expand Down
3 changes: 0 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,6 @@ export class AppComponent implements OnInit {
this.dataService.setDfiUsd(this.poolBtc?.priceB);

this.avgApr = this.getAPRAverage();
if (this.apiOnline) {
this.update();
}
this.spinner.hide();
}

Expand Down
23 changes: 10 additions & 13 deletions src/app/pages/info/info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,28 @@ <h3 class="text-xl mb-4">{{ "welcome2" | translate }}</h3>
</div>
</a>
<br>
<h3 class="mb-2 text-xl">
Backend Version {{version}}
</h3>
<br>
<h3 class="mb-2 text-2xl">
{{ "powered" | translate }}

</h3>

<p class="mb-2">
Supernode API (Saiive Wallet)
<a class="text-pink-500 hover:underline" href="https://supernode.saiive.live/api/v1">
https://supernode.saiive.live/api/v1
</a>
</p>

<p class="mb-2">
Cake API
<a class="text-pink-500 hover:underline" href="https://api.cakedefi.com/staking">
https://api.cakedefi.com/staking
<a class="text-pink-500 hover:underline" href='https://api.cakedefi.com/coins/apy'>
https://api.cakedefi.com/coins/apy
</a>
</p>

<p class="mb-2">
Masternode API
Ocean API
<a class="text-pink-500 hover:underline"
target="_blank"
href="http://defichain-node.de/api/v1/listmasternodes/?count=True">
http://defichain-node.de/api/v1/listmasternodes/?count=True
href="https://ocean.defichain.com">
https://ocean.defichain.com
</a>
</p>

Expand All @@ -90,7 +87,7 @@ <h3 class="mb-2 text-2xl">
{{ "history" | translate }}
<a
(click)="trackGraphQL()"
href="https://next.graphql.defichain-income.com/graphql"
href="https://aws-backend.defichain-income.com/graphql"
target="_blank"
class="text-pink-500 hover:underline"
>
Expand Down
14 changes: 13 additions & 1 deletion src/app/pages/info/info.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { Currencies, ServerVersion } from '@interfaces/Data'
import { environment } from '@environments/environment'
import { HttpClient } from '@angular/common/http'

@Component({
selector: 'app-info-page',
Expand All @@ -11,8 +14,17 @@ export class InfoComponent implements OnInit {
@Input()
trackGraphQL: () => void;

constructor() { }
version = "1.0.0"

constructor(private http: HttpClient) { }

ngOnInit(): void {
this.getVersionBackend();
}

public async getVersionBackend(): Promise<void> {
const promise = await this.http.get<ServerVersion>(environment.versionBackend).toPromise();
this.version = promise.version;
}

}
9 changes: 6 additions & 3 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const ocean = 'https://ocean.defichain.com';
const server = "https://aws-backend.defichain-income.com/";

export const environment = {
production: true,
Expand All @@ -18,11 +19,13 @@ export const environment = {
burninfo: 'https://api.mydefichain.com/v1/getburninfo/',
lock: 'https://api.lock.space/v1/staking/balance?userAddress=',
lockStats: 'https://api.lock.space/v1/analytics/staking',
version: '10.2.19',
version: '10.2.20',
bittrex: 'https://api.bittrex.com/v3/currencies/DFI',
kucoin: 'https://api.kucoin.com/api/v1/currencies/DFI',
graphql: 'https://aws-backend.defichain-income.com/graphql',
income: 'https://aws-backend.defichain-income.com/income',
graphql: server + '/graphql',
income: server + '/income',
versionBackend: server + '/version',

// Matomo
matomoId: 6,
matomoUrl: 'https://analytics.topiet.de/'
Expand Down
8 changes: 5 additions & 3 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The list of file replacements can be found in `angular.json`.

const ocean = 'https://ocean.defichain.com';
const server = "https://aws-backend.defichain-income.com";

export const environment = {
production: false,
Expand All @@ -22,9 +23,10 @@ export const environment = {
burninfo: 'https://api.mydefichain.com/v1/getburninfo/',
lock: 'https://api.lock.space/v1/staking/balance?userAddress=',
lockStats: 'https://api.lock.space/v1/analytics/staking?asset=DFI&blockchain=DeFiChain&strategy=Masternode',
version: '10.2.19',
graphql: 'https://aws-backend.defichain-income.com/graphql',
income: 'https://aws-backend.defichain-income.com/income',
version: '10.2.20',
graphql: server + '/graphql',
income: server + '/income',
versionBackend: server + '/version',
// Matomo
// No tracking for local -> wrong id
matomoId: 25,
Expand Down
5 changes: 5 additions & 0 deletions src/interface/Changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export class Changelog {

this.logs = new Array<Log>();

this.log = new Log();
this.log.version = '10.2.20 - 21.9.2023';
this.log.comment = 'Add server version and fix links in info';
this.logs.push(this.log);

this.log = new Log();
this.log.version = '10.2.19 - 20.9.2023';
this.log.comment = 'Move to AWS Backend';
Expand Down
4 changes: 4 additions & 0 deletions src/interface/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,10 @@ export class IncomeVault {
nextVaultRation: number;
}

export class ServerVersion {
version: string
}

export class Income {

totalValueLM: number;
Expand Down
6 changes: 5 additions & 1 deletion src/service/data.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {environment} from '@environments/environment';
import {Currencies, Income, USD } from '@interfaces/Data'
import { Currencies, Income, ServerVersion, USD } from '@interfaces/Data'
import {Observable} from 'rxjs';
import {MamonAccountNode} from '@interfaces/Mamon';

Expand Down Expand Up @@ -72,6 +72,10 @@ export class DataService {
return this.http.post<Income>(environment.income, body);
}

public getServerVersion(): Observable<ServerVersion> {
return this.http.get<ServerVersion>(environment.versionBackend);
}

getPrice(fiat: string): number {
if (fiat === 'USD') {
return 1;
Expand Down

0 comments on commit f32a025

Please sign in to comment.