diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index 039034676..732622173 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -138,7 +138,10 @@
Shares - + + + +
{{info.sharesAccepted | number: '1.0-0'}} @@ -487,7 +490,7 @@

Block Header - + {{ signal }} diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts index 7c243f519..36d5efe37 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.ts +++ b/main/http_server/axe-os/src/app/components/home/home.component.ts @@ -103,12 +103,15 @@ export class HomeComponent implements OnInit, OnDestroy { public activePoolProtocol!: string; public responseTime!: number; - public flashShare: boolean = false; - public flashJob: boolean = false; - private shareTimeout: any; - private jobTimeout: any; - private lastSharesCount: number = -1; - private lastScriptsig: string = ''; + public flashShareAccepted: boolean = false; + public flashShareRejected: boolean = false; + public flashWorkReceived: boolean = false; + private shareAcceptedTimeout: any; + private shareRejectedTimeout: any; + private workReceivedTimeout: any; + private lastSharesAcceptedCount: number = -1; + private lastSharesRejectedCount: number = -1; + private lastWorkReceived: number = -1; public systemInfoError$ = new BehaviorSubject({ duration: 0, @@ -914,20 +917,29 @@ export class HomeComponent implements OnInit, OnDestroy { } } - const currentShares = info.sharesAccepted + info.sharesRejected; - if (this.lastSharesCount !== -1 && currentShares > this.lastSharesCount) { - this.flashShare = true; - clearTimeout(this.shareTimeout); - this.shareTimeout = setTimeout(() => this.flashShare = false, 500); + const currentSharesAccepted = info.sharesAccepted; + if (this.lastSharesAcceptedCount !== -1 && currentSharesAccepted > this.lastSharesAcceptedCount) { + this.flashShareAccepted = true; + clearTimeout(this.shareAcceptedTimeout); + this.shareAcceptedTimeout = setTimeout(() => this.flashShareAccepted = false, 500); } - this.lastSharesCount = currentShares; + this.lastSharesAcceptedCount = currentSharesAccepted; - if (this.lastScriptsig !== '' && info.scriptsig !== this.lastScriptsig) { - this.flashJob = true; - clearTimeout(this.jobTimeout); - this.jobTimeout = setTimeout(() => this.flashJob = false, 500); + const currentSharesRejected = info.sharesRejected; + if (this.lastSharesRejectedCount !== -1 && currentSharesRejected > this.lastSharesRejectedCount) { + this.flashShareRejected = true; + clearTimeout(this.shareRejectedTimeout); + this.shareRejectedTimeout = setTimeout(() => this.flashShareRejected = false, 500); } - this.lastScriptsig = info.scriptsig || ''; + this.lastSharesRejectedCount = currentSharesRejected; + + const currentWorkReceived = info.workReceived ?? 0; + if (this.lastWorkReceived !== -1 && currentWorkReceived > this.lastWorkReceived) { + this.flashWorkReceived = true; + clearTimeout(this.workReceivedTimeout); + this.workReceivedTimeout = setTimeout(() => this.flashWorkReceived = false, 500); + } + this.lastWorkReceived = currentWorkReceived; }), map(info => { const formatted = { ...info }; diff --git a/main/http_server/axe-os/src/app/services/system.service.ts b/main/http_server/axe-os/src/app/services/system.service.ts index 3ecd26da2..8c65861ff 100644 --- a/main/http_server/axe-os/src/app/services/system.service.ts +++ b/main/http_server/axe-os/src/app/services/system.service.ts @@ -167,6 +167,7 @@ export class SystemApiService { coinbaseValueTotalSatoshis: 50, coinbaseValueUserSatoshis: 50, miningPaused: false, + workReceived: 42, } ).pipe(delay(1000)); } diff --git a/main/http_server/openapi.yaml b/main/http_server/openapi.yaml index bbf4c84b2..95d15c12c 100644 --- a/main/http_server/openapi.yaml +++ b/main/http_server/openapi.yaml @@ -206,6 +206,7 @@ components: - hashrateMonitor - miningPaused - statsLimit + - workReceived properties: ASICModel: type: string @@ -541,6 +542,9 @@ components: statsLimit: type: integer description: Maximum number of statistics data points + workReceived: + type: integer + description: Total number of mining jobs received from the pool SystemASIC: type: object diff --git a/main/http_server/system_api_json.c b/main/http_server/system_api_json.c index 8f9b95f18..1f8f708e0 100644 --- a/main/http_server/system_api_json.c +++ b/main/http_server/system_api_json.c @@ -69,6 +69,7 @@ static void system_api_add_telemetry(cJSON *root, GlobalState *g) { cJSON_AddFloatToObject(root, "responseTime", g->SYSTEM_MODULE.response_time); cJSON_AddNumberToObject(root, "responseShareBatch", g->SYSTEM_MODULE.response_share_batch); cJSON_AddFloatToObject(root, "processTime", g->SYSTEM_MODULE.process_time); + cJSON_AddNumberToObject(root, "workReceived", g->SYSTEM_MODULE.work_received); // Dynamic Block Info cJSON_AddNumberToObject(root, "blockFound", g->SYSTEM_MODULE.block_found);