From f32a025785262e43dcba9ac8ced4c4ce3b433196 Mon Sep 17 00:00:00 2001 From: igorshelkovenkov Date: Thu, 21 Sep 2023 16:49:07 +0200 Subject: [PATCH] Add server version and fix links in info --- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/app/app.component.ts | 3 --- src/app/pages/info/info.component.html | 23 ++++++++++------------- src/app/pages/info/info.component.ts | 14 +++++++++++++- src/environments/environment.prod.ts | 9 ++++++--- src/environments/environment.ts | 8 +++++--- src/interface/Changelog.ts | 5 +++++ src/interface/Data.ts | 4 ++++ src/service/data.service.ts | 6 +++++- 10 files changed, 50 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index b3e6d5b5..90f2e3d6 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "email": "cypto@shelkovenkov.de", "url": "https://www.defichain-income.com" }, - "version": "10.2.19", + "version": "10.2.20", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index de8797c2..d24dc103 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "DefiChain-Income", - "version": "10.2.19" + "version": "10.2.20" }, "build": { "distDir": "../dist/defichain-income", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f7fc23b8..a10d9481 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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(); } diff --git a/src/app/pages/info/info.component.html b/src/app/pages/info/info.component.html index 5aa9777e..ddc1da7c 100644 --- a/src/app/pages/info/info.component.html +++ b/src/app/pages/info/info.component.html @@ -49,31 +49,28 @@

{{ "welcome2" | translate }}


+

+ Backend Version {{version}} +

+

{{ "powered" | translate }}

-

- Supernode API (Saiive Wallet) - - https://supernode.saiive.live/api/v1 - -

-

Cake API - - https://api.cakedefi.com/staking + + https://api.cakedefi.com/coins/apy

- Masternode API + Ocean API - http://defichain-node.de/api/v1/listmasternodes/?count=True + href="https://ocean.defichain.com"> + https://ocean.defichain.com

@@ -90,7 +87,7 @@

{{ "history" | translate }} diff --git a/src/app/pages/info/info.component.ts b/src/app/pages/info/info.component.ts index 9c1c9145..01d5e1ee 100644 --- a/src/app/pages/info/info.component.ts +++ b/src/app/pages/info/info.component.ts @@ -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', @@ -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 { + const promise = await this.http.get(environment.versionBackend).toPromise(); + this.version = promise.version; } + } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index dadfbcc1..85be16fe 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,5 @@ const ocean = 'https://ocean.defichain.com'; +const server = "https://aws-backend.defichain-income.com/"; export const environment = { production: true, @@ -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/' diff --git a/src/environments/environment.ts b/src/environments/environment.ts index c6309218..d32d0949 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -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, @@ -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, diff --git a/src/interface/Changelog.ts b/src/interface/Changelog.ts index ce163bb4..235ef279 100644 --- a/src/interface/Changelog.ts +++ b/src/interface/Changelog.ts @@ -11,6 +11,11 @@ export class Changelog { this.logs = new Array(); + 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'; diff --git a/src/interface/Data.ts b/src/interface/Data.ts index 71f37150..2f59a46a 100644 --- a/src/interface/Data.ts +++ b/src/interface/Data.ts @@ -1263,6 +1263,10 @@ export class IncomeVault { nextVaultRation: number; } +export class ServerVersion { + version: string +} + export class Income { totalValueLM: number; diff --git a/src/service/data.service.ts b/src/service/data.service.ts index 3ff62ea0..328e72e0 100644 --- a/src/service/data.service.ts +++ b/src/service/data.service.ts @@ -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'; @@ -72,6 +72,10 @@ export class DataService { return this.http.post(environment.income, body); } + public getServerVersion(): Observable { + return this.http.get(environment.versionBackend); + } + getPrice(fiat: string): number { if (fiat === 'USD') { return 1;