You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RTL/src/app/cln/ln-services/peerswap/swap-peers/swap-peers.component.html

86 lines
4.9 KiB
HTML

<div fxLayout="column" fxLayoutAlign="start stretch" class="padding-gap-x">
<div class="p-2 error-border my-2" *ngIf="errorMessage !== ''">{{errorMessage}}</div>
<div *ngIf="errorMessage === ''" fxLayout.gt-xs="column" fxLayout="row" fxLayoutAlign="start center" fxLayoutAlign.gt-xs="start stretch" class="page-sub-title-container">
<div fxFlex="100">
<div fxFlex="70"></div>
<mat-form-field fxFlex="30">
<input matInput (keyup)="applyFilter()" [(ngModel)]="selFilter" placeholder="Filter">
</mat-form-field>
</div>
</div>
<div *ngIf="errorMessage === ''" [perfectScrollbar] fxLayout="column" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-progress-bar *ngIf="apiCallStatus?.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
<table mat-table #table [dataSource]="swapPeers" fxFlex="100" matSort class="overflow-auto">
<ng-container matColumnDef="short_channel_id">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Short Channel ID</th>
<td mat-cell *matCellDef="let sPeer">{{sPeer?.short_channel_id}}</td>
</ng-container>
<ng-container matColumnDef="alias">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Node Alias</th>
<td mat-cell *matCellDef="let sPeer">{{sPeer?.alias}}</td>
</ng-container>
<ng-container matColumnDef="nodeid">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Node ID</th>
<td mat-cell *matCellDef="let sPeer">
<span fxLayout="row" class="ellipsis-parent" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '25rem'}">
<span class="ellipsis-child">{{sPeer?.nodeid}}</span>
</span>
</td>
</ng-container>
<ng-container matColumnDef="swaps_allowed">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Swaps Allowed</th>
<td mat-cell *matCellDef="let sPeer">{{sPeer?.swaps_allowed ? 'Allowed' : 'Denied'}}</td>
</ng-container>
<ng-container matColumnDef="local_balance">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before">Local Balance (Sats)</th>
<td mat-cell *matCellDef="let sPeer"><span fxLayoutAlign="end center">{{sPeer?.local_balance | number }}</span>
</td>
</ng-container>
<ng-container matColumnDef="remote_balance">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before">Remote Balance (Sats)</th>
<td mat-cell *matCellDef="let sPeer"><span fxLayoutAlign="end center">{{sPeer?.remote_balance | number }}</span>
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="px-3">
<div class="bordered-box table-actions-select">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onDownloadCSV()">Download CSV</mat-option>
</mat-select>
</div>
</th>
<td mat-cell *matCellDef="let sPeer" [ngClass]="{'px-3': screenSize !== screenSizeEnum.XS}" fxLayoutAlign="end center">
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="2" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onSwapPeerClick(sPeer)">View Info</mat-option>
<mat-option (click)="onSwapOut(sPeer)">Swap Out</mat-option>
<mat-option (click)="onSwapIn(sPeer)">Swap In</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<ng-container matColumnDef="no_swap_peer">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p
*ngIf="(!swapPeers?.data || swapPeers?.data?.length<1) && apiCallStatus?.status === apiCallStatusEnum.COMPLETED">
No peer available for swap.</p>
<p
*ngIf="(!swapPeers?.data || swapPeers?.data?.length<1) && apiCallStatus?.status === apiCallStatusEnum.INITIATED">
Getting peers for swap...</p>
<p
*ngIf="(!swapPeers?.data || swapPeers?.data?.length<1) && apiCallStatus?.status === apiCallStatusEnum.ERROR">
{{errorMessage}}</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_swap_peer']"
[ngClass]="{'display-none': swapPeers?.data && swapPeers?.data?.length>0}">
</tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<mat-paginator *ngIf="errorMessage === ''" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
[showFirstLastButtons]="screenSize === screenSizeEnum.XS ? false : true" class="mb-1"></mat-paginator>
</div>