Skip to content

Commit

Permalink
fix: AxeOS: Display just the active pool details (#394)
Browse files Browse the repository at this point in the history
* fix: Add isUsingFallbackStratum & test hash random
* fix: Add fallback server link
* fix: Just show active pool & cleanup
* fix: Set back to static hashrate for repo
  • Loading branch information
mrv777 authored Oct 9, 2024
1 parent 842afe1 commit 339fbcb
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 34 deletions.
68 changes: 35 additions & 33 deletions main/http_server/axe-os/src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,39 +205,41 @@ <h5>Performance</h5>


<div class="col-12 lg:col-6">
<div class="card">
<h5>Pool Information</h5>
<table *ngIf="info$ | async as info; else loading">
<tr *ngIf="quickLink$ | async as quickLink">
<td>Quick Link:</td>
<td style="word-break: break-all;">
<a style="color: white; text-decoration: underline;" [href]="quickLink" target="_blank">{{quickLink}}</a>
</td>
</tr>
<tr>
<td>URL:</td>
<td style="word-break: break-all;">{{info.stratumURL}}</td>
</tr>
<tr>
<td>Port:</td>
<td style="word-break: break-all;">{{info.stratumPort}}</td>
</tr>
<tr>
<td>User:</td>
<td style="word-break: break-all;">{{info.stratumUser}}</td>
</tr>
<tr>
<td>Fallback URL:</td>
<td style="word-break: break-all;">{{info.fallbackStratumURL}}</td>
</tr>
<tr>
<td>Fallback Port:</td>
<td style="word-break: break-all;">{{info.fallbackStratumPort}}</td>
</tr>
<tr>
<td>Fallback User:</td>
<td style="word-break: break-all;">{{info.fallbackStratumUser}}</td>
</tr>
<div class="card" *ngIf="info$ | async as info; else loading">
<h5>Pool Information ({{info.isUsingFallbackStratum ? 'Fallback' : 'Primary' }})</h5>
<table>
<ng-container *ngIf="!info.isUsingFallbackStratum">
<tr>
<td>URL:</td>
<td style="word-break: break-all;">
<a style="text-decoration: underline;" [href]="(quickLink$ | async) || info.stratumURL" target="_blank">{{info.stratumURL}}</a>
</td>
</tr>
<tr>
<td>Port:</td>
<td style="word-break: break-all;">{{info.stratumPort}}</td>
</tr>
<tr>
<td>User:</td>
<td style="word-break: break-all;">{{info.stratumUser}}</td>
</tr>
</ng-container>
<ng-container *ngIf="info.isUsingFallbackStratum">
<tr>
<td>URL:</td>
<td style="word-break: break-all;">
<a style="text-decoration: underline;" [href]="(fallbackQuickLink$ | async) || info.fallbackStratumURL" target="_blank">{{info.fallbackStratumURL}}</a>
</td>
</tr>
<tr>
<td>Port:</td>
<td style="word-break: break-all;">{{info.fallbackStratumPort}}</td>
</tr>
<tr>
<td>User:</td>
<td style="word-break: break-all;">{{info.fallbackStratumUser}}</td>
</tr>
</ng-container>
</table>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

.card {
min-height: 100%;
}
}
21 changes: 21 additions & 0 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 @@ -15,6 +15,7 @@ export class HomeComponent {
public info$: Observable<ISystemInfo>;

public quickLink$: Observable<string | undefined>;
public fallbackQuickLink$: Observable<string | undefined>;
public expectedHashRate$: Observable<number | undefined>;


Expand Down Expand Up @@ -186,6 +187,26 @@ export class HomeComponent {
})
)

this.fallbackQuickLink$ = this.info$.pipe(
map(info => {
if (info.fallbackStratumURL.includes('public-pool.io')) {
const address = info.fallbackStratumUser.split('.')[0]
return `https://web.public-pool.io/#/app/${address}`;
} else if (info.fallbackStratumURL.includes('ocean.xyz')) {
const address = info.fallbackStratumUser.split('.')[0]
return `https://ocean.xyz/stats/${address}`;
} else if (info.fallbackStratumURL.includes('solo.d-central.tech')) {
const address = info.fallbackStratumUser.split('.')[0]
return `https://solo.d-central.tech/#/app/${address}`;
} else if (/solo[46]?.ckpool.org/.test(info.fallbackStratumURL)) {
const address = info.fallbackStratumUser.split('.')[0]
return `https://solo.ckpool.org/users/${address}`;
} else {
return undefined;
}
})
)

}

private calculateAverage(data: number[]): number {
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 @@ -49,6 +49,7 @@ export class SystemService {
fallbackStratumPort: 21497,
stratumUser: "bc1q99n3pu025yyu0jlywpmwzalyhm36tg5u37w20d.bitaxe-U1",
fallbackStratumUser: "bc1q99n3pu025yyu0jlywpmwzalyhm36tg5u37w20d.bitaxe-U1",
isUsingFallbackStratum: true,
frequency: 485,
version: "2.0",
boardVersion: "204",
Expand Down
1 change: 1 addition & 0 deletions main/http_server/axe-os/src/models/ISystemInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface ISystemInfo {
stratumPort: number,
fallbackStratumURL: string,
fallbackStratumPort: number,
isUsingFallbackStratum: boolean,
stratumUser: string,
fallbackStratumUser: string,
frequency: number,
Expand Down

0 comments on commit 339fbcb

Please sign in to comment.