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/liquidity-ads/liquidity-ads.component.html

128 lines
8.7 KiB
HTML

<div fxLayout="row" fxLayoutAlign="start center" class="page-title-container">
<fa-icon [icon]="faWater" class="page-title-img mr-1"></fa-icon>
<span class="page-title">Liquidity Ads</span>
</div>
<div fxLayout="column" class="padding-gap-x">
<mat-card>
<mat-card-content class="padding-gap-large">
<div fxLayout="column" fxFlex="100" fxLayoutAlign="space-between stretch">
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-sm="row wrap" #formAsk="ngForm">
<div fxFlex="100" fxLayout="row" class="alert alert-warn">
<fa-icon [icon]="faExclamationTriangle" class="mr-1 alert-icon"></fa-icon>
<span>Ads should be suplemented with additional research of the nodes, before buying liquidity.</span>
</div>
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start start" class="page-sub-title-container mt-1">
<div fxFlex="30">
<span class="page-title">
Liquidity Ask
<mat-icon matTooltip="Tooltip for Liquidity Ask" matTooltipPosition="above" class="info-icon info-icon-primary">info_outline</mat-icon>
</span>
</div>
<mat-form-field fxFlex="34">
<input autoFocus matInput placeholder="Channel Amount (Sats)" name="channelAmount" [(ngModel)]="channelAmount" tabindex="1" type="number" step="1000" required>
<mat-error *ngIf="!channelAmount">Channel amount is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="34">
<input matInput placeholder="Channel Opening Fee Rate (Sats/vByte)" name="channelOpeningFeeRate" [(ngModel)]="channelOpeningFeeRate" type="number" step="1" tabindex="2" required>
<mat-error *ngIf="!channelOpeningFeeRate">Channel opening fee rate is required.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row" class="my-1">
<button class="mr-1" mat-stroked-button color="primary" tabindex="3" type="reset" (click)="onReset()">Clear</button>
<button mat-flat-button color="primary" (click)="onRecalculate()" tabindex="4" type="submit">Recalculate</button>
</div>
</form>
<mat-divider [inset]="true" class="my-2"></mat-divider>
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-sm="row wrap" #formFilter="ngForm">
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start start" class="page-sub-title-container mt-1">
<div fxFlex="30">
<span class="page-title">
Nodes Advertising Liquidity
<mat-icon matTooltip="Tooltip for Nodes Advertising Liquidity" matTooltipPosition="above" class="info-icon info-icon-primary">info_outline</mat-icon>
</span>
</div>
<mat-form-field fxFlex="34">
<input matInput placeholder="Node Capacity (Sats)" name="nodeCapacity" [(ngModel)]="nodeCapacity" tabindex="5" type="number" step="1000" required>
<mat-error *ngIf="!nodeCapacity">Node capacity is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="34">
<input matInput placeholder="Channel Count" name="channelCount" [(ngModel)]="channelCount" type="number" step="1" tabindex="6" required>
<mat-error *ngIf="!channelCount">Channel count is required.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row" class="my-1">
<button class="mr-1" mat-stroked-button color="primary" tabindex="7" type="reset" (click)="onFilterReset()">Clear</button>
<button mat-flat-button color="primary" (click)="onFilter()" tabindex="8" type="submit">Filter</button>
</div>
</form>
<div [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]="liquidityNodes" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
<ng-container matColumnDef="alias">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Alias </th>
<td mat-cell *matCellDef="let lqNode" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '40rem'}">
{{lqNode?.alias}}
</td>
</ng-container>
<ng-container matColumnDef="capacity">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Capacity </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="numChannels">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Channels </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="leaseFeeBasis">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Lease Fee </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="routingFee">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Routing Fee </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="channelOpenFee">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Channel Open Fee </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </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 lqNode" fxLayoutAlign="end center" class="px-3">
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onNodeClick(lqNode)">View Info</mat-option>
<mat-option (click)="onOpenChannel(lqNode)">Open Channel</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<ng-container matColumnDef="no_lqNode">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="(!liquidityNodes?.data || liquidityNodes?.data?.length<1) && apiCallStatus.status === apiCallStatusEnum.COMPLETED">No node with liquidity.</p>
<p *ngIf="(!liquidityNodes?.data || liquidityNodes?.data?.length<1) && apiCallStatus.status === apiCallStatusEnum.INITIATED">Getting nodes with liquidity...</p>
<p *ngIf="(!liquidityNodes?.data || liquidityNodes?.data?.length<1) && apiCallStatus.status === apiCallStatusEnum.ERROR">{{errorMessage}}</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_lqNode']" [ngClass]="{'display-none': liquidityNodes?.data && liquidityNodes?.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 [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" [showFirstLastButtons]="screenSize === screenSizeEnum.XS ? false : true" class="mb-1"></mat-paginator>
</div>
</mat-card-content>
</mat-card>
</div>