diff --git a/backend/src/api/pools-parser.ts b/backend/src/api/pools-parser.ts index 7243eb023..005806c1d 100644 --- a/backend/src/api/pools-parser.ts +++ b/backend/src/api/pools-parser.ts @@ -108,7 +108,7 @@ class PoolsParser { if (slug === undefined) { // Only keep alphanumerical - slug = poolNames[i].replace(/[^a-z0-9]/gi,'').toLowerCase(); + slug = poolNames[i].replace(/[^a-z0-9]/gi, '').toLowerCase(); logger.debug(`No slug found for '${poolNames[i]}', generating it => '${slug}'`); } @@ -135,10 +135,11 @@ class PoolsParser { logger.debug(`Update pools table now`); // Add new mining pools into the database - let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses) VALUES '; + let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses, slug) VALUES '; for (let i = 0; i < finalPoolDataAdd.length; ++i) { queryAdd += `('${finalPoolDataAdd[i].name}', '${finalPoolDataAdd[i].link}', - '${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}'),`; + '${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}', + ${JSON.stringify(finalPoolDataAdd[i].slug)}),`; } queryAdd = queryAdd.slice(0, -1) + ';'; @@ -180,7 +181,7 @@ class PoolsParser { const [rows]: any[] = await connection.query({ sql: 'SELECT name from pools where name="Unknown"', timeout: 120000 }); if (rows.length === 0) { await connection.query({ - sql: `INSERT INTO pools(name, link, regexes, addresses) + sql: `INSERT INTO pools(name, link, regexes, addresses, slug) VALUES("Unknown", "https://learnmeabitcoin.com/technical/coinbase-transaction", "[]", "[]", "unknown"); `}); } else { @@ -189,7 +190,7 @@ class PoolsParser { regexes='[]', addresses='[]', slug='unknown' WHERE name='Unknown' - `) + `); } } catch (e) { logger.err('Unable to insert "Unknown" mining pool'); diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index c03a3a00a..74203ab81 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -169,7 +169,7 @@ -
+

Self-Hosted Integrations

diff --git a/frontend/src/app/components/about/about.component.scss b/frontend/src/app/components/about/about.component.scss index 8b9466732..222c14944 100644 --- a/frontend/src/app/components/about/about.component.scss +++ b/frontend/src/app/components/about/about.component.scss @@ -43,6 +43,7 @@ .alliances, .enterprise-sponsor, .community-integrations-sponsor, + .selfhosted-integrations-sponsor, .maintainers { margin-top: 68px; margin-bottom: 68px; @@ -108,6 +109,7 @@ .contributors, .community-sponsor, .community-integrations-sponsor, + .selfhosted-integrations-sponsor, .maintainers { .wrapper { display: inline-block; @@ -181,3 +183,8 @@ .no-about-margin { height: 10px; } + +.community-integrations-sponsor { + max-width: 750px; + margin: auto; +} diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.html b/frontend/src/app/components/blocks-list/blocks-list.component.html index c9017a2f3..9c2f964e2 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.html +++ b/frontend/src/app/components/blocks-list/blocks-list.component.html @@ -25,7 +25,7 @@
- + {{ block.extras.pool.name }} diff --git a/frontend/src/app/components/miner/miner.component.html b/frontend/src/app/components/miner/miner.component.html index 4a54fb4d0..f4798d07d 100644 --- a/frontend/src/app/components/miner/miner.component.html +++ b/frontend/src/app/components/miner/miner.component.html @@ -4,7 +4,7 @@ - {{ miner }} + {{ miner }} Unknown diff --git a/frontend/src/app/components/miner/miner.component.ts b/frontend/src/app/components/miner/miner.component.ts index c022526fb..babda3dad 100644 --- a/frontend/src/app/components/miner/miner.component.ts +++ b/frontend/src/app/components/miner/miner.component.ts @@ -1,6 +1,8 @@ import { Component, Input, OnChanges, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { AssetsService } from 'src/app/services/assets.service'; import { Transaction } from 'src/app/interfaces/electrs.interface'; +import { StateService } from 'src/app/services/state.service'; +import { RelativeUrlPipe } from 'src/app/shared/pipes/relative-url/relative-url.pipe'; @Component({ selector: 'app-miner', @@ -13,11 +15,14 @@ export class MinerComponent implements OnChanges { miner = ''; title = ''; url = ''; + target = '_blank'; loading = true; constructor( private assetsService: AssetsService, private cd: ChangeDetectorRef, + public stateService: StateService, + private relativeUrlPipe: RelativeUrlPipe, ) { } ngOnChanges() { @@ -40,7 +45,13 @@ export class MinerComponent implements OnChanges { if (pools.payout_addresses[vout.scriptpubkey_address]) { this.miner = pools.payout_addresses[vout.scriptpubkey_address].name; this.title = $localize`:@@miner-identified-by-payout:Identified by payout address: '${vout.scriptpubkey_address}:PAYOUT_ADDRESS:'`; - this.url = pools.payout_addresses[vout.scriptpubkey_address].link; + const pool = pools.payout_addresses[vout.scriptpubkey_address]; + if (this.stateService.env.MINING_DASHBOARD && pools.slugs[pool.name] !== undefined) { + this.url = this.relativeUrlPipe.transform(`/mining/pool/${pools.slugs[pool.name]}`); + this.target = ''; + } else { + this.url = pool.link; + } break; } @@ -48,9 +59,15 @@ export class MinerComponent implements OnChanges { if (pools.coinbase_tags.hasOwnProperty(tag)) { const coinbaseAscii = this.hex2ascii(this.coinbaseTransaction.vin[0].scriptsig); if (coinbaseAscii.indexOf(tag) > -1) { - this.miner = pools.coinbase_tags[tag].name; + const pool = pools.coinbase_tags[tag]; + this.miner = pool.name; this.title = $localize`:@@miner-identified-by-coinbase:Identified by coinbase tag: '${tag}:TAG:'`; - this.url = pools.coinbase_tags[tag].link; + if (this.stateService.env.MINING_DASHBOARD && pools.slugs[pool.name] !== undefined) { + this.url = this.relativeUrlPipe.transform(`/mining/pool/${pools.slugs[pool.name]}`); + this.target = ''; + } else { + this.url = pool.link; + } break; } } diff --git a/frontend/src/app/components/pool/pool.component.html b/frontend/src/app/components/pool/pool.component.html index 240648e2c..9750e503c 100644 --- a/frontend/src/app/components/pool/pool.component.html +++ b/frontend/src/app/components/pool/pool.component.html @@ -9,44 +9,104 @@
+
- - - + + + + + + + - - - + + - - - + + + + +
Tags -
+ + +
Tags + {{ poolStats.pool.regexes }} +
+ Tags +
{{ poolStats.pool.regexes }}
Addresses -
- +
Addresses + + {{ poolStats.pool.addresses[0] }} + + + ~
+ Addresses +
+ + + {{ poolStats.pool.addresses[0] | shortenString: 40 }} + + +
+
+
- - + + + + - - + + + + + + + + + + + + +
Mined Blocks
Mined Blocks {{ formatNumber(poolStats.blockCount, this.locale, '1.0-0') }}
Empty Blocks
+ Mined Blocks +
{{ formatNumber(poolStats.blockCount, this.locale, '1.0-0') }}
+
Empty Blocks {{ formatNumber(poolStats.emptyBlocks, this.locale, '1.0-0') }}
+ Blocks +
{{ formatNumber(poolStats.emptyBlocks, this.locale, '1.0-0') }}
+
@@ -54,14 +114,20 @@
+ + ~ + + +
~
+
+
- +
@@ -147,7 +213,9 @@
-

+

+
+

@@ -155,41 +223,88 @@
Height Timestamp
- - - + + - - - + + + + + + + + + + + + +
Tags + + +
Tags
Addresses -
+ + +
+ Tags +
Addresses +
+
~
+ Addresses +
+
+
+
+
- +
- - - + + - - - + + + + + + + + + + + +
Mined Blocks + + +
Mined Blocks
Empty Blocks + +
+ Mined Blocks +
+
+
+
Empty Blocks
+ Blocks +
+
+
+
diff --git a/frontend/src/app/components/pool/pool.component.scss b/frontend/src/app/components/pool/pool.component.scss index 2a06de54a..211469c1b 100644 --- a/frontend/src/app/components/pool/pool.component.scss +++ b/frontend/src/app/components/pool/pool.component.scss @@ -45,13 +45,17 @@ div.scrollable { } .label { - width: 35%; + width: 30%; + @media (max-width: 767.98px) { + font-weight: bold; + } } .data { - text-align: left; + text-align: right; padding-left: 25%; - @media (max-width: 991px) { + @media (max-width: 992px) { + text-align: left; padding-left: 12px; } @media (max-width: 450px) { @@ -132,12 +136,6 @@ div.scrollable { text-align: left; } -.right-mobile { - @media (max-width: 450px) { - text-align: right; - } -} - .skeleton-loader { max-width: 200px; } @@ -151,3 +149,11 @@ div.scrollable { top: 600px; } } + +.small-button { + height: 20px; + transform: translateY(-20px); + font-size: 10px; + padding-top: 0; + padding-bottom: 0; +} \ No newline at end of file diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index 023d3dcdb..a298f0d51 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -19,6 +19,8 @@ export class PoolComponent implements OnInit { @Input() right: number | string = 45; @Input() left: number | string = 75; + gfg = true; + formatNumber = formatNumber; poolStats$: Observable; blocks$: Observable;