Issue fix #130 & #131
pull/134/head
ShahanaFarooqui 5 years ago
parent a0ae62b312
commit aaa2c917a2

@ -8,5 +8,5 @@
<link rel="stylesheet" href="styles.c7b8be38c41a5a330ca0.css"></head>
<body>
<rtl-app></rtl-app>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.7b000723c8806c9e2653.js"></script></body>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.ad42e6127177779617fb.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

@ -38,6 +38,7 @@ exports.getChannels = (req, res, next) => {
channels = (undefined === body.channels) ? [] : body.channels;
Promise.all(
channels.map(channel => {
channel.private = (channel.private) ? 'True' : 'False';
return getAliasForChannel(channel, req.params.channelType);
})
)
@ -79,6 +80,7 @@ exports.postChannel = (req, res, next) => {
options.form = {
node_pubkey_string: req.body.node_pubkey,
local_funding_amount: req.body.local_funding_amount,
private: req.body.private,
spend_unconfirmed: req.body.spend_unconfirmed
};
if (req.body.trans_type === '1') {

@ -22,30 +22,25 @@
<div fxFlex="15" tabindex="3" fxLayoutAlign="start center">
<mat-checkbox [(ngModel)]="moreOptions" name="moreOptions" (change)="onMoreOptionsChange($event)">Options</mat-checkbox>
</div>
<span *ngIf="moreOptions" fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="77">
<div fxFlex="30" tabindex="4" fxLayoutAlign="start start">
<mat-form-field fxFlex="99">
<mat-select [(value)]="selTransType">
<mat-option *ngFor="let transType of transTypes" [value]="transType.id">
{{transType.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="30" fxLayoutAlign="start start">
<mat-form-field fxFlex="90" fxFlex.lt-sm="100" *ngIf="selTransType=='0'">
<input matInput placeholder="Channel Opening Priority" disabled>
</mat-form-field>
<mat-form-field fxFlex="90" fxFlex.lt-sm="100" *ngIf="selTransType=='1'">
<input matInput [(ngModel)]="transTypeValue.blocks" placeholder="Target Confirmation Blocks" type="number" name="blocks" step="1" min="0" required tabindex="5" #blocks="ngModel">
</mat-form-field>
<mat-form-field fxFlex="90" fxFlex.lt-sm="100" *ngIf="selTransType=='2'">
<input matInput [(ngModel)]="transTypeValue.fees" placeholder="Fee ({{information?.smaller_currency_unit}}/Byte)" type="number" name="fees" step="1" min="0" required tabindex="6" #fees="ngModel">
</mat-form-field>
</div>
<div fxFleax="40" fxLayoutAlign="start center">
<mat-checkbox tabindex="7" [(ngModel)]="spendUnconfirmed" name="spendUnconfirmed">Spend Unconfirmed Output</mat-checkbox>
</div>
<span *ngIf="moreOptions" fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="80" fxLayoutAlign.gt-sm="space-between center">
<mat-form-field fxFlex="25" fxLayoutAlign="start end">
<mat-select tabindex="4" [(value)]="selTransType">
<mat-option *ngFor="let transType of transTypes" [value]="transType.id">
{{transType.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="25" *ngIf="selTransType=='0'">
<input matInput placeholder="Channel Opening Priority" disabled>
</mat-form-field>
<mat-form-field fxFlex="25" *ngIf="selTransType=='1'">
<input matInput [(ngModel)]="transTypeValue.blocks" placeholder="Target Confirmation Blocks" type="number" name="blocks" step="1" min="0" required tabindex="5" #blocks="ngModel">
</mat-form-field>
<mat-form-field fxFlex="25" *ngIf="selTransType=='2'">
<input matInput [(ngModel)]="transTypeValue.fees" placeholder="Fee ({{information?.smaller_currency_unit}}/Byte)" type="number" name="fees" step="1" min="0" required tabindex="6" #fees="ngModel">
</mat-form-field>
<mat-checkbox fxFlex="25" fxFlex.lt-lg="35" tabindex="7" [(ngModel)]="spendUnconfirmed" name="spendUnconfirmed">Spend Unconfirmed Output</mat-checkbox>
<mat-checkbox fxFlex="20" fxFlex.lt-lg="15" tabindex="8" [(ngModel)]="isPrivate" name="isPrivate">Private</mat-checkbox>
</span>
<div fxFlex="10" fxLayoutAlign="end start">
<button fxFlex="90" fxLayoutAlign="center center" mat-raised-button color="primary" [disabled]="selectedPeer === '' || fundingAmount == null || (totalBalance - ((fundingAmount) ? fundingAmount : 0) < 0)" type="submit" tabindex="8">
@ -120,6 +115,10 @@
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Fee </th>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.commit_fee | number}} </span></td>
</ng-container>
<ng-container matColumnDef="private">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Private </th>
<td mat-cell *matCellDef="let channel"> {{channel.private}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="onChannelClick(row, $event)"></tr>
</table>

@ -1,6 +1,10 @@
.mat-column-close, .mat-column-update, .mat-column-active {
.mat-column-close, .mat-column-update, .mat-column-active, .mat-column-private {
flex: 0 0 6%;
min-width: 50px;
min-width: 60px;
}
.mat-column-private {
padding-left: 10px;
}
.mat-cell.mat-column-close, .mat-column-update {

@ -35,6 +35,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
public selTransType = '0';
public transTypeValue = {blocks: '', fees: ''};
public spendUnconfirmed = false;
public isPrivate = false;
public moreOptions = false;
public flgSticky = false;
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
@ -53,12 +54,12 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
case (window.innerWidth > 1024 && window.innerWidth <= 1280):
this.flgSticky = true;
this.displayedColumns = ['close', 'update', 'active', 'chan_id', 'remote_alias', 'capacity', 'local_balance', 'remote_balance', 'total_satoshis_sent',
'total_satoshis_received', 'commit_fee'];
'total_satoshis_received', 'commit_fee', 'private'];
break;
default:
this.flgSticky = true;
this.displayedColumns = ['close', 'update', 'active', 'chan_id', 'remote_pubkey', 'remote_alias', 'capacity', 'local_balance', 'remote_balance',
'total_satoshis_sent', 'total_satoshis_received', 'commit_fee'];
'total_satoshis_sent', 'total_satoshis_received', 'commit_fee', 'private'];
break;
}
}
@ -101,7 +102,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
transTypeValue = this.transTypeValue.fees;
}
this.store.dispatch(new RTLActions.SaveNewChannel({
selectedPeerPubkey: this.selectedPeer, fundingAmount: this.fundingAmount,
selectedPeerPubkey: this.selectedPeer, fundingAmount: this.fundingAmount, private: this.isPrivate,
transType: this.selTransType, transTypeValue: transTypeValue, spendUnconfirmed: this.spendUnconfirmed
}));
}
@ -231,6 +232,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
this.fundingAmount = 0;
this.moreOptions = false;
this.spendUnconfirmed = false;
this.isPrivate = false;
this.selTransType = '0';
this.transTypeValue = {blocks: '', fees: ''};
}
@ -238,6 +240,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
onMoreOptionsChange(event: any) {
if (!event.checked) {
this.spendUnconfirmed = false;
this.isPrivate = false;
this.selTransType = '0';
this.transTypeValue = {blocks: '', fees: ''};
}

@ -84,8 +84,9 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
onForwardingEventClick(selRow: ForwardingEvent, event: any) {
const selFEvent = this.forwardingHistoryEvents.data.filter(fhEvent => {
return fhEvent.chan_id_in === selRow.chan_id_in;
return (fhEvent.chan_id_in === selRow.chan_id_in && fhEvent.timestamp === selRow.timestamp);
})[0];
console.warn(selFEvent);
const reorderedFHEvent = JSON.parse(JSON.stringify(selFEvent, ['timestamp_str', 'chan_id_in', 'alias_in', 'chan_id_out', 'alias_out', 'amt_out', 'amt_in', 'fee'] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: 'INFO',

@ -40,9 +40,9 @@ export interface Channel {
total_satoshis_sent?: number;
total_satoshis_received?: number;
num_updates?: number;
private?: boolean;
pending_htlcs?: HTLC[];
csv_delay?: number;
private?: boolean;
}
export interface PendingChannels {

@ -240,7 +240,7 @@ export class SetClosedChannels implements Action {
export class SaveNewChannel implements Action {
readonly type = SAVE_NEW_CHANNEL;
constructor(public payload: {selectedPeerPubkey: string, fundingAmount: number, transType: string, transTypeValue: string, spendUnconfirmed: boolean}) {}
constructor(public payload: {selectedPeerPubkey: string, fundingAmount: number, private: boolean, transType: string, transTypeValue: string, spendUnconfirmed: boolean}) {}
}
export class CloseChannel implements Action {

@ -286,7 +286,7 @@ export class RTLEffects implements OnDestroy {
ofType(RTLActions.SAVE_NEW_CHANNEL),
mergeMap((action: RTLActions.SaveNewChannel) => {
return this.httpClient.post(environment.CHANNELS_API, {
node_pubkey: action.payload.selectedPeerPubkey, local_funding_amount: action.payload.fundingAmount,
node_pubkey: action.payload.selectedPeerPubkey, local_funding_amount: action.payload.fundingAmount, private: action.payload.private,
trans_type: action.payload.transType, trans_type_value: action.payload.transTypeValue, spend_unconfirmed: action.payload.spendUnconfirmed
})
.pipe(

Loading…
Cancel
Save