mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 10:21:52 +01:00
Merge branch 'master' into nymkappa/bugfix/lnd-node-networks
This commit is contained in:
commit
ffe8e52095
@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Env, StateService } from '../../services/state.service';
|
import { Env, StateService } from '../../services/state.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { LanguageService } from 'src/app/services/language.service';
|
import { LanguageService } from 'src/app/services/language.service';
|
||||||
|
import { EnterpriseService } from 'src/app/services/enterprise.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bisq-master-page',
|
selector: 'app-bisq-master-page',
|
||||||
@ -18,6 +19,7 @@ export class BisqMasterPageComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
|
private enterpriseService: EnterpriseService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Env, StateService } from '../../services/state.service';
|
import { Env, StateService } from '../../services/state.service';
|
||||||
import { merge, Observable, of} from 'rxjs';
|
import { merge, Observable, of} from 'rxjs';
|
||||||
import { LanguageService } from 'src/app/services/language.service';
|
import { LanguageService } from 'src/app/services/language.service';
|
||||||
|
import { EnterpriseService } from 'src/app/services/enterprise.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-liquid-master-page',
|
selector: 'app-liquid-master-page',
|
||||||
@ -20,6 +21,7 @@ export class LiquidMasterPageComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
|
private enterpriseService: EnterpriseService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -24,16 +24,16 @@ export class EnterpriseService {
|
|||||||
this.subdomain = subdomain;
|
this.subdomain = subdomain;
|
||||||
this.fetchSubdomainInfo();
|
this.fetchSubdomainInfo();
|
||||||
this.disableSubnetworks();
|
this.disableSubnetworks();
|
||||||
} else if (document.location.hostname === 'mempool.space') {
|
} else {
|
||||||
this.insertMatomo();
|
this.insertMatomo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubdomain() {
|
getSubdomain(): string {
|
||||||
return this.subdomain;
|
return this.subdomain;
|
||||||
}
|
}
|
||||||
|
|
||||||
disableSubnetworks() {
|
disableSubnetworks(): void {
|
||||||
this.stateService.env.TESTNET_ENABLED = false;
|
this.stateService.env.TESTNET_ENABLED = false;
|
||||||
this.stateService.env.LIQUID_ENABLED = false;
|
this.stateService.env.LIQUID_ENABLED = false;
|
||||||
this.stateService.env.LIQUID_TESTNET_ENABLED = false;
|
this.stateService.env.LIQUID_TESTNET_ENABLED = false;
|
||||||
@ -41,7 +41,7 @@ export class EnterpriseService {
|
|||||||
this.stateService.env.BISQ_ENABLED = false;
|
this.stateService.env.BISQ_ENABLED = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchSubdomainInfo() {
|
fetchSubdomainInfo(): void {
|
||||||
this.apiService.getEnterpriseInfo$(this.subdomain).subscribe((info) => {
|
this.apiService.getEnterpriseInfo$(this.subdomain).subscribe((info) => {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
this.insertMatomo(info.site_id);
|
this.insertMatomo(info.site_id);
|
||||||
@ -54,14 +54,38 @@ export class EnterpriseService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
insertMatomo(siteId = 5) {
|
insertMatomo(siteId?: number): void {
|
||||||
let statsUrl = '//stats.mempool.space/';
|
let statsUrl = '//stats.mempool.space/';
|
||||||
if (this.document.location.hostname === 'liquid.network') {
|
|
||||||
statsUrl = '//stats.liquid.network/';
|
if (!siteId) {
|
||||||
siteId = 8;
|
switch (this.document.location.hostname) {
|
||||||
} else if (this.document.location.hostname === 'bisq.markets') {
|
case 'mempool.space':
|
||||||
statsUrl = '//stats.bisq.markets/';
|
statsUrl = '//stats.mempool.space/';
|
||||||
siteId = 7;
|
siteId = 5;
|
||||||
|
break;
|
||||||
|
case 'mempool.ninja':
|
||||||
|
statsUrl = '//stats.mempool.space/';
|
||||||
|
siteId = 4;
|
||||||
|
break;
|
||||||
|
case 'liquid.network':
|
||||||
|
siteId = 8;
|
||||||
|
statsUrl = '//stats.liquid.network/';
|
||||||
|
break;
|
||||||
|
case 'liquid.place':
|
||||||
|
siteId = 10;
|
||||||
|
statsUrl = '//stats.liquid.network/';
|
||||||
|
break;
|
||||||
|
case 'bisq.markets':
|
||||||
|
siteId = 7;
|
||||||
|
statsUrl = '//stats.bisq.markets/';
|
||||||
|
break;
|
||||||
|
case 'bisq.ninja':
|
||||||
|
statsUrl = '//stats.bisq.markets/';
|
||||||
|
siteId = 11;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user