From d75dc30fa8ed1aa293ac7a1af13ef717c5a9a80a Mon Sep 17 00:00:00 2001 From: nymkappa Date: Fri, 10 Jun 2022 23:29:27 +0200 Subject: [PATCH 1/4] Replace "Indexing in progress" with localized "Indexing blocks" --- .../block-sizes-weights-graph.component.ts | 2 +- .../app/components/hashrate-chart/hashrate-chart.component.ts | 2 +- .../hashrates-chart-pools/hashrate-chart-pools.component.ts | 2 +- frontend/src/app/components/pool/pool.component.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts b/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts index 3255fc4af..c6d60d8f0 100644 --- a/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts +++ b/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts @@ -107,7 +107,7 @@ export class BlockSizesWeightsGraphComponent implements OnInit { color: 'grey', fontSize: 15 }, - text: `Indexing in progess`, + text: $localize`:@@23555386d8af1ff73f297e89dd4af3f4689fb9dd:Indexing blocks`, left: 'center', top: 'center' }; diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts index d401f76ad..f861919dd 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -141,7 +141,7 @@ export class HashrateChartComponent implements OnInit { color: 'grey', fontSize: 15 }, - text: `Indexing in progess`, + text: $localize`:@@23555386d8af1ff73f297e89dd4af3f4689fb9dd:Indexing blocks`, left: 'center', top: 'center' }; diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts index 528a783d5..dff6928f6 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts @@ -155,7 +155,7 @@ export class HashrateChartPoolsComponent implements OnInit { color: 'grey', fontSize: 15 }, - text: `Indexing in progess`, + text: $localize`:@@23555386d8af1ff73f297e89dd4af3f4689fb9dd:Indexing blocks`, left: 'center', top: 'center', }; diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index 3111d78b8..0ff3542ca 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -111,7 +111,7 @@ export class PoolComponent implements OnInit { color: 'grey', fontSize: 15 }, - text: `Indexing in progress`, + text: $localize`:@@23555386d8af1ff73f297e89dd4af3f4689fb9dd:Indexing blocks`, left: 'center', top: 'center' }; From 08a45ea6807d32be1c527d3a455c4076684bcbf5 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Fri, 10 Jun 2022 23:34:13 +0200 Subject: [PATCH 2/4] Make all mining charts tooltips uniform --- .../block-fee-rates-graph.component.ts | 7 +++---- .../block-fees-graph.component.ts | 21 ++++++++++++------- .../block-rewards-graph.component.ts | 21 ++++++++++++------- .../block-sizes-weights-graph.component.ts | 20 +++++++----------- .../hashrate-chart.component.ts | 2 +- .../hashrate-chart-pools.component.ts | 2 +- frontend/src/app/shared/graphs.utils.ts | 6 ++---- 7 files changed, 40 insertions(+), 39 deletions(-) diff --git a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts index 3a4d2b89d..e34687745 100644 --- a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts +++ b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts @@ -169,17 +169,16 @@ export class BlockFeeRatesGraphComponent implements OnInit { if (data.length <= 0) { return ''; } - let tooltip = ` - ${formatterXAxis(this.locale, this.timespan, parseInt(data[0].axisValue, 10))}
`; + let tooltip = `${formatterXAxis(this.locale, this.timespan, parseInt(data[0].axisValue, 10))}
`; for (const pool of data.reverse()) { tooltip += `${pool.marker} ${pool.seriesName}: ${pool.data[1]} sats/vByte
`; } if (['24h', '3d'].includes(this.timespan)) { - tooltip += `At block: ${data[0].data[2]}`; + tooltip += `` + $localize`At block: ${data[0].data[2]}` + ``; } else { - tooltip += `Around block ${data[0].data[2]}`; + tooltip += `` + $localize`Around block: ${data[0].data[2]}` + ``; } return tooltip; diff --git a/frontend/src/app/components/block-fees-graph/block-fees-graph.component.ts b/frontend/src/app/components/block-fees-graph/block-fees-graph.component.ts index 185938d5d..3ae260817 100644 --- a/frontend/src/app/components/block-fees-graph/block-fees-graph.component.ts +++ b/frontend/src/app/components/block-fees-graph/block-fees-graph.component.ts @@ -6,7 +6,7 @@ import { ApiService } from 'src/app/services/api.service'; import { SeoService } from 'src/app/services/seo.service'; import { formatNumber } from '@angular/common'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { download, formatterXAxisLabel } from 'src/app/shared/graphs.utils'; +import { download, formatterXAxis, formatterXAxisLabel } from 'src/app/shared/graphs.utils'; import { StorageService } from 'src/app/services/storage.service'; import { MiningService } from 'src/app/services/mining.service'; @@ -71,7 +71,7 @@ export class BlockFeesGraphComponent implements OnInit { .pipe( tap((response) => { this.prepareChartOptions({ - blockFees: response.body.map(val => [val.timestamp * 1000, val.avgFees / 100000000]), + blockFees: response.body.map(val => [val.timestamp * 1000, val.avgFees / 100000000, val.avgHeight]), }); this.isLoading = false; }), @@ -119,12 +119,17 @@ export class BlockFeesGraphComponent implements OnInit { }, borderColor: '#000', formatter: (ticks) => { - const tick = ticks[0]; - const feesString = `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.3-3')} BTC`; - return ` - ${tick.axisValueLabel}
- ${feesString} - `; + let tooltip = `${formatterXAxis(this.locale, this.timespan, parseInt(ticks[0].axisValue, 10))}
`; + tooltip += `${ticks[0].marker} ${ticks[0].seriesName}: ${formatNumber(ticks[0].data[1], this.locale, '1.3-3')} BTC`; + tooltip += `
`; + + if (['24h', '3d'].includes(this.timespan)) { + tooltip += `` + $localize`At block: ${ticks[0].data[2]}` + ``; + } else { + tooltip += `` + $localize`Around block: ${ticks[0].data[2]}` + ``; + } + + return tooltip; } }, xAxis: { diff --git a/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.ts b/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.ts index 24614903c..ce71c6986 100644 --- a/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.ts +++ b/frontend/src/app/components/block-rewards-graph/block-rewards-graph.component.ts @@ -6,7 +6,7 @@ import { ApiService } from 'src/app/services/api.service'; import { SeoService } from 'src/app/services/seo.service'; import { formatNumber } from '@angular/common'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { download, formatterXAxisLabel } from 'src/app/shared/graphs.utils'; +import { download, formatterXAxis, formatterXAxisLabel } from 'src/app/shared/graphs.utils'; import { MiningService } from 'src/app/services/mining.service'; import { StorageService } from 'src/app/services/storage.service'; @@ -69,7 +69,7 @@ export class BlockRewardsGraphComponent implements OnInit { .pipe( tap((response) => { this.prepareChartOptions({ - blockRewards: response.body.map(val => [val.timestamp * 1000, val.avgRewards / 100000000]), + blockRewards: response.body.map(val => [val.timestamp * 1000, val.avgRewards / 100000000, val.avgHeight]), }); this.isLoading = false; }), @@ -117,12 +117,17 @@ export class BlockRewardsGraphComponent implements OnInit { }, borderColor: '#000', formatter: (ticks) => { - const tick = ticks[0]; - const rewardsString = `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.3-3')} BTC`; - return ` - ${tick.axisValueLabel}
- ${rewardsString} - `; + let tooltip = `${formatterXAxis(this.locale, this.timespan, parseInt(ticks[0].axisValue, 10))}
`; + tooltip += `${ticks[0].marker} ${ticks[0].seriesName}: ${formatNumber(ticks[0].data[1], this.locale, '1.3-3')} BTC`; + tooltip += `
`; + + if (['24h', '3d'].includes(this.timespan)) { + tooltip += `` + $localize`At block: ${ticks[0].data[2]}` + ``; + } else { + tooltip += `` + $localize`Around block: ${ticks[0].data[2]}` + ``; + } + + return tooltip; } }, xAxis: { diff --git a/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts b/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts index 3255fc4af..7d58ef5d6 100644 --- a/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts +++ b/frontend/src/app/components/block-sizes-weights-graph/block-sizes-weights-graph.component.ts @@ -10,7 +10,7 @@ import { StorageService } from 'src/app/services/storage.service'; import { MiningService } from 'src/app/services/mining.service'; import { StateService } from 'src/app/services/state.service'; import { Router } from '@angular/router'; -import { download } from 'src/app/shared/graphs.utils'; +import { download, formatterXAxis } from 'src/app/shared/graphs.utils'; @Component({ selector: 'app-block-sizes-weights-graph', @@ -141,27 +141,21 @@ export class BlockSizesWeightsGraphComponent implements OnInit { }, borderColor: '#000', formatter: (ticks) => { - let sizeString = ''; - let weightString = ''; + let tooltip = `${formatterXAxis(this.locale, this.timespan, parseInt(ticks[0].axisValue, 10))}
`; for (const tick of ticks) { if (tick.seriesIndex === 0) { // Size - sizeString = `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.2-2')} MB`; + tooltip += `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.2-2')} MB`; } else if (tick.seriesIndex === 1) { // Weight - weightString = `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.2-2')} MWU`; + tooltip += `${tick.marker} ${tick.seriesName}: ${formatNumber(tick.data[1], this.locale, '1.2-2')} MWU`; } + tooltip += `
`; } - const date = new Date(ticks[0].data[0]).toLocaleDateString(this.locale, { year: 'numeric', month: 'short', day: 'numeric' }); - - let tooltip = `${date}
- ${sizeString}
- ${weightString}`; - if (['24h', '3d'].includes(this.timespan)) { - tooltip += `
At block: ${ticks[0].data[2]}`; + tooltip += `` + $localize`At block: ${ticks[0].data[2]}` + ``; } else { - tooltip += `
Around block ${ticks[0].data[2]}`; + tooltip += `` + $localize`Around block: ${ticks[0].data[2]}` + ``; } return tooltip; diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts index d401f76ad..dcaa3031c 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -207,7 +207,7 @@ export class HashrateChartComponent implements OnInit { const date = new Date(ticks[0].data[0]).toLocaleDateString(this.locale, { year: 'numeric', month: 'short', day: 'numeric' }); return ` - ${date}
+ ${date}
${hashrateString}
${difficultyString} `; diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts index 528a783d5..695c7a7f4 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts @@ -186,7 +186,7 @@ export class HashrateChartPoolsComponent implements OnInit { borderColor: '#000', formatter: function (data) { const date = new Date(data[0].data[0]).toLocaleDateString(this.locale, { year: 'numeric', month: 'short', day: 'numeric' }); - let tooltip = `${date}
`; + let tooltip = `${date}
`; data.sort((a, b) => b.data[1] - a.data[1]); for (const pool of data) { if (pool.data[1] > 0) { diff --git a/frontend/src/app/shared/graphs.utils.ts b/frontend/src/app/shared/graphs.utils.ts index 429989b84..5f23ed800 100644 --- a/frontend/src/app/shared/graphs.utils.ts +++ b/frontend/src/app/shared/graphs.utils.ts @@ -13,18 +13,16 @@ export const formatterXAxis = ( return date.toLocaleTimeString(locale, { hour: 'numeric', minute: 'numeric' }); case '24h': case '3d': - return date.toLocaleTimeString(locale, { weekday: 'short', hour: 'numeric', minute: 'numeric' }); case '1w': case '1m': case '3m': case '6m': case '1y': - return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }); + return date.toLocaleTimeString(locale, { month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' }); case '2y': case '3y': - return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }); case 'all': - return date.toLocaleDateString(locale, { year: 'numeric', month: 'short' }); + return date.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' }); } }; From e748d212b53e82979675207196779889ced419ce Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Sat, 11 Jun 2022 11:05:53 -0400 Subject: [PATCH 3/4] Clarify that manual installs are meant for devs --- README.md | 4 ++-- backend/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ae0e2191e..cde9b5adb 100644 --- a/README.md +++ b/README.md @@ -29,5 +29,5 @@ Mempool can be conveniently installed on the following full-node distros: Mempool can be installed in other ways too, but we only recommend doing so if you're a developer, have experience managing servers, or otherwise know what you're doing. - See the [`docker/`](./docker/) directory for instructions on deploying Mempool with Docker. -- See the [`backend/`](./backend/) and [`frontend/`](./frontend/) directories for manual install instructions oriented for developers and small-scale deployments. -- See the [`production/`](./production/) directory for guidance on setting up a more serious Mempool instance designed for high performance at scale. \ No newline at end of file +- See the [`backend/`](./backend/) and [`frontend/`](./frontend/) directories for manual install instructions oriented for developers. +- See the [`production/`](./production/) directory for guidance on setting up a more serious Mempool instance designed for high performance at scale. diff --git a/backend/README.md b/backend/README.md index f9a783b44..31872b962 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,6 +1,6 @@ # Mempool Backend -These instructions are mostly intended for developers, but can be used as a basis for personal or small-scale production setups. +These instructions are mostly intended for developers. If you choose to use these instructions for a production setup, be aware that you will still probably need to do additional configuration for your specific OS, environment, use-case, etc. We do our best here to provide a good starting point, but only proceed if you know what you're doing. Mempool does not provide support for custom setups. From 3024aff26ccdf35de1f186e2b67a69170b0f99c2 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:17:34 -0400 Subject: [PATCH 4/4] Fix anchor link scrolling on load (chrome) --- frontend/src/app/docs/api-docs/api-docs.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts index 94eccd4e2..3d68ef75c 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs.component.ts @@ -35,6 +35,7 @@ export class ApiDocsComponent implements OnInit { setTimeout( () => { if( this.route.snapshot.fragment ) { this.openEndpointContainer( this.route.snapshot.fragment ); + document.getElementById( this.route.snapshot.fragment ).scrollIntoView(); } window.addEventListener('scroll', function() { that.desktopDocsNavPosition = ( window.pageYOffset > 182 ) ? "fixed" : "relative";