From 72ddb8c6a48ac274964846c99055e51a6ead1c63 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Thu, 14 Nov 2024 16:46:18 +0100 Subject: [PATCH 01/11] [accelerator] display payment errors, auto reload after 10 secs instead of 3 secs --- .../accelerate-checkout.component.html | 16 ++++++++++++---- .../accelerate-checkout.component.ts | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html index df67de65c..644d3e9d5 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html @@ -1,10 +1,18 @@
@if (accelerateError) { -
-
-

Sorry, something went wrong!

+ @if (accelerateError.includes('Payment declined')) { +
+
+

{{ accelerateError }}

+
-
+ } @else { +
+
+

Sorry, something went wrong!

+
+
+ }
diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 9d2d2ad46..763332ceb 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -543,7 +543,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { // Reset everything by reloading the page :D, can be improved const urlParams = new URLSearchParams(window.location.search); window.location.assign(window.location.toString().replace(`?cash_request_id=${urlParams.get('cash_request_id')}`, ``)); - }, 3000); + }, 10000); } } }); @@ -643,7 +643,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { // Reset everything by reloading the page :D, can be improved const urlParams = new URLSearchParams(window.location.search); window.location.assign(window.location.toString().replace(`?cash_request_id=${urlParams.get('cash_request_id')}`, ``)); - }, 3000); + }, 10000); } } }); @@ -738,7 +738,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { // Reset everything by reloading the page :D, can be improved const urlParams = new URLSearchParams(window.location.search); window.location.assign(window.location.toString().replace(`?cash_request_id=${urlParams.get('cash_request_id')}`, ``)); - }, 3000); + }, 10000); } } }); From e77dd114f457ad9ab4c78882ab712ab585c1d69f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 02:15:20 +0000 Subject: [PATCH 02/11] Bump echarts from 5.5.0 to 5.6.0 in /frontend Bumps [echarts](https://github.com/apache/echarts) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/apache/echarts/releases) - [Commits](https://github.com/apache/echarts/compare/5.5.0...5.6.0) --- updated-dependencies: - dependency-name: echarts dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- frontend/package-lock.json | 30 +++++++++++++++--------------- frontend/package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c59a85671..932979e2b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -33,7 +33,7 @@ "browserify": "^17.0.0", "clipboard": "^2.0.11", "domino": "^2.1.6", - "echarts": "~5.5.0", + "echarts": "~5.6.0", "esbuild": "^0.24.0", "ngx-echarts": "~17.2.0", "ngx-infinite-scroll": "^17.0.0", @@ -8724,12 +8724,12 @@ } }, "node_modules/echarts": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.5.0.tgz", - "integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.6.0.tgz", + "integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==", "dependencies": { "tslib": "2.3.0", - "zrender": "5.5.0" + "zrender": "5.6.1" } }, "node_modules/echarts/node_modules/tslib": { @@ -18366,9 +18366,9 @@ } }, "node_modules/zrender": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.5.0.tgz", - "integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.1.tgz", + "integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==", "dependencies": { "tslib": "2.3.0" } @@ -24485,12 +24485,12 @@ } }, "echarts": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.5.0.tgz", - "integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.6.0.tgz", + "integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==", "requires": { "tslib": "2.3.0", - "zrender": "5.5.0" + "zrender": "5.6.1" }, "dependencies": { "tslib": { @@ -31485,9 +31485,9 @@ } }, "zrender": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.5.0.tgz", - "integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.1.tgz", + "integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==", "requires": { "tslib": "2.3.0" }, diff --git a/frontend/package.json b/frontend/package.json index 2910b8869..b50085a54 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -86,7 +86,7 @@ "browserify": "^17.0.0", "clipboard": "^2.0.11", "domino": "^2.1.6", - "echarts": "~5.5.0", + "echarts": "~5.6.0", "ngx-echarts": "~17.2.0", "ngx-infinite-scroll": "^17.0.0", "qrcode": "1.5.1", From 5aeaa6825989139f18703ed027673f967591e8f5 Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 20 Jan 2025 17:56:38 +0900 Subject: [PATCH 03/11] ops: Enable stratum in FOSS prod frontend config --- production/mempool-frontend-config.mainnet.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/production/mempool-frontend-config.mainnet.json b/production/mempool-frontend-config.mainnet.json index 79acaecc5..e0cdbf030 100644 --- a/production/mempool-frontend-config.mainnet.json +++ b/production/mempool-frontend-config.mainnet.json @@ -4,8 +4,7 @@ "TESTNET4_ENABLED": true, "LIQUID_ENABLED": false, "LIQUID_TESTNET_ENABLED": false, - "BISQ_ENABLED": true, - "BISQ_SEPARATE_BACKEND": true, + "STRATUM_ENABLED": true, "SIGNET_ENABLED": true, "MEMPOOL_WEBSITE_URL": "https://mempool.space", "LIQUID_WEBSITE_URL": "https://liquid.network", From b454fa09d2d8288e2d96ea4f88aae683b71197ac Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 21 Jan 2025 13:49:12 +0700 Subject: [PATCH 04/11] Remove babel backend dep --- backend/jest.config.ts | 2 +- backend/package-lock.json | 3 --- backend/package.json | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/backend/jest.config.ts b/backend/jest.config.ts index 14f932f98..43246c518 100644 --- a/backend/jest.config.ts +++ b/backend/jest.config.ts @@ -7,7 +7,7 @@ const config: Config.InitialOptions = { automock: false, collectCoverage: true, collectCoverageFrom: ["./src/**/**.ts"], - coverageProvider: "babel", + coverageProvider: "v8", coverageThreshold: { global: { lines: 1 diff --git a/backend/package-lock.json b/backend/package-lock.json index e0d28bfc9..08ebf0619 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -10,7 +10,6 @@ "hasInstallScript": true, "license": "GNU Affero General Public License v3.0", "dependencies": { - "@babel/core": "^7.25.2", "@mempool/electrum-client": "1.1.9", "@types/node": "^18.15.3", "axios": "1.7.2", @@ -26,8 +25,6 @@ "ws": "~8.18.0" }, "devDependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/core": "^7.25.2", "@types/compression": "^1.7.2", "@types/crypto-js": "^4.1.1", "@types/express": "^4.17.17", diff --git a/backend/package.json b/backend/package.json index 9ac3f9199..b1145cb13 100644 --- a/backend/package.json +++ b/backend/package.json @@ -39,7 +39,6 @@ "prettier": "./node_modules/.bin/prettier --write \"src/**/*.{js,ts}\"" }, "dependencies": { - "@babel/core": "^7.25.2", "@mempool/electrum-client": "1.1.9", "@types/node": "^18.15.3", "axios": "1.7.2", @@ -55,8 +54,6 @@ "ws": "~8.18.0" }, "devDependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/core": "^7.25.2", "@types/compression": "^1.7.2", "@types/crypto-js": "^4.1.1", "@types/express": "^4.17.17", From b42431f14a7bd6730ce89bd03933e50d5dc08852 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Tue, 21 Jan 2025 17:39:50 +0900 Subject: [PATCH 05/11] [auth] add login/signup with github support --- .../components/faucet/faucet.component.html | 10 +++----- .../github-login.component.html | 6 +++++ .../github-login.component.ts | 25 +++++++++++++++++++ frontend/src/app/shared/shared.module.ts | 3 +++ 4 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 frontend/src/app/components/github-login.component/github-login.component.html create mode 100644 frontend/src/app/components/github-login.component/github-login.component.ts diff --git a/frontend/src/app/components/faucet/faucet.component.html b/frontend/src/app/components/faucet/faucet.component.html index 3165ae9a7..19d76d9dd 100644 --- a/frontend/src/app/components/faucet/faucet.component.html +++ b/frontend/src/app/components/faucet/faucet.component.html @@ -21,10 +21,8 @@
To use the faucet, please  - login -  or
- +
} @else if (user && user.status === 'pending' && !user.email && user.snsId) { @@ -36,18 +34,18 @@
} @else if (error === 'not_available') { - +
To use the faucet, please
- +
} @else if (error === 'account_limited') {
- Your Twitter account does not allow you to access the faucet + Your account does not allow you to access the faucet
} diff --git a/frontend/src/app/components/github-login.component/github-login.component.html b/frontend/src/app/components/github-login.component/github-login.component.html new file mode 100644 index 000000000..de9c743b5 --- /dev/null +++ b/frontend/src/app/components/github-login.component/github-login.component.html @@ -0,0 +1,6 @@ + + + + + {{ buttonString }} + \ No newline at end of file diff --git a/frontend/src/app/components/github-login.component/github-login.component.ts b/frontend/src/app/components/github-login.component/github-login.component.ts new file mode 100644 index 000000000..52f2584b9 --- /dev/null +++ b/frontend/src/app/components/github-login.component/github-login.component.ts @@ -0,0 +1,25 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; +@Component({ + selector: 'app-github-login', + templateUrl: './github-login.component.html', +}) +export class GithubLogin { + @Input() width: string | null = null; + @Input() customClass: string | null = null; + @Input() buttonString: string= 'unset'; + @Input() redirectTo: string | null = null; + @Output() clicked = new EventEmitter(); + @Input() disabled: boolean = false; + + constructor() {} + + githubLogin() { + this.clicked.emit(true); + if (this.redirectTo) { + location.replace(`/api/v1/services/auth/login/github?redirectTo=${encodeURIComponent(this.redirectTo)}`); + } else { + location.replace(`/api/v1/services/auth/login/github?redirectTo=${location.href}`); + } + return false; + } +} diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index 283f9eb54..d63b54632 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -125,6 +125,7 @@ import { TwitterLogin } from '@components/twitter-login/twitter-login.component' import { BitcoinInvoiceComponent } from '@components/bitcoin-invoice/bitcoin-invoice.component'; import { OnlyVsizeDirective, OnlyWeightDirective } from '@app/shared/components/weight-directives/weight-directives'; +import { GithubLogin } from '../components/github-login.component/github-login.component'; @NgModule({ declarations: [ @@ -242,6 +243,7 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from '@app/shared/components/ TwitterWidgetComponent, FaucetComponent, TwitterLogin, + GithubLogin, BitcoinInvoiceComponent, ], imports: [ @@ -376,6 +378,7 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from '@app/shared/components/ HttpErrorComponent, TwitterWidgetComponent, TwitterLogin, + GithubLogin, BitcoinInvoiceComponent, BitcoinsatoshisPipe, From 665a12a040b5fcb743b5ffa5e1d54a1dce56b77c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:57:18 +0000 Subject: [PATCH 06/11] Bump mysql2 from 3.11.0 to 3.12.0 in /backend Bumps [mysql2](https://github.com/sidorares/node-mysql2) from 3.11.0 to 3.12.0. - [Release notes](https://github.com/sidorares/node-mysql2/releases) - [Changelog](https://github.com/sidorares/node-mysql2/blob/master/Changelog.md) - [Commits](https://github.com/sidorares/node-mysql2/compare/v3.11.0...v3.12.0) --- updated-dependencies: - dependency-name: mysql2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- backend/package-lock.json | 52 ++++++++++++++++++++++----------------- backend/package.json | 2 +- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/backend/package-lock.json b/backend/package-lock.json index 08ebf0619..3f66fa25b 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -17,7 +17,7 @@ "crypto-js": "~4.2.0", "express": "~4.21.1", "maxmind": "~4.3.11", - "mysql2": "~3.11.0", + "mysql2": "~3.12.0", "redis": "^4.7.0", "rust-gbt": "file:./rust-gbt", "socks-proxy-agent": "~7.0.0", @@ -5997,6 +5997,21 @@ "yallist": "^3.0.2" } }, + "node_modules/lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -6158,16 +6173,17 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mysql2": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.0.tgz", - "integrity": "sha512-J9phbsXGvTOcRVPR95YedzVSxJecpW5A5+cQ57rhHIFXteTP10HCs+VBjS7DHIKfEaI1zQ5tlVrquCd64A6YvA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.12.0.tgz", + "integrity": "sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==", + "license": "MIT", "dependencies": { "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.6.3", "long": "^5.2.1", - "lru-cache": "^8.0.0", + "lru.min": "^1.0.0", "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" @@ -6187,14 +6203,6 @@ "node": ">=0.10.0" } }, - "node_modules/mysql2/node_modules/lru-cache": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", - "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", - "engines": { - "node": ">=16.14" - } - }, "node_modules/named-placeholders": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", @@ -12210,6 +12218,11 @@ "yallist": "^3.0.2" } }, + "lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==" + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -12324,16 +12337,16 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mysql2": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.0.tgz", - "integrity": "sha512-J9phbsXGvTOcRVPR95YedzVSxJecpW5A5+cQ57rhHIFXteTP10HCs+VBjS7DHIKfEaI1zQ5tlVrquCd64A6YvA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.12.0.tgz", + "integrity": "sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==", "requires": { "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.6.3", "long": "^5.2.1", - "lru-cache": "^8.0.0", + "lru.min": "^1.0.0", "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" @@ -12346,11 +12359,6 @@ "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } - }, - "lru-cache": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", - "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==" } } }, diff --git a/backend/package.json b/backend/package.json index b1145cb13..ee5944f93 100644 --- a/backend/package.json +++ b/backend/package.json @@ -46,7 +46,7 @@ "crypto-js": "~4.2.0", "express": "~4.21.1", "maxmind": "~4.3.11", - "mysql2": "~3.11.0", + "mysql2": "~3.12.0", "rust-gbt": "file:./rust-gbt", "redis": "^4.7.0", "socks-proxy-agent": "~7.0.0", From 23713a11c25504ca216a39ea3000cf961c165dac Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 22 Jan 2025 05:06:02 +0000 Subject: [PATCH 07/11] link to merkle branch first tx --- frontend/src/app/components/pool/pool.component.html | 6 +++++- frontend/src/app/components/pool/pool.component.scss | 1 + frontend/src/app/components/pool/pool.component.ts | 4 ++++ .../stratum/stratum-list/stratum-list.component.html | 8 +++++++- .../stratum/stratum-list/stratum-list.component.scss | 10 ++++++++++ .../stratum/stratum-list/stratum-list.component.ts | 4 ++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/pool/pool.component.html b/frontend/src/app/components/pool/pool.component.html index faa0003c4..f98794b68 100644 --- a/frontend/src/app/components/pool/pool.component.html +++ b/frontend/src/app/components/pool/pool.component.html @@ -267,7 +267,11 @@ @for (branch of job.merkleBranches; track $index) { - + @if ($index === 0 && branch) { + + } @else { + + } } @for (_ of [].constructor(Math.max(0, 12 - job.merkleBranches.length)); track $index) { diff --git a/frontend/src/app/components/pool/pool.component.scss b/frontend/src/app/components/pool/pool.component.scss index 31d12474f..fa94227bd 100644 --- a/frontend/src/app/components/pool/pool.component.scss +++ b/frontend/src/app/components/pool/pool.component.scss @@ -220,6 +220,7 @@ div.scrollable { .merkle { width: 100px; + text-align: center; } .empty-branch { diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index 23b795613..4b4b643a2 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -361,6 +361,10 @@ export class PoolComponent implements OnInit { return block.height; } + reverseHash(hash: string) { + return hash.match(/../g).reverse().join(''); + } + ngOnDestroy(): void { this.slugSubscription.unsubscribe(); } diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html index 08d7fb0ef..41707e37f 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html @@ -30,7 +30,13 @@ @for (cell of row.merkleCells; track $index) { -
+ @if ($index === 0 && cell.hash) { + +
+
+ } @else { +
+ } } diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss index 6679f2257..15ee074c2 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss @@ -92,6 +92,16 @@ td { } } } + + .cell-link { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + color: inherit; + text-decoration: none; + } } .badge { diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts index 6f252babe..b28f4ff11 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts @@ -196,6 +196,10 @@ export class StratumList implements OnInit, OnDestroy { }[type]; } + reverseHash(hash: string) { + return hash.match(/../g).reverse().join(''); + } + ngOnDestroy(): void { this.websocketService.stopTrackStratum(); } From cac62765a18d25dddd1be3e090b4c57fdf2115ad Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 22 Jan 2025 09:10:22 +0000 Subject: [PATCH 08/11] fix stratum tree branch level --- .../stratum/stratum-list/stratum-list.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts index b28f4ff11..481447b07 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts @@ -48,14 +48,16 @@ function parseTag(scriptSig: string): string { return (ascii.match(/\/.*\//)?.[0] || ascii).trim(); } -function getMerkleBranchIds(merkleBranches: string[], numBranches: number): string[] { +function getMerkleBranchIds(merkleBranches: string[], numBranches: number, poolId: number): string[] { let lastHash = ''; const ids: string[] = []; for (let i = 0; i < numBranches; i++) { if (merkleBranches[i]) { lastHash = merkleBranches[i]; + ids.push(`${i}-${lastHash}`); + } else { + ids.push(`${i}-${lastHash}-${poolId}`); } - ids.push(`${i}-${lastHash}`); } return ids; } @@ -98,7 +100,7 @@ export class StratumList implements OnInit, OnDestroy { const numBranches = Math.max(...Object.values(rawJobs).map(job => job.merkleBranches.length)); const jobs: Record = {}; for (const [id, job] of Object.entries(rawJobs)) { - jobs[id] = { ...job, tag: parseTag(job.scriptsig), merkleBranchIds: getMerkleBranchIds(job.merkleBranches, numBranches) }; + jobs[id] = { ...job, tag: parseTag(job.scriptsig), merkleBranchIds: getMerkleBranchIds(job.merkleBranches, numBranches, job.pool) }; } if (Object.keys(jobs).length === 0) { return []; From 2e44ea3f012bf599f468f06849a8d5c2513e4152 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 22 Jan 2025 09:13:44 +0000 Subject: [PATCH 09/11] reorder stratum job table --- .../stratum-list/stratum-list.component.html | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html index 41707e37f..24801cf2c 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html @@ -7,27 +7,18 @@ - - - + + + @for (row of rows; track row.job.pool) { - - - @for (cell of row.merkleCells; track $index) { + + + } From 363fa3d8779e07cc9d048234b31cf9d51f60b639 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 22 Jan 2025 09:16:25 +0000 Subject: [PATCH 10/11] improve stratum table layout on mobile --- .../stratum-list/stratum-list.component.scss | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss index 15ee074c2..3d274ef2a 100644 --- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss +++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss @@ -104,6 +104,26 @@ td { } } +@media (max-width: 800px) { + .stratum-table { + td { + &.tag { + display: none; + } + } + } +} + +@media (max-width: 650px) { + .stratum-table { + td { + &.reward { + display: none; + } + } + } +} + .badge { position: relative; color: #FFF; From 3b91a1437aa72d7e0b8c8866fd13c7f0fe839eb4 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Wed, 22 Jan 2025 18:58:17 +0900 Subject: [PATCH 11/11] [accelerator] differentiate failed/canceled accelerations --- .../accelerations-list/accelerations-list.component.html | 3 ++- frontend/src/app/interfaces/node-api.interface.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html b/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html index 225bf1955..6756b23e4 100644 --- a/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html +++ b/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html @@ -64,7 +64,8 @@ Pending Completed ⌛ Mined ⌛ - Canceled ⌛ + Canceled ⌛ + Failed ⌛
HeightRewardCoinbase Tag Merkle Branches PoolCoinbase TagRewardHeight
- {{ row.job.height }} - - - - {{ row.job.tag }} - @if ($index === 0 && cell.hash) { @@ -47,6 +38,15 @@ } + {{ row.job.tag }} + + + + {{ row.job.height }} +
diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts index 4d85a938d..05f0855a9 100644 --- a/frontend/src/app/interfaces/node-api.interface.ts +++ b/frontend/src/app/interfaces/node-api.interface.ts @@ -412,13 +412,13 @@ export interface Acceleration { feeDelta: number; blockHash: string; blockHeight: number; - acceleratedFeeRate?: number; boost?: number; bidBoost?: number; boostCost?: number; boostRate?: number; minedByPoolUniqueId?: number; + canceled?: number; } export interface AccelerationHistoryParams {