Merge pull request #2512 from mempool/nymkappa/feature/closed-channel-info
If a channel is closed, show closing date instead of last update
This commit is contained in:
commit
f015b165ee
@ -375,6 +375,7 @@ class ChannelsApi {
|
|||||||
'transaction_vout': channel.transaction_vout,
|
'transaction_vout': channel.transaction_vout,
|
||||||
'closing_transaction_id': channel.closing_transaction_id,
|
'closing_transaction_id': channel.closing_transaction_id,
|
||||||
'closing_reason': channel.closing_reason,
|
'closing_reason': channel.closing_reason,
|
||||||
|
'closing_date': channel.closing_date,
|
||||||
'updated_at': channel.updated_at,
|
'updated_at': channel.updated_at,
|
||||||
'created': channel.created,
|
'created': channel.created,
|
||||||
'status': channel.status,
|
'status': channel.status,
|
||||||
|
@ -25,13 +25,17 @@
|
|||||||
<table class="table table-borderless table-striped">
|
<table class="table table-borderless table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="address.total-sent">Created</td>
|
<td i18n="lightning.created">Created</td>
|
||||||
<td><app-timestamp [dateString]="channel.created"></app-timestamp></td>
|
<td><app-timestamp [dateString]="channel.created"></app-timestamp></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr *ngIf="channel.status !== 2">
|
||||||
<td i18n="address.total-sent">Last update</td>
|
<td i18n="lightning.last-update">Last update</td>
|
||||||
<td><app-timestamp [dateString]="channel.updated_at"></app-timestamp></td>
|
<td><app-timestamp [dateString]="channel.updated_at"></app-timestamp></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr *ngIf="channel.status === 2">
|
||||||
|
<td i18n="lightning.closing_date">Closing date</td>
|
||||||
|
<td><app-timestamp [dateString]="channel.closing_date"></app-timestamp></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
<th class="alias text-left" i18n="nodes.alias">Node Alias</th>
|
<th class="alias text-left" i18n="nodes.alias">Node Alias</th>
|
||||||
<th class="alias text-left d-none d-md-table-cell" i18n="channels.transaction"> </th>
|
<th class="alias text-left d-none d-md-table-cell" i18n="channels.transaction"> </th>
|
||||||
<th class="alias text-left d-none d-md-table-cell" i18n="status">Status</th>
|
<th class="alias text-left d-none d-md-table-cell" i18n="status">Status</th>
|
||||||
<th class="channels text-left d-none d-md-table-cell" i18n="channels.rate">Fee Rate</th>
|
<th *ngIf="status !== 'closed'" class="channels text-left d-none d-md-table-cell" i18n="channels.rate">Fee Rate</th>
|
||||||
|
<th *ngIf="status === 'closed'" class="channels text-left d-none d-md-table-cell" i18n="channels.closing_date">Closing date</th>
|
||||||
<th class="capacity text-right d-none d-md-table-cell" i18n="nodes.capacity">Capacity</th>
|
<th class="capacity text-right d-none d-md-table-cell" i18n="nodes.capacity">Capacity</th>
|
||||||
<th class="capacity text-right" i18n="channels.id">Channel ID</th>
|
<th class="capacity text-right" i18n="channels.id">Channel ID</th>
|
||||||
</thead>
|
</thead>
|
||||||
@ -71,9 +72,12 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</td>
|
</td>
|
||||||
<td class="capacity text-left d-none d-md-table-cell">
|
<td *ngIf="status !== 'closed'" class="capacity text-left d-none d-md-table-cell">
|
||||||
{{ channel.fee_rate }} <span class="symbol">ppm ({{ channel.fee_rate / 10000 | number }}%)</span>
|
{{ channel.fee_rate }} <span class="symbol">ppm ({{ channel.fee_rate / 10000 | number }}%)</span>
|
||||||
</td>
|
</td>
|
||||||
|
<td *ngIf="status === 'closed'" class="capacity text-left d-none d-md-table-cell">
|
||||||
|
<app-timestamp [unixTime]="channel.closing_date"></app-timestamp>
|
||||||
|
</td>
|
||||||
<td class="capacity text-right d-none d-md-table-cell">
|
<td class="capacity text-right d-none d-md-table-cell">
|
||||||
<app-amount *ngIf="channel.capacity > 100000000; else smallchannel" [satoshis]="channel.capacity" [digitsInfo]="'1.2-2'" [noFiat]="true"></app-amount>
|
<app-amount *ngIf="channel.capacity > 100000000; else smallchannel" [satoshis]="channel.capacity" [digitsInfo]="'1.2-2'" [noFiat]="true"></app-amount>
|
||||||
<ng-template #smallchannel>
|
<ng-template #smallchannel>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
‎{{ seconds * 1000 | date: customFormat ?? 'yyyy-MM-dd HH:mm' }}
|
<span *ngIf="seconds === undefined">-</span>
|
||||||
<div class="lg-inline">
|
<span *ngIf="seconds !== undefined">
|
||||||
<i class="symbol">(<app-time-since [time]="seconds" [fastRender]="true"></app-time-since>)</i>
|
‎{{ seconds * 1000 | date: customFormat ?? 'yyyy-MM-dd HH:mm' }}
|
||||||
</div>
|
<div class="lg-inline">
|
||||||
|
<i class="symbol">(<app-time-since [time]="seconds" [fastRender]="true"></app-time-since>)</i>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
@ -11,15 +11,13 @@ export class TimestampComponent implements OnChanges {
|
|||||||
@Input() dateString: string;
|
@Input() dateString: string;
|
||||||
@Input() customFormat: string;
|
@Input() customFormat: string;
|
||||||
|
|
||||||
seconds: number;
|
seconds: number | undefined = undefined;
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnChanges(): void {
|
ngOnChanges(): void {
|
||||||
if (this.unixTime) {
|
if (this.unixTime) {
|
||||||
this.seconds = this.unixTime;
|
this.seconds = this.unixTime;
|
||||||
} else if (this.dateString) {
|
} else if (this.dateString) {
|
||||||
this.seconds = new Date(this.dateString).getTime() / 1000
|
this.seconds = new Date(this.dateString).getTime() / 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user