-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0758263
commit 9faabcc
Showing
11 changed files
with
364 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export enum PartialState { | ||
valid = 'VALID', | ||
stale = 'STALE', | ||
invalid = 'INVALID', | ||
} | ||
|
||
export interface AccountPartial { | ||
shares: number | ||
harvester: string | ||
receivedAt: string | ||
proofTimeInSeconds: number | ||
type: PartialState | ||
} | ||
|
||
export interface AccountPartialList { | ||
partials: AccountPartial[] | ||
total: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<div class="table-responsive-lg"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col"> | ||
<div class="date-header-container"> | ||
<span>Date</span> | ||
<fa-icon [icon]="faExchangeAlt" class="toggle-date-formatting-icon" (click)="toggleDateFormatting()"></fa-icon> | ||
</div> | ||
</th> | ||
<th scope="col">State</th> | ||
<th scope="col">Shares</th> | ||
<th scope="col">Harvester</th> | ||
<th scope="col">Proof time</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngIf="isLoadingInitial | async"> | ||
<td colspan="5" style="text-align: center"> | ||
<app-loading-state></app-loading-state> | ||
</td> | ||
</tr> | ||
<tr *ngIf="(isLoadingInitial | async) === false && (partials | async)?.length === 0"> | ||
<td colspan="5" style="text-align: center; padding-top: 1rem"> | ||
<app-empty-state text="No partials received yet" [icon]="faBarsStaggered"></app-empty-state> | ||
</td> | ||
</tr> | ||
<tr *ngFor="let partial of partials | async; trackBy: trackBy"> | ||
<td>{{getPartialDate(partial)}}</td> | ||
<td> | ||
<span *ngIf="partial.type === 'VALID'" class="badge state-pill background-color-light-green">Valid</span> | ||
<span *ngIf="partial.type === 'INVALID'" class="badge state-pill background-color-red">Invalid</span> | ||
<span *ngIf="partial.type === 'STALE'" class="badge state-pill background-color-orange">Stale</span> | ||
</td> | ||
<td>{{partial.shares}}</td> | ||
<td>{{getPartialHarvesterName(partial)}}</td> | ||
<td><span [ngStyle]="{color: getProofTimeColor(partial.proofTimeInSeconds)}">{{partial.proofTimeInSeconds}} sec</span></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="d-grid footer-grid"> | ||
<div class="pagination-grid-item"> | ||
<ngb-pagination | ||
*ngIf="total > pageSize" | ||
class="d-flex justify-content-center" | ||
[(page)]="page" | ||
[pageSize]="pageSize" | ||
[collectionSize]="total" | ||
[maxSize]="5" | ||
[rotate]="true" | ||
[boundaryLinks]="true" | ||
(pageChange)="onPageChange()"> | ||
<ng-template ngbPaginationNumber let-p> | ||
<div class="d-flex flex-nowrap gap-1"> | ||
{{ p }} | ||
<app-loading-state *ngIf="p === page && (isLoading | async)" width="1" height="1" colorClass="text-light"></app-loading-state> | ||
</div> | ||
</ng-template> | ||
</ngb-pagination> | ||
</div> | ||
<div style="margin-left: auto" *ngIf="showItemsPerPageSelection | async"> | ||
<div class="input-group" style="flex-wrap: nowrap"> | ||
<label class="input-group-text page-size-select-label"> | ||
Items per page | ||
</label> | ||
<select class="form-select page-size-select" [(ngModel)]="pageSize"> | ||
<option *ngFor="let currPageSize of pageSizes" [ngValue]="currPageSize" class="page-size-select-option">{{currPageSize}}</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
::ng-deep .page-link { | ||
background-color: var(--page-link-background-color); | ||
border-color: var(--page-link-border-color); | ||
-webkit-transition: color 0.3s; | ||
transition: color 0.3s; | ||
color: var(--highlight-color); | ||
} | ||
::ng-deep .page-link:hover { | ||
color: var(--highlight-color-hover); | ||
border-color: var(--page-link-border-color); | ||
text-decoration: none; | ||
} | ||
::ng-deep .page-item:not(.active) .page-link:hover { | ||
background-color: var(--page-link-background-color); | ||
} | ||
::ng-deep .page-item.disabled .page-link { | ||
background-color: var(--page-link-background-color); | ||
border-color: var(--page-link-border-color); | ||
} | ||
.page-size-select { | ||
width: 4.2em; | ||
background-color: var(--input-field-background-color); | ||
color: var(--text-color); | ||
border-color: var(--input-field-border-color); | ||
} | ||
.page-size-select-option { | ||
background-color: var(--select-item-background-color); | ||
} | ||
.page-size-select-label { | ||
font-size: small; | ||
background-color: var(--input-field-background-color); | ||
color: var(--text-color); | ||
border-color: var(--input-field-border-color); | ||
} | ||
.footer-grid { | ||
grid-template-columns: repeat(3, 1fr); | ||
grid-column-gap: 5px; | ||
grid-auto-flow: row; | ||
justify-items: center; | ||
} | ||
.pagination-grid-item { | ||
grid-column-start: 2; | ||
} | ||
@media (max-width: 606px) { | ||
.footer-grid { | ||
grid-template-columns: repeat(1, 1fr); | ||
grid-column-gap: 5px; | ||
grid-auto-flow: row; | ||
justify-items: center; | ||
} | ||
.pagination-grid-item { | ||
grid-column-start: 1; | ||
} | ||
} | ||
.state-pill { | ||
color: #18191c; | ||
font-weight: 600; | ||
} |
Oops, something went wrong.