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/clightning/invoices/invoices.component.html

101 lines
6.0 KiB
HTML

<div fxLayout="column">
<div class="padding-gap">
<mat-card>
<mat-card-header>
<mat-card-subtitle>
<h2>Invoices</h2>
</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<form fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutAlign.gt-sm="space-between center"
(ngSubmit)="addInvoiceForm.form.valid && onAddInvoice(addInvoiceForm)" #addInvoiceForm="ngForm">
<mat-form-field fxFlex="15" fxLayoutAlign="start end">
<input matInput [(ngModel)]="label" placeholder="Label" tabindex="1" name="label" required>
</mat-form-field>
<mat-form-field fxFlex="15" fxLayoutAlign="start end">
<input matInput [(ngModel)]="description" placeholder="Description" tabindex="2" name="description">
</mat-form-field>
<mat-form-field fxFlex="15" fxLayoutAlign="start end">
<input matInput [(ngModel)]="amount" placeholder="Amount (mSat)" type="number" step="100" min="1" tabindex="3"
name="amount" required>
</mat-form-field>
<mat-form-field fxFlex="10" fxLayoutAlign="start end">
<input matInput [(ngModel)]="expiry" placeholder="Expiry (Sec)" type="number" step="100" min="1"
tabindex="4" name="expiry">
</mat-form-field>
<div fxFlex="10" tabindex="5" fxLayoutAlign="start center" class="chkbox-private">
<mat-checkbox [(ngModel)]="private" matTooltip="Include routing hints for private channels"
[matTooltipPosition]="'above'" name="private">Private</mat-checkbox>
</div>
<button fxFlex="10" fxLayoutAlign="center center" mat-raised-button color="primary" type="submit"
tabindex="5" [disabled]="!addInvoiceForm.valid">Add</button>
<button fxFlex="10" fxLayoutAlign="center center" mat-stroked-button color="accent" tabindex="6" type="reset"
(click)="resetData()">Clear</button>
<button fxFlex="10" fxLayoutAlign="center center" mat-raised-button color="warn" tabindex="7" type="button"
(click)="onDeleteExpiredInvoices()">Delete Expired</button>
</form>
</mat-card-content>
</mat-card>
</div>
<div class="padding-gap">
<mat-card>
<mat-card-content class="table-card-content">
<div fxLayout="row" fxLayoutAlign="start start">
<mat-form-field fxFlex="30">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<div perfectScrollbar class="table-container">
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<table mat-table #table [dataSource]="invoices" matSort
[ngClass]="{'overflow-auto error-border': flgLoading[0]==='error','overflow-auto': true}">
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Status </th>
<td mat-cell *matCellDef="let invoice">
<span *ngIf="invoice.status === 'paid'"><i class="material-icons primary">done_all</i></span>
<span *ngIf="invoice.status !== 'paid'"><i class="material-icons accent">done</i></span>
</td>
</ng-container>
<ng-container matColumnDef="expires_at_str">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Expiry Date </th>
<td mat-cell *matCellDef="let invoice">{{invoice.expires_at_str}}</td>
</ng-container>
<ng-container matColumnDef="paid_at_str">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Paid Date </th>
<td mat-cell *matCellDef="let invoice">{{invoice.paid_at_str}}</td>
</ng-container>
<ng-container matColumnDef="label">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Label </th>
<td mat-cell *matCellDef="let invoice">{{invoice.label}}</td>
</ng-container>
<ng-container matColumnDef="pay_index">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Pay Index </th>
<td mat-cell *matCellDef="let invoice"><span fxLayoutAlign="end center"> {{invoice?.pay_index | number}}
</span></td>
</ng-container>
<ng-container matColumnDef="msatoshi">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Amount </th>
<td mat-cell *matCellDef="let invoice"><span fxLayoutAlign="end center"> {{invoice.msatoshi | number}}
</span></td>
</ng-container>
<ng-container matColumnDef="msatoshi_received">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Received mSatoshi </th>
<td mat-cell *matCellDef="let invoice"><span fxLayoutAlign="end center">
{{invoice.msatoshi_received | number}} </span></td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell class="pl-4" *matHeaderCellDef mat-sort-header> Description </th>
<td mat-cell class="pl-4" *matCellDef="let invoice">{{invoice.description}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"
[@newlyAddedRowAnimation]="(row.label == newlyAddedLabel && row.msatoshi == newlyAddedAmount && flgAnimate) ? 'added' : 'notAdded'"
(click)="onInvoiceClick(row, $event)" class="row-invoices"
[ngClass]="{'settled': row.status === 'paid', 'unsettled': row.status !== 'paid'}"></tr>
</table>
<!-- <mat-paginator [length]="totalInvoices" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" (page)="onPageChange($event)"></mat-paginator> -->
</div>
</mat-card-content>
</mat-card>
</div>
</div>