link to merkle branch first tx

This commit is contained in:
Mononaut 2025-01-22 05:06:02 +00:00
parent 469faf7456
commit 23713a11c2
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
6 changed files with 31 additions and 2 deletions

View File

@ -267,7 +267,11 @@
<tbody>
<tr>
@for (branch of job.merkleBranches; track $index) {
<td class="merkle" [style.background-color]="branch ? '#' + branch.slice(0, 6) : ''"></td>
@if ($index === 0 && branch) {
<a [routerLink]="['/tx' | relativeUrl, reverseHash(branch)]"><td class="merkle" [style.background-color]="branch ? '#' + branch.slice(0, 6) : ''"><fa-icon [icon]="['fas', 'external-link-alt']" [fixedWidth]="true" style="vertical-align: text-top; font-size: 14px; color: white"></fa-icon></td></a>
} @else {
<td class="merkle" [style.background-color]="branch ? '#' + branch.slice(0, 6) : ''"></td>
}
}
@for (_ of [].constructor(Math.max(0, 12 - job.merkleBranches.length)); track $index) {
<td class="merkle empty-branch"></td>

View File

@ -220,6 +220,7 @@ div.scrollable {
.merkle {
width: 100px;
text-align: center;
}
.empty-branch {

View File

@ -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();
}

View File

@ -30,7 +30,13 @@
</td>
@for (cell of row.merkleCells; track $index) {
<td class="merkle" [style.background-color]="cell.hash ? '#' + cell.hash.slice(0, 6) : ''">
<div class="pipe-segment" [class]="pipeToClass(cell.type)"></div>
@if ($index === 0 && cell.hash) {
<a [routerLink]="['/tx' | relativeUrl, reverseHash(cell.hash)]" class="cell-link">
<div class="pipe-segment" [class]="pipeToClass(cell.type)"></div>
</a>
} @else {
<div class="pipe-segment" [class]="pipeToClass(cell.type)"></div>
}
</td>
}
<td class="pool">

View File

@ -92,6 +92,16 @@ td {
}
}
}
.cell-link {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: inherit;
text-decoration: none;
}
}
.badge {

View File

@ -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();
}