diff --git a/backend/src/api/explorer/channels.api.ts b/backend/src/api/explorer/channels.api.ts index 0b1b914fd..cf38610b4 100644 --- a/backend/src/api/explorer/channels.api.ts +++ b/backend/src/api/explorer/channels.api.ts @@ -80,7 +80,13 @@ class ChannelsApi { public async $searchChannelsById(search: string): Promise { try { - const searchStripped = search.replace(/[^0-9x]/g, '') + '%'; + // restrict search to valid id/short_id prefix formats + let searchStripped = search.match(/[0-9]+[0-9x]*/)?.[0] || ''; + if (!searchStripped.length) { + return []; + } + // add wildcard to search by prefix + searchStripped += '%'; const query = `SELECT id, short_id, capacity, status FROM channels WHERE id LIKE ? OR short_id LIKE ? LIMIT 10`; const [rows]: any = await DB.query(query, [searchStripped, searchStripped]); return rows; diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index 3a444701f..b082573f1 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -94,9 +94,13 @@ class WebsocketHandler { throw new Error('WebSocket.Server is not set'); } - this.wss.on('connection', (client: WebSocket) => { + this.wss.on('connection', (client: WebSocket, req) => { this.numConnected++; - client.on('error', logger.info); + client['remoteAddress'] = req.headers['x-forwarded-for'] || req.socket?.remoteAddress || 'unknown'; + client.on('error', (e) => { + logger.info(`websocket client error from ${client['remoteAddress']}: ` + (e instanceof Error ? e.message : e)); + client.close(); + }); client.on('close', () => { this.numDisconnected++; }); @@ -282,7 +286,8 @@ class WebsocketHandler { client.send(serializedResponse); } } catch (e) { - logger.debug('Error parsing websocket message: ' + (e instanceof Error ? e.message : e)); + logger.debug(`Error parsing websocket message from ${client['remoteAddress']}: ` + (e instanceof Error ? e.message : e)); + client.close(); } }); }); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 38c143ab7..4d95f8af8 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -23,7 +23,7 @@ "@angular/router": "^16.2.2", "@fortawesome/angular-fontawesome": "~0.13.0", "@fortawesome/fontawesome-common-types": "~6.4.0", - "@fortawesome/fontawesome-svg-core": "~6.4.0", + "@fortawesome/fontawesome-svg-core": "~6.5.0", "@fortawesome/free-solid-svg-icons": "~6.4.0", "@mempool/mempool.js": "2.3.0", "@ng-bootstrap/ng-bootstrap": "^15.1.0", @@ -31,7 +31,6 @@ "bootstrap": "~4.6.2", "browserify": "^17.0.0", "clipboard": "^2.0.11", - "cypress": "^13.6.0", "domino": "^2.1.6", "echarts": "~5.4.3", "lightweight-charts": "~3.8.0", @@ -3560,17 +3559,26 @@ } }, "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.0.tgz", - "integrity": "sha512-Bertv8xOiVELz5raB2FlXDPKt+m94MQ3JgDfsVbrqNpLU9+UE2E18GKjLKw+d3XbeYPqg1pzyQKGsrzbw+pPaw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.0.tgz", + "integrity": "sha512-5DrR+oxQr+ruRQ3CEVV8DSCT/q8Atm56+FzAs0P6eW/epW47OmecSpSwc/YTlJ3u5BfPKUBSGyPR2qjZ+5eIgA==", "hasInstallScript": true, "dependencies": { - "@fortawesome/fontawesome-common-types": "6.4.0" + "@fortawesome/fontawesome-common-types": "6.5.0" }, "engines": { "node": ">=6" } }, + "node_modules/@fortawesome/fontawesome-svg-core/node_modules/@fortawesome/fontawesome-common-types": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.0.tgz", + "integrity": "sha512-vYC8oN2l8meu05sRi1j3Iie/HNFAeIxpitYFhsUrBc11TxiMken9QdXnSQ0q16FYsOSt/6soxs5ghdk+VYGiog==", + "hasInstallScript": true, + "engines": { + "node": ">=6" + } + }, "node_modules/@fortawesome/free-solid-svg-icons": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz", @@ -19319,11 +19327,18 @@ "integrity": "sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ==" }, "@fortawesome/fontawesome-svg-core": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.0.tgz", - "integrity": "sha512-Bertv8xOiVELz5raB2FlXDPKt+m94MQ3JgDfsVbrqNpLU9+UE2E18GKjLKw+d3XbeYPqg1pzyQKGsrzbw+pPaw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.0.tgz", + "integrity": "sha512-5DrR+oxQr+ruRQ3CEVV8DSCT/q8Atm56+FzAs0P6eW/epW47OmecSpSwc/YTlJ3u5BfPKUBSGyPR2qjZ+5eIgA==", "requires": { - "@fortawesome/fontawesome-common-types": "6.4.0" + "@fortawesome/fontawesome-common-types": "6.5.0" + }, + "dependencies": { + "@fortawesome/fontawesome-common-types": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.0.tgz", + "integrity": "sha512-vYC8oN2l8meu05sRi1j3Iie/HNFAeIxpitYFhsUrBc11TxiMken9QdXnSQ0q16FYsOSt/6soxs5ghdk+VYGiog==" + } } }, "@fortawesome/free-solid-svg-icons": { diff --git a/frontend/package.json b/frontend/package.json index 81928669f..f55798c5c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -75,7 +75,7 @@ "@angular/router": "^16.2.2", "@fortawesome/angular-fontawesome": "~0.13.0", "@fortawesome/fontawesome-common-types": "~6.4.0", - "@fortawesome/fontawesome-svg-core": "~6.4.0", + "@fortawesome/fontawesome-svg-core": "~6.5.0", "@fortawesome/free-solid-svg-icons": "~6.4.0", "@mempool/mempool.js": "2.3.0", "@ng-bootstrap/ng-bootstrap": "^15.1.0", diff --git a/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts b/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts index ebcb8a067..92ad9b744 100644 --- a/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts +++ b/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts @@ -30,7 +30,7 @@ export class BisqDashboardComponent implements OnInit { ngOnInit(): void { this.seoService.setTitle($localize`:@@meta.title.bisq.markets:Markets`); - this.seoService.setDescription($localize`:@@meta.description.bisq.markets:Explore the full Bitcoin ecosystem with The Mempool Open Project™. See Bisq market prices, trading activity, and more.`); + this.seoService.setDescription($localize`:@@meta.description.bisq.markets:Explore the full Bitcoin ecosystem with The Mempool Open Source Project™. See Bisq market prices, trading activity, and more.`); this.websocketService.want(['blocks']); this.volumes$ = this.bisqApiService.getAllVolumesDay$() diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index a4cc51f90..cb45e9f19 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -36,14 +36,14 @@

If you're an individual...

- Become a Community Sponsor + Become a Community Sponsor

If you're a business...

- Become an Enterprise Sponsor + Become an Enterprise Sponsor diff --git a/frontend/src/app/components/about/about.component.scss b/frontend/src/app/components/about/about.component.scss index 54dc38a27..94f6f11b5 100644 --- a/frontend/src/app/components/about/about.component.scss +++ b/frontend/src/app/components/about/about.component.scss @@ -282,6 +282,7 @@ text-align: left; width: 250px; margin: 12px auto; + white-space: nowrap; } @media (max-width: 992px) { diff --git a/frontend/src/app/components/about/about.component.ts b/frontend/src/app/components/about/about.component.ts index 8aa0422e8..026076f16 100644 --- a/frontend/src/app/components/about/about.component.ts +++ b/frontend/src/app/components/about/about.component.ts @@ -9,6 +9,7 @@ import { Router, ActivatedRoute } from '@angular/router'; import { map, share, tap } from 'rxjs/operators'; import { ITranslators } from '../../interfaces/node-api.interface'; import { DOCUMENT } from '@angular/common'; +import { EnterpriseService } from '../../services/enterprise.service'; @Component({ selector: 'app-about', @@ -33,6 +34,7 @@ export class AboutComponent implements OnInit { private websocketService: WebsocketService, private seoService: SeoService, public stateService: StateService, + private enterpriseService: EnterpriseService, private apiService: ApiService, private router: Router, private route: ActivatedRoute, @@ -108,4 +110,14 @@ export class AboutComponent implements OnInit { unmutePromoVideo(): void { this.promoVideo.nativeElement.muted = false; } + + onSponsorClick(e): boolean { + this.enterpriseService.goal(5); + return true; + } + + onEnterpriseClick(e): boolean { + this.enterpriseService.goal(6); + return true; + } } diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html index 2a075f1e2..e40d6b5c9 100644 --- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html +++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.html @@ -51,7 +51,7 @@ In-band fees - {{ estimate.txSummary.effectiveFee | number : '1.0-0' }} sats + {{ estimate.txSummary.effectiveFee | number : '1.0-0' }} sats @@ -76,7 +76,7 @@
@@ -110,7 +110,7 @@ {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} - sats + sats @@ -130,7 +130,7 @@ +{{ estimate.mempoolBaseFee | number }} - sats + sats @@ -142,7 +142,7 @@ +{{ estimate.vsizeFee | number }} - sats + sats @@ -159,7 +159,7 @@ - sats + sats @@ -182,7 +182,7 @@ - sats + sats @@ -205,7 +205,7 @@ {{ estimate.userBalance | number }} - sats + sats diff --git a/frontend/src/app/components/block/block.component.html b/frontend/src/app/components/block/block.component.html index e65905cd2..8bcf23ace 100644 --- a/frontend/src/app/components/block/block.component.html +++ b/frontend/src/app/components/block/block.component.html @@ -219,13 +219,13 @@
-

Expected Block beta

+

Expected Block

Version - {{ block.version | decimal2hex }} Taproot + {{ block.version | decimal2hex }} Taproot Bits diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.ts b/frontend/src/app/components/blocks-list/blocks-list.component.ts index dc8ff9610..196a0341e 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.ts +++ b/frontend/src/app/components/blocks-list/blocks-list.component.ts @@ -56,7 +56,7 @@ export class BlocksList implements OnInit { this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5; if (!this.widget) { - this.seoService.setTitle($localize`:@@meta.title.blocks-list:Blocks`); + this.seoService.setTitle($localize`:@@m8a7b4bd44c0ac71b2e72de0398b303257f7d2f54:Blocks`); } if( this.stateService.network==='liquid'||this.stateService.network==='liquidtestnet' ) { this.seoService.setDescription($localize`:@@meta.description.liquid.blocks:See the most recent Liquid${seoDescriptionNetwork(this.stateService.network)} blocks along with basic stats such as block height, block size, and more.`); diff --git a/frontend/src/app/components/calculator/calculator.component.html b/frontend/src/app/components/calculator/calculator.component.html index 5e084403d..e4ade67d2 100644 --- a/frontend/src/app/components/calculator/calculator.component.html +++ b/frontend/src/app/components/calculator/calculator.component.html @@ -26,7 +26,7 @@
- sats + sats
@@ -41,7 +41,7 @@
- sats + sats
diff --git a/frontend/src/app/components/clock/clock.component.html b/frontend/src/app/components/clock/clock.component.html index bdddef730..376d72bfc 100644 --- a/frontend/src/app/components/clock/clock.component.html +++ b/frontend/src/app/components/clock/clock.component.html @@ -38,36 +38,35 @@
-

fiat price

+

Price

-

priority rate

+

High Priority

-

block size

+

Size

- - {{ i }} transaction - {{ i }} transactions + {{ blocks[blockIndex].tx_count | number }} + Transactions

-

memory usage

+

Memory Usage

{{ mempoolInfo.size | number }}

-

unconfirmed

+

Unconfirmed

diff --git a/frontend/src/app/components/clock/clock.component.scss b/frontend/src/app/components/clock/clock.component.scss index 64929aa38..34aadcd74 100644 --- a/frontend/src/app/components/clock/clock.component.scss +++ b/frontend/src/app/components/clock/clock.component.scss @@ -63,6 +63,7 @@ .label { font-size: calc(0.04 * var(--clock-width)); line-height: calc(0.05 * var(--clock-width)); + text-transform: lowercase; } &.top { diff --git a/frontend/src/app/components/footer/footer.component.html b/frontend/src/app/components/footer/footer.component.html index cc5d1f9b9..9c0369827 100644 --- a/frontend/src/app/components/footer/footer.component.html +++ b/frontend/src/app/components/footer/footer.component.html @@ -11,7 +11,7 @@
 
‎{{ mempoolInfoData.vBytesPerSecond | ceil | number }} vB/s
-
‎{{ mempoolInfoData.vBytesPerSecond * 4 | ceil | number }} WU/s
+
‎{{ mempoolInfoData.vBytesPerSecond * 4 | ceil | number }} WU/s
diff --git a/frontend/src/app/components/graphs/graphs.component.html b/frontend/src/app/components/graphs/graphs.component.html index 8468deb82..94241b825 100644 --- a/frontend/src/app/components/graphs/graphs.component.html +++ b/frontend/src/app/components/graphs/graphs.component.html @@ -22,7 +22,7 @@ Block Sizes and Weights Block Health + [routerLink]="['/graphs/mining/block-health' | relativeUrl]" i18n="mining.blocks-health">Block Health
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 5f17938ae..62c6961ce 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -249,10 +249,8 @@ export class HashrateChartComponent implements OnInit { for (const tick of ticks) { if (tick.seriesIndex === 0) { // Hashrate let hashrate = tick.data[1]; - if (this.isMobile()) { - hashratePowerOfTen = selectPowerOfTen(tick.data[1]); - hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider); - } + hashratePowerOfTen = selectPowerOfTen(tick.data[1]); + hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider); hashrateString = `${tick.marker} ${tick.seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s
`; } else if (tick.seriesIndex === 1) { // Difficulty let difficultyPowerOfTen = hashratePowerOfTen; @@ -260,18 +258,14 @@ export class HashrateChartComponent implements OnInit { if (difficulty === null) { difficultyString = `${tick.marker} ${tick.seriesName}: No data
`; } else { - if (this.isMobile()) { - difficultyPowerOfTen = selectPowerOfTen(tick.data[1]); - difficulty = Math.round(tick.data[1] / difficultyPowerOfTen.divider); - } + difficultyPowerOfTen = selectPowerOfTen(tick.data[1]); + difficulty = tick.data[1] / difficultyPowerOfTen.divider; difficultyString = `${tick.marker} ${tick.seriesName}: ${formatNumber(difficulty, this.locale, '1.2-2')} ${difficultyPowerOfTen.unit}
`; } } else if (tick.seriesIndex === 2) { // Hashrate MA let hashrate = tick.data[1]; - if (this.isMobile()) { - hashratePowerOfTen = selectPowerOfTen(tick.data[1]); - hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider); - } + hashratePowerOfTen = selectPowerOfTen(tick.data[1]); + hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider); hashrateStringMA = `${tick.marker} ${tick.seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s`; } } diff --git a/frontend/src/app/components/pool/pool.component.html b/frontend/src/app/components/pool/pool.component.html index e1806086e..bf902dbf6 100644 --- a/frontend/src/app/components/pool/pool.component.html +++ b/frontend/src/app/components/pool/pool.component.html @@ -143,7 +143,7 @@ - + @@ -165,7 +165,7 @@
Blocks 24hBlocks (24h) 1w All
- + @@ -433,7 +433,7 @@
Blocks 24hBlocks (24h) 1w All
- + @@ -458,7 +458,7 @@
Blocks 24hBlocks (24h) 1w All
- + diff --git a/frontend/src/app/components/rbf-list/rbf-list.component.html b/frontend/src/app/components/rbf-list/rbf-list.component.html index c3206d37a..78815544c 100644 --- a/frontend/src/app/components/rbf-list/rbf-list.component.html +++ b/frontend/src/app/components/rbf-list/rbf-list.component.html @@ -6,11 +6,9 @@
+ All + Full RBF
@@ -33,7 +31,7 @@
-

there are no replacements in the mempool yet!

+

There are no replacements in the mempool yet!

diff --git a/frontend/src/app/components/rbf-list/rbf-list.component.ts b/frontend/src/app/components/rbf-list/rbf-list.component.ts index 1ae14702b..0721c7fdf 100644 --- a/frontend/src/app/components/rbf-list/rbf-list.component.ts +++ b/frontend/src/app/components/rbf-list/rbf-list.component.ts @@ -55,7 +55,7 @@ export class RbfList implements OnInit, OnDestroy { }) ); - this.seoService.setTitle($localize`:@@meta.title.rbf-list:RBF Replacements`); + this.seoService.setTitle($localize`:@@5e3d5a82750902f159122fcca487b07f1af3141f:RBF Replacements`); this.seoService.setDescription($localize`:@@meta.description.rbf-list:See the most recent RBF replacements on the Bitcoin${seoDescriptionNetwork(this.stateService.network)} network, updated in real-time.`); } diff --git a/frontend/src/app/components/rbf-timeline/rbf-timeline-tooltip.component.html b/frontend/src/app/components/rbf-timeline/rbf-timeline-tooltip.component.html index 540da7480..84e20b75f 100644 --- a/frontend/src/app/components/rbf-timeline/rbf-timeline-tooltip.component.html +++ b/frontend/src/app/components/rbf-timeline/rbf-timeline-tooltip.component.html @@ -32,9 +32,9 @@ diff --git a/frontend/src/app/components/statistics/statistics.component.html b/frontend/src/app/components/statistics/statistics.component.html index 0bb10a1c3..fa63590b0 100644 --- a/frontend/src/app/components/statistics/statistics.component.html +++ b/frontend/src/app/components/statistics/statistics.component.html @@ -14,7 +14,7 @@ [class]="(stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING) ? 'mining' : 'no-menu'" (click)="saveGraphPreference()"> @@ -110,7 +110,7 @@
-
Recent blocks
+
Recent Blocks
 
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 48a8bf418..eee02790c 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -10,9 +10,9 @@
-
Blocks 24hBlocks (24h) 1w All
Status - Full RBF + Full RBF RBF - RBF + RBF Mined
Mined Full RBF - RBF + RBF

mempool.space merely provides data about the Bitcoin network. It cannot help you with retrieving funds, wallet issues, etc.

For any such requests, you need to get in touch with the entity that helped make the transaction (wallet software, exchange company, etc).

-

mempool.space merely provides data about the Bitcoin network. It cannot help you with retrieving funds, wallet issues, etc.

For any such requests, you need to get in touch with the entity that helped make the transaction (wallet software, exchange company, etc).

- +
+
+

mempool.space merely provides data about the Bitcoin network. It cannot help you with retrieving funds, wallet issues, etc.

For any such requests, you need to get in touch with the entity that helped make the transaction (wallet software, exchange company, etc).

diff --git a/frontend/src/app/docs/docs/docs.component.ts b/frontend/src/app/docs/docs/docs.component.ts index 329faeff7..6d6c3b0c1 100644 --- a/frontend/src/app/docs/docs/docs.component.ts +++ b/frontend/src/app/docs/docs/docs.component.ts @@ -62,12 +62,10 @@ export class DocsComponent implements OnInit { } else { this.seoService.setDescription($localize`:@@meta.description.docs.websocket-bitcoin:Documentation for the mempool.space WebSocket API service: get real-time info on blocks, mempools, transactions, addresses, and more.`); } - /* } else { this.activeTab = 3; this.seoService.setTitle($localize`:@@meta.title.docs.electrum:Electrum RPC`); this.seoService.setDescription($localize`:@@meta.description.docs.electrumrpc:Documentation for our Electrum RPC interface: get instant, convenient, and reliable access to an Esplora instance.`); - */ } } diff --git a/frontend/src/app/lightning/channels-list/channels-list.component.html b/frontend/src/app/lightning/channels-list/channels-list.component.html index b7b18892e..876551dc7 100644 --- a/frontend/src/app/lightning/channels-list/channels-list.component.html +++ b/frontend/src/app/lightning/channels-list/channels-list.component.html @@ -37,7 +37,7 @@ Alias   - Status + Status Fee rate Closing date Capacity diff --git a/frontend/src/app/lightning/node/node-preview.component.html b/frontend/src/app/lightning/node/node-preview.component.html index eae076bf5..6eb5b7848 100644 --- a/frontend/src/app/lightning/node/node-preview.component.html +++ b/frontend/src/app/lightning/node/node-preview.component.html @@ -49,7 +49,7 @@ Location - unknown + Unknown diff --git a/frontend/src/app/lightning/node/node.component.html b/frontend/src/app/lightning/node/node.component.html index 8f9f9ad70..445eba1c2 100644 --- a/frontend/src/app/lightning/node/node.component.html +++ b/frontend/src/app/lightning/node/node.component.html @@ -119,7 +119,7 @@
- Features + Features {{ bits }} diff --git a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.html b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.html index 095ae6f8e..7237c709f 100644 --- a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.html +++ b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.html @@ -1,22 +1,28 @@ -
+
-
-
- Lightning Nodes Channels World Map -
- (Tor nodes excluded) -
-
-
-
+ +
+ +
+
+ Lightning Nodes Channels World Map +
+ (Tor nodes excluded) +
+ +
+
+ +
diff --git a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.scss b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.scss index 6db0f27b0..558ad68a6 100644 --- a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.scss +++ b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.scss @@ -143,3 +143,55 @@ text-align: center; margin-top: 100px; } + +.full-container-graph { + display: flex; + flex-direction: column; + padding: 0px 15px; + width: 100%; + height: calc(100vh - 225px); + min-height: 400px; + @media (min-width: 992px) { + height: calc(100vh - 150px); + } +} +.full-container-graph.widget { + min-height: 240px; + height: 240px; + padding: 0px; +} +.full-container-graph.fit-container { + margin: 0; + padding: 0; + height: 100%; + min-height: 100px; + + .chart { + padding: 0; + min-height: 100px; + } +} + +.chart-graph { + display: flex; + flex: 1; + height: 100%; + padding-top: 30px; + padding-bottom: 20px; + padding-right: 10px; + @media (max-width: 992px) { + padding-bottom: 25px; + } + @media (max-width: 829px) { + padding-bottom: 50px; + } + @media (max-width: 767px) { + padding-bottom: 25px; + } + @media (max-width: 629px) { + padding-bottom: 55px; + } + @media (max-width: 567px) { + padding-bottom: 55px; + } +} diff --git a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts index 01978c324..296d60dec 100644 --- a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts +++ b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts @@ -65,6 +65,7 @@ export class NodesChannelsMap implements OnInit { } if (this.style === 'graph') { + this.center = [0, 5]; this.seoService.setTitle($localize`Lightning Nodes Channels World Map`); this.seoService.setDescription($localize`:@@meta.description.lightning.node-map:See the channels of non-Tor Lightning network nodes visualized on a world map. Hover/tap on points on the map for node names and details.`); } @@ -238,7 +239,6 @@ export class NodesChannelsMap implements OnInit { title: title ?? undefined, tooltip: {}, geo: { - top: 75, animation: false, silent: true, center: this.center, diff --git a/frontend/src/app/services/enterprise.service.ts b/frontend/src/app/services/enterprise.service.ts index bc80f337d..0c86f086c 100644 --- a/frontend/src/app/services/enterprise.service.ts +++ b/frontend/src/app/services/enterprise.service.ts @@ -3,6 +3,7 @@ import { Inject, Injectable } from '@angular/core'; import { ApiService } from './api.service'; import { SeoService } from './seo.service'; import { StateService } from './state.service'; +import { ActivatedRoute } from '@angular/router'; @Injectable({ providedIn: 'root' @@ -11,12 +12,15 @@ export class EnterpriseService { exclusiveHostName = '.mempool.space'; subdomain: string | null = null; info: object = {}; + statsUrl: string; + siteId: number; constructor( @Inject(DOCUMENT) private document: Document, private apiService: ApiService, private seoService: SeoService, private stateService: StateService, + private activatedRoute: ActivatedRoute, ) { const subdomain = this.document.location.hostname.indexOf(this.exclusiveHostName) > -1 && this.document.location.hostname.split(this.exclusiveHostName)[0] || false; @@ -56,7 +60,7 @@ export class EnterpriseService { insertMatomo(siteId?: number): void { let statsUrl = '//stats.mempool.space/'; - + if (!siteId) { switch (this.document.location.hostname) { case 'mempool.space': @@ -88,16 +92,63 @@ export class EnterpriseService { } } + this.statsUrl = statsUrl; + this.siteId = siteId; + // @ts-ignore - const _paq = window._paq = window._paq || []; - _paq.push(['disableCookies']); - _paq.push(['trackPageView']); - _paq.push(['enableLinkTracking']); - (function() { - _paq.push(['setTrackerUrl', statsUrl+'m.php']); - _paq.push(['setSiteId', siteId.toString()]); - const d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - g.type='text/javascript'; g.async=true; g.src=statsUrl+'m.js'; s.parentNode.insertBefore(g,s); - })(); + if (window._paq && window['Matomo']) { + window['Matomo'].addTracker(statsUrl+'m.php', siteId.toString()); + const matomo = this.getMatomo(); + matomo.setDocumentTitle(this.seoService.getTitle()); + matomo.setCustomUrl(this.getCustomUrl()); + matomo.disableCookies(); + matomo.trackPageView(); + matomo.enableLinkTracking(); + } else { + // @ts-ignore + const alreadyInitialized = !!window._paq; + // @ts-ignore + const _paq = window._paq = window._paq || []; + _paq.push(['setDocumentTitle', this.seoService.getTitle()]); + _paq.push(['setCustomUrl', this.getCustomUrl()]); + _paq.push(['disableCookies']); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + if (alreadyInitialized) { + _paq.push(['addTracker', statsUrl+'m.php', siteId.toString()]); + } else { + (function() { + _paq.push(['setTrackerUrl', statsUrl+'m.php']); + _paq.push(['setSiteId', siteId.toString()]); + const d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + // @ts-ignore + g.type='text/javascript'; g.async=true; g.src=statsUrl+'m.js'; s.parentNode.insertBefore(g,s); + })(); + } + } + } + + private getMatomo() { + if (this.siteId != null) { + return window['Matomo']?.getTracker(this.statsUrl, this.siteId); + } + } + + goal(id: number) { + // @ts-ignore + this.getMatomo()?.trackGoal(id); + } + + private getCustomUrl(): string { + let url = window.location.origin + '/'; + let route = this.activatedRoute; + while (route) { + const segment = route?.routeConfig?.path; + if (segment && segment.length) { + url += segment + '/'; + } + route = route.firstChild; + } + return url; } } diff --git a/frontend/src/app/services/seo.service.ts b/frontend/src/app/services/seo.service.ts index 3d095e1c3..0c4aa405a 100644 --- a/frontend/src/app/services/seo.service.ts +++ b/frontend/src/app/services/seo.service.ts @@ -10,7 +10,7 @@ import { StateService } from './state.service'; export class SeoService { network = ''; baseTitle = 'mempool'; - baseDescription = 'Explore the full Bitcoin ecosystem with The Mempool Open Project™.'; + baseDescription = 'Explore the full Bitcoin ecosystem with The Mempool Open Source Project™.'; canonicalLink: HTMLElement = document.getElementById('canonical'); diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.html b/frontend/src/app/shared/components/global-footer/global-footer.component.html index f216afc89..676db35e5 100644 --- a/frontend/src/app/shared/components/global-footer/global-footer.component.html +++ b/frontend/src/app/shared/components/global-footer/global-footer.component.html @@ -52,7 +52,7 @@

What is a block explorer?

What is a mempool explorer?

Why isn't my transaction confirming?

-

More FAQs ›

+

More FAQs »