Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@
<div>
<span class="block text-lg font-medium mb-3">
Shares
<i class="pi pi-arrow-up transition-opacity transition-duration-500 ml-2" [ngClass]="{'opacity-100 text-green-500': flashShare, 'opacity-0': !flashShare}" pTooltip="Share Sent" tooltipPosition="top"></i>
<span class="inline-block relative ml-2" style="width: 32px; height: 1em; vertical-align: middle;">
<i class="pi pi-arrow-up transition-opacity transition-duration-500 absolute left-0 text-green-500" [ngClass]="{'opacity-100': flashShareAccepted, 'opacity-0': !flashShareAccepted}" pTooltip="Share Accepted" tooltipPosition="top"></i>
<i class="pi pi-times transition-opacity transition-duration-500 absolute text-red-500" [ngClass]="{'opacity-100': flashShareRejected, 'opacity-0': !flashShareRejected}" [style.left.px]="flashShareAccepted ? 16 : 0" pTooltip="Share Rejected" tooltipPosition="top"></i>
</span>
</span>
<div class="text-900 font-medium text-2xl">
{{info.sharesAccepted | number: '1.0-0'}}
Expand Down Expand Up @@ -487,7 +490,7 @@ <h4 class="mb-0">
<div class="card">
<h4 class="white-space-nowrap overflow-hidden text-overflow-ellipsis">
Block Header
<i class="pi pi-arrow-down transition-opacity transition-duration-500 ml-2 text-sm vertical-align-middle" [ngClass]="{'opacity-100 text-blue-500': flashJob, 'opacity-0': !flashJob}" pTooltip="New Job Received" tooltipPosition="top"></i>
<i class="pi pi-arrow-down transition-opacity transition-duration-500 ml-2 text-sm vertical-align-middle" [ngClass]="{'opacity-100 text-primary': flashWorkReceived, 'opacity-0': !flashWorkReceived}" pTooltip="New Work Received" tooltipPosition="top"></i>
<span *ngIf="info.blockSignals && info.blockSignals.length > 0" class="vertical-align-bottom ml-2">
<span *ngFor="let signal of info.blockSignals" class="p-badge p-badge-success ml-1">{{ signal }}</span>
</span>
Expand Down
46 changes: 29 additions & 17 deletions main/http_server/axe-os/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ISystemInfoError>({
duration: 0,
Expand Down Expand Up @@ -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 };
Expand Down
1 change: 1 addition & 0 deletions main/http_server/axe-os/src/app/services/system.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export class SystemApiService {
coinbaseValueTotalSatoshis: 50,
coinbaseValueUserSatoshis: 50,
miningPaused: false,
workReceived: 42,
}
).pipe(delay(1000));
}
Expand Down
4 changes: 4 additions & 0 deletions main/http_server/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ components:
- hashrateMonitor
- miningPaused
- statsLimit
- workReceived
properties:
ASICModel:
type: string
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions main/http_server/system_api_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading