mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 09:50:36 +01:00
lnd peers page layout
This commit is contained in:
parent
5c79a078fa
commit
65e4c35226
@ -54,20 +54,12 @@ export class CLNTransactionsReportComponent implements OnInit, OnDestroy {
|
||||
this.showYAxisLabel = !(this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM);
|
||||
this.store.select(clnPageSettings).pipe(takeUntil(this.unSubs[0])).
|
||||
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
if (settings.apiCallStatus.status === APICallStatusEnum.ERROR) {
|
||||
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
|
||||
this.displayedColumns = ['date', 'amount_paid', 'amount_received'];
|
||||
} else {
|
||||
this.displayedColumns = ['date', 'amount_paid', 'num_payments', 'amount_received', 'num_invoices'];
|
||||
}
|
||||
} else {
|
||||
this.tableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId) || CLN_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId)!;
|
||||
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
|
||||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM));
|
||||
} else {
|
||||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
|
||||
}
|
||||
}
|
||||
this.displayedColumns.push('actions');
|
||||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
|
@ -54,20 +54,12 @@ export class ECLTransactionsReportComponent implements OnInit, OnDestroy {
|
||||
this.showYAxisLabel = !(this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM);
|
||||
this.store.select(eclPageSettings).pipe(takeUntil(this.unSubs[0])).
|
||||
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
if (settings.apiCallStatus.status === APICallStatusEnum.ERROR) {
|
||||
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
|
||||
this.displayedColumns = ['date', 'amount_paid', 'amount_received'];
|
||||
} else {
|
||||
this.displayedColumns = ['date', 'amount_paid', 'num_payments', 'amount_received', 'num_invoices'];
|
||||
}
|
||||
} else {
|
||||
this.tableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId) || ECL_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId)!;
|
||||
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
|
||||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM));
|
||||
} else {
|
||||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
|
||||
}
|
||||
}
|
||||
this.displayedColumns.push('actions');
|
||||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
|
@ -17,25 +17,44 @@
|
||||
<table mat-table #table [dataSource]="peers" 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 peer" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '12rem' : '25rem'}"> {{peer?.alias}} </td>
|
||||
<td mat-cell *matCellDef="let peer" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '25rem'}"> {{peer?.alias}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="pub_key">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Public Key </th>
|
||||
<td mat-cell *matCellDef="let peer" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '5rem' : '35rem'}"> {{peer?.pub_key}} </td>
|
||||
<td mat-cell *matCellDef="let peer" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '25rem'}"> {{peer?.pub_key}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="address">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header class="pl-1"> Address </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '25rem'}"> {{peer?.address}} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="sync_type">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header class="pl-1"> Sync Type </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1">{{peer?.sync_type | camelcaseWithReplace:'sync':'_'}}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="inbound">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header class="pl-1"> Inbound </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1">{{peer?.inbound ? 'Yes' : 'No'}}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="bytes_sent">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1"> Bytes Sent </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1"><span fxLayoutAlign="end center"> {{peer?.bytes_sent | number}} </span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="bytes_recv">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1"> Bytes Received </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1"><span fxLayoutAlign="end center"> {{peer?.bytes_recv | number}} </span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="sat_sent">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before">
|
||||
Sats Sent </th>
|
||||
<td mat-cell *matCellDef="let peer"><span fxLayoutAlign="end center"> {{peer?.sat_sent | number}} </span></td>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1"> Sats Sent </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1"><span fxLayoutAlign="end center"> {{peer?.sat_sent | number}} </span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="sat_recv">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1">
|
||||
Sats Received </th>
|
||||
<td mat-cell *matCellDef="let peer"><span fxLayoutAlign="end center"> {{peer?.sat_recv | number}} </span></td>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1"><span fxLayoutAlign="end center"> {{peer?.sat_recv | number}} </span></td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="ping_time">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Ping Time (<span>µ</span>s) </th>
|
||||
<td mat-cell *matCellDef="let peer"><span fxLayoutAlign="end center"> {{peer?.ping_time | number}} </span>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1"> Ping Time (<span>µ</span>s) </th>
|
||||
<td mat-cell *matCellDef="let peer" class="pl-1"><span fxLayoutAlign="end center"> {{peer?.ping_time | number}} </span>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
|
@ -1,23 +1,10 @@
|
||||
.mat-column-alias {
|
||||
flex: 1 1 25%;
|
||||
.mat-column-alias, .mat-column-address, .mat-column-pub_key {
|
||||
flex: 1 1 20%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.mat-column-pub_key {
|
||||
flex: 1 1 35%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
.mat-column-actions {
|
||||
min-height: 4.8rem;
|
||||
}
|
||||
|
||||
.mat-column-sat_sent, .mat-column-sat_recv, .mat-column-ping_time {
|
||||
flex: 1 1 13%;
|
||||
width: 13%;
|
||||
}
|
||||
|
@ -59,20 +59,12 @@ export class TransactionsReportComponent implements OnInit, OnDestroy {
|
||||
this.showYAxisLabel = !(this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM);
|
||||
this.store.select(clnPageSettings).pipe(takeUntil(this.unSubs[0])).
|
||||
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
if (settings.apiCallStatus.status === APICallStatusEnum.ERROR) {
|
||||
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
|
||||
this.displayedColumns = ['date', 'amount_paid', 'amount_received'];
|
||||
} else {
|
||||
this.displayedColumns = ['date', 'amount_paid', 'num_payments', 'amount_received', 'num_invoices'];
|
||||
}
|
||||
} else {
|
||||
this.tableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId)!;
|
||||
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
|
||||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM));
|
||||
} else {
|
||||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
|
||||
}
|
||||
}
|
||||
this.displayedColumns.push('actions');
|
||||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
|
@ -974,8 +974,8 @@ export const LND_TABLES_DEF = {
|
||||
allowedColumns: ['amount', 'incoming', 'expiration_height', 'hash_lock']
|
||||
},
|
||||
peers: {
|
||||
maxColumns: 3,
|
||||
allowedColumns: ['alias', 'pub_key', 'sat_sent', 'sat_recv', 'ping_time']
|
||||
maxColumns: 8,
|
||||
allowedColumns: ['alias', 'pub_key', 'address', 'sync_type', 'inbound', 'bytes_sent', 'bytes_recv', 'sat_sent', 'sat_recv', 'ping_time']
|
||||
}
|
||||
},
|
||||
transactions: {
|
||||
|
Loading…
Reference in New Issue
Block a user