Compare commits

...

9 Commits

6 changed files with 49 additions and 37 deletions

View File

@@ -16,7 +16,7 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
super(bitcoinClient); super(bitcoinClient);
const electrumConfig = { client: 'mempool-v2', version: '1.4' }; const electrumConfig = { client: 'mempool-v2', version: '1.4' };
const electrumPersistencePolicy = { retryPeriod: 10000, maxRetry: 1000, callback: null }; const electrumPersistencePolicy = { retryPeriod: 1000, maxRetry: Number.MAX_SAFE_INTEGER, callback: null };
const electrumCallbacks = { const electrumCallbacks = {
onConnect: (client, versionInfo) => { logger.info(`Connected to Electrum Server at ${config.ELECTRUM.HOST}:${config.ELECTRUM.PORT} (${JSON.stringify(versionInfo)})`); }, onConnect: (client, versionInfo) => { logger.info(`Connected to Electrum Server at ${config.ELECTRUM.HOST}:${config.ELECTRUM.PORT} (${JSON.stringify(versionInfo)})`); },

View File

@@ -106,6 +106,7 @@ https://www.transifex.com/mempool/mempool/dashboard/
* Arabic @baro0k * Arabic @baro0k
* Czech @pixelmade2 * Czech @pixelmade2
* Danish @pierrevendelboe
* German @Emzy * German @Emzy
* English (default) * English (default)
* Spanish @maxhodler @bisqes * Spanish @maxhodler @bisqes
@@ -113,6 +114,7 @@ https://www.transifex.com/mempool/mempool/dashboard/
* French @Bayernatoor * French @Bayernatoor
* Korean @kcalvinalvinn @sogoagain * Korean @kcalvinalvinn @sogoagain
* Italian @HodlBits * Italian @HodlBits
* Lithuanian @eimze21
* Hebrew @rapidlab309 * Hebrew @rapidlab309
* Georgian @wyd_idk * Georgian @wyd_idk
* Hungarian @btcdragonlord * Hungarian @btcdragonlord

View File

@@ -101,8 +101,15 @@ export class NodeFeeChartComponent implements OnInit {
} }
prepareChartOptions(outgoingData, incomingData): void { prepareChartOptions(outgoingData, incomingData): void {
let sum = outgoingData.reduce((accumulator, object) => {
return accumulator + object.count;
}, 0);
sum += incomingData.reduce((accumulator, object) => {
return accumulator + object.count;
}, 0);
let title: object; let title: object;
if (outgoingData.length === 0) { if (sum === 0) {
title = { title = {
textStyle: { textStyle: {
color: 'grey', color: 'grey',
@@ -115,7 +122,7 @@ export class NodeFeeChartComponent implements OnInit {
} }
this.chartOptions = { this.chartOptions = {
title: outgoingData.length === 0 ? title : undefined, title: sum === 0 ? title : undefined,
animation: false, animation: false,
grid: { grid: {
top: 30, top: 30,
@@ -151,7 +158,7 @@ export class NodeFeeChartComponent implements OnInit {
`; `;
} }
}, },
xAxis: outgoingData.length === 0 ? undefined : { xAxis: sum === 0 ? undefined : {
type: 'category', type: 'category',
axisLine: { onZero: true }, axisLine: { onZero: true },
axisLabel: { axisLabel: {
@@ -163,7 +170,7 @@ export class NodeFeeChartComponent implements OnInit {
}, },
data: outgoingData.map(bucket => bucket.label) data: outgoingData.map(bucket => bucket.label)
}, },
legend: outgoingData.length === 0 ? undefined : { legend: sum === 0 ? undefined : {
padding: 10, padding: 10,
data: [ data: [
{ {
@@ -184,7 +191,7 @@ export class NodeFeeChartComponent implements OnInit {
}, },
], ],
}, },
yAxis: outgoingData.length === 0 ? undefined : [ yAxis: sum === 0 ? undefined : [
{ {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
@@ -202,7 +209,7 @@ export class NodeFeeChartComponent implements OnInit {
}, },
}, },
], ],
series: outgoingData.length === 0 ? undefined : [ series: sum === 0 ? undefined : [
{ {
zlevel: 0, zlevel: 0,
name: $localize`Outgoing Fees`, name: $localize`Outgoing Fees`,

View File

@@ -75,13 +75,13 @@ export class NodeStatisticsChartComponent implements OnInit {
prepareChartOptions(data) { prepareChartOptions(data) {
let title: object; let title: object;
if (data.channels.length === 0) { if (data.channels.length < 2) {
title = { title = {
textStyle: { textStyle: {
color: 'grey', color: 'grey',
fontSize: 15 fontSize: 15
}, },
text: `Loading`, text: $localize`No data to display yet. Try again later.`,
left: 'center', left: 'center',
top: 'center' top: 'center'
}; };
@@ -135,14 +135,14 @@ export class NodeStatisticsChartComponent implements OnInit {
return tooltip; return tooltip;
} }
}, },
xAxis: data.channels.length === 0 ? undefined : { xAxis: data.channels.length < 2 ? undefined : {
type: 'time', type: 'time',
splitNumber: this.isMobile() ? 5 : 10, splitNumber: this.isMobile() ? 5 : 10,
axisLabel: { axisLabel: {
hideOverlap: true, hideOverlap: true,
} }
}, },
legend: data.channels.length === 0 ? undefined : { legend: data.channels.length < 2 ? undefined : {
padding: 10, padding: 10,
data: [ data: [
{ {
@@ -167,7 +167,7 @@ export class NodeStatisticsChartComponent implements OnInit {
'Capacity': true, 'Capacity': true,
} }
}, },
yAxis: data.channels.length === 0 ? undefined : [ yAxis: data.channels.length < 2 ? undefined : [
{ {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
@@ -198,7 +198,7 @@ export class NodeStatisticsChartComponent implements OnInit {
} }
} }
], ],
series: data.channels.length === 0 ? [] : [ series: data.channels.length < 2 ? [] : [
{ {
zlevel: 1, zlevel: 1,
name: $localize`:@@807cf11e6ac1cde912496f764c176bdfdd6b7e19:Channels`, name: $localize`:@@807cf11e6ac1cde912496f764c176bdfdd6b7e19:Channels`,

View File

@@ -18,8 +18,5 @@
<div class="text-center loading-spinner" [class]="style" *ngIf="isLoading && !disableSpinner"> <div class="text-center loading-spinner" [class]="style" *ngIf="isLoading && !disableSpinner">
<div class="spinner-border text-light"></div> <div class="spinner-border text-light"></div>
</div> </div>
<div *ngIf="showIndexingInProgress" class="indexing-message">
<span class="badge badge-pill badge-warning" i18n="lightning.indexing-in-progress">Indexing in progress</span>
</div>
</ng-container> </ng-container>
</div> </div>

View File

@@ -36,7 +36,6 @@ export class NodesChannelsMap implements OnInit {
channelCurve = 0; channelCurve = 0;
nodeSize = 4; nodeSize = 4;
isLoading = false; isLoading = false;
showIndexingInProgress = false;
chartInstance = undefined; chartInstance = undefined;
chartOptions: EChartsOption = {}; chartOptions: EChartsOption = {};
@@ -205,26 +204,33 @@ export class NodesChannelsMap implements OnInit {
prepareChartOptions(nodes, channels) { prepareChartOptions(nodes, channels) {
let title: object; let title: object;
if (channels.length === 0 && !this.placeholder) { if (channels.length === 0) {
this.chartOptions = null; if (!this.placeholder) {
this.showIndexingInProgress = true; this.isLoading = false;
this.isLoading = false; title = {
return; textStyle: {
} color: 'white',
fontSize: 18
// empty map fallback },
if (channels.length === 0 && this.placeholder) { text: $localize`No data to display yet. Try again later.`,
title = { left: 'center',
textStyle: { top: 'center'
color: 'white', };
fontSize: 18 this.zoom = 1.5;
}, this.center = [0, 20];
text: $localize`No geolocation data available`, } else { // used for Node and Channel preview components
left: 'center', title = {
top: 'center' textStyle: {
}; color: 'white',
this.zoom = 1.5; fontSize: 18
this.center = [0, 20]; },
text: $localize`No geolocation data available`,
left: 'center',
top: 'center'
};
this.zoom = 1.5;
this.center = [0, 20];
}
} }
this.chartOptions = { this.chartOptions = {