2020-07-07 17:57:15 +00:00
|
|
|
<div fxLayout="row">
|
2021-04-24 19:08:44 +00:00
|
|
|
<div fxFlex="100">
|
2020-07-07 17:57:15 +00:00
|
|
|
<mat-card-header fxLayout="row" fxLayoutAlign="space-between center" class="modal-info-header">
|
|
|
|
<div fxFlex="95" fxLayoutAlign="start start">
|
|
|
|
<span class="page-title">Connect to a new peer</span>
|
|
|
|
</div>
|
|
|
|
<button tabindex="8" fxFlex="5" fxLayoutAlign="center" class="btn-close-x p-0" (click)="onClose()" mat-button>X</button>
|
|
|
|
</mat-card-header>
|
2021-04-24 19:08:44 +00:00
|
|
|
<mat-card-content class="padding-gap-x-large">
|
2020-07-07 17:57:15 +00:00
|
|
|
<div fxLayout="column">
|
|
|
|
<mat-vertical-stepper [linear]="true" #stepper (selectionChange)="stepSelectionChanged($event)">
|
|
|
|
<mat-step [stepControl]="peerFormGroup" [editable]="flgEditable">
|
|
|
|
<form [formGroup]="peerFormGroup" fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutAlign="start" fxLayoutAlign.gt-sm="space-between" class="my-1">
|
|
|
|
<ng-template matStepLabel>{{peerFormLabel}}</ng-template>
|
|
|
|
<mat-form-field fxFlex="100">
|
|
|
|
<input autoFocus matInput placeholder="Lightning Address (pubkey OR pubkey@ip:port)" formControlName="peerAddress" tabindex="1" required>
|
|
|
|
<mat-error *ngIf="peerFormGroup.controls.peerAddress.errors?.required">Address is required.</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
<div fxFlex="100" class="alert alert-danger mt-1" *ngIf="peerConnectionError !== ''">
|
|
|
|
<fa-icon [icon]="faExclamationTriangle" class="mr-1 alert-icon"></fa-icon>
|
|
|
|
<span>{{peerConnectionError}}</span>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2" fxLayout="row" fxLayoutAlign="start center" fxFlex="100">
|
2021-12-29 23:08:41 +00:00
|
|
|
<button mat-button color="primary" tabindex="3" type="button" (click)="onConnectPeer()">{{peerConnectionError !== '' ? 'Retry' : 'Add Peer'}}</button>
|
2020-07-07 17:57:15 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</mat-step>
|
|
|
|
<mat-step [stepControl]="channelFormGroup" [editable]="flgEditable">
|
|
|
|
<form [formGroup]="channelFormGroup" fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutAlign="start" fxLayoutAlign.gt-sm="space-between" class="mb-1">
|
|
|
|
<ng-template matStepLabel disabled="true">{{channelFormLabel}}</ng-template>
|
|
|
|
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign="space-between stretch">
|
|
|
|
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between center">
|
|
|
|
<mat-form-field fxFlex="60" fxLayoutAlign="start end">
|
2020-12-20 23:36:04 +00:00
|
|
|
<input matInput autoFocus formControlName="fundingAmount" placeholder="Amount" type="number" [step]="1000" tabindex="1" required>
|
2020-07-07 17:57:15 +00:00
|
|
|
<mat-hint>Remaining Bal: {{totalBalance - ((channelFormGroup.controls.fundingAmount.value) ? channelFormGroup.controls.fundingAmount.value : 0)}}</mat-hint>
|
|
|
|
<span matSuffix> Sats </span>
|
|
|
|
<mat-error *ngIf="channelFormGroup.controls.fundingAmount.errors?.required">Amount is required.</mat-error>
|
|
|
|
<mat-error *ngIf="channelFormGroup.controls.fundingAmount.errors?.min">Amount must be a positive number.</mat-error>
|
|
|
|
<mat-error *ngIf="channelFormGroup.controls.fundingAmount.errors?.max">Amount must be less than or equal to {{totalBalance}}.</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
<div fxFlex="35" fxLayoutAlign="start center">
|
|
|
|
<mat-slide-toggle tabindex="2" color="primary" formControlName="isPrivate" name="isPrivate">Private Channel</mat-slide-toggle>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between center" class="mt-1">
|
2022-09-10 01:55:56 +00:00
|
|
|
<div fxFlex="100" fxLayout="row" fxLayoutAlign="space-between center">
|
|
|
|
<mat-form-field fxFlex="49">
|
2021-06-20 20:27:08 +00:00
|
|
|
<input matInput formControlName="feeRate" placeholder="Fee (Sats/vByte)" type="number" name="feeRate" [step]="1" [min]="0" tabindex="7">
|
2020-07-07 17:57:15 +00:00
|
|
|
</mat-form-field>
|
2022-09-10 01:55:56 +00:00
|
|
|
<mat-form-field fxFlex="49">
|
|
|
|
<mat-select formControlName="selChannelType" placeholder="Channel Type" tabindex="8" name="chanType">
|
|
|
|
<mat-option *ngFor="let channelType of channelTypes" [value]="channelType">{{channelType.placeholder}}</mat-option>
|
|
|
|
</mat-select>
|
|
|
|
</mat-form-field>
|
2020-07-07 17:57:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div fxFlex="100" class="alert alert-danger mt-1" *ngIf="channelConnectionError !== ''">
|
|
|
|
<fa-icon [icon]="faExclamationTriangle" class="mr-1 alert-icon"></fa-icon>
|
|
|
|
<span>{{channelConnectionError}}</span>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2" fxLayout="row" fxLayoutAlign="start center" fxFlex="100">
|
2021-12-29 23:08:41 +00:00
|
|
|
<button mat-button color="primary" tabindex="8" type="button" (click)="onOpenChannel()">{{channelConnectionError !== '' ? 'Retry' : 'Open Channel'}}</button>
|
2020-07-07 17:57:15 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</mat-step>
|
|
|
|
</mat-vertical-stepper>
|
|
|
|
<div fxLayout="row" fxFlex="100" fxLayoutAlign="end center">
|
2021-12-29 23:08:41 +00:00
|
|
|
<button mat-button color="primary" tabindex="12" type="button" (click)="onClose()" default>{{newlyAddedPeer?.nodeId ? 'Do It Later' : 'Close'}}</button>
|
2020-07-07 17:57:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</mat-card-content>
|
|
|
|
</div>
|
|
|
|
</div>
|