Adding Lightning wrapper component

This commit is contained in:
softsimon 2022-05-06 16:31:25 +04:00
parent d23e5d0e87
commit 31d280f729
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
6 changed files with 45 additions and 11 deletions

View File

@ -16,9 +16,13 @@
<div class="col-md"> <div class="col-md">
<table class="table table-borderless table-striped"> <table class="table table-borderless table-striped">
<tbody> <tbody>
<tr>
<td i18n="address.total-sent">Created</td>
<td><app-time-since [dateString]="channel.created"></app-time-since></td>
</tr>
<tr> <tr>
<td i18n="address.total-sent">Last update</td> <td i18n="address.total-sent">Last update</td>
<td>{{ channel.updated_at | date:'yyyy-MM-dd HH:mm' }}</td> <td><app-time-since [dateString]="channel.updated_at"></app-time-since></td>
</tr> </tr>
<tr> <tr>
<td i18n="address.total-sent">Transaction ID</td> <td i18n="address.total-sent">Transaction ID</td>
@ -38,7 +42,7 @@
<tbody> <tbody>
<tr> <tr>
<td i18n="address.total-received">Capacity</td> <td i18n="address.total-received">Capacity</td>
<td><app-sats [satoshis]="channel.capacity"></app-sats></td> <td><app-sats [satoshis]="channel.capacity"></app-sats>&nbsp; <app-fiat [value]="channel.capacity" digitsInfo="1.2-2"></app-fiat></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,16 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { WebsocketService } from 'src/app/services/websocket.service';
@Component({
selector: 'app-lightning-wrapper',
templateUrl: './lightning-wrapper.component.html',
styleUrls: ['./lightning-wrapper.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LightningWrapperComponent {
constructor(
private websocketService: WebsocketService,
) { }
}

View File

@ -10,6 +10,7 @@ import { NodeComponent } from './node/node.component';
import { LightningRoutingModule } from './lightning.routing.module'; import { LightningRoutingModule } from './lightning.routing.module';
import { ChannelsListComponent } from './channels-list/channels-list.component'; import { ChannelsListComponent } from './channels-list/channels-list.component';
import { ChannelComponent } from './channel/channel.component'; import { ChannelComponent } from './channel/channel.component';
import { LightningWrapperComponent } from './lightning-wrapper/lightning-wrapper.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
LightningDashboardComponent, LightningDashboardComponent,
@ -18,6 +19,7 @@ import { ChannelComponent } from './channel/channel.component';
NodeComponent, NodeComponent,
ChannelsListComponent, ChannelsListComponent,
ChannelComponent, ChannelComponent,
LightningWrapperComponent,
], ],
imports: [ imports: [
CommonModule, CommonModule,

View File

@ -1,10 +1,15 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { LightningDashboardComponent } from './lightning-dashboard/lightning-dashboard.component'; import { LightningDashboardComponent } from './lightning-dashboard/lightning-dashboard.component';
import { LightningWrapperComponent } from './lightning-wrapper/lightning-wrapper.component';
import { NodeComponent } from './node/node.component'; import { NodeComponent } from './node/node.component';
import { ChannelComponent } from './channel/channel.component'; import { ChannelComponent } from './channel/channel.component';
const routes: Routes = [ const routes: Routes = [
{
path: '',
component: LightningWrapperComponent,
children: [
{ {
path: '', path: '',
component: LightningDashboardComponent, component: LightningDashboardComponent,
@ -21,6 +26,12 @@ const routes: Routes = [
path: '**', path: '**',
redirectTo: '' redirectTo: ''
} }
]
},
{
path: '**',
redirectTo: ''
}
]; ];
@NgModule({ @NgModule({