2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-11-11 13:10:41 +00:00
RTL/src/app/eclair/ecl.routing.ts

93 lines
5.7 KiB
TypeScript
Raw Normal View History

import { Routes, RouterModule } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import { ECLRootComponent } from './ecl-root.component';
import { ECLHomeComponent } from './home/home.component';
import { ECLOnChainComponent } from './on-chain/on-chain.component';
import { ECLConnectionsComponent } from './peers-channels/connections.component';
import { ECLTransactionsComponent } from './transactions/transactions.component';
import { ECLRoutingComponent } from './routing/routing.component';
2021-12-29 23:08:41 +00:00
import { ECLLookupsComponent } from './graph/lookups/lookups.component';
import { ECLOnChainReceiveComponent } from './on-chain/on-chain-receive/on-chain-receive.component';
import { ECLOnChainSendComponent } from './on-chain/on-chain-send/on-chain-send.component';
import { ECLChannelsTablesComponent } from './peers-channels/channels/channels-tables/channels-tables.component';
import { ECLChannelOpenTableComponent } from './peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component';
import { ECLChannelPendingTableComponent } from './peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component';
import { ECLPeersComponent } from './peers-channels/peers/peers.component';
import { ECLLightningPaymentsComponent } from './transactions/payments/lightning-payments.component';
import { ECLLightningInvoicesComponent } from './transactions/invoices/lightning-invoices.component';
2021-12-29 23:08:41 +00:00
import { ECLQueryRoutesComponent } from './graph/query-routes/query-routes.component';
import { ECLChannelInactiveTableComponent } from './peers-channels/channels/channels-tables/channel-inactive-table/channel-inactive-table.component';
import { ECLForwardingHistoryComponent } from './routing/forwarding-history/forwarding-history.component';
import { ECLRoutingPeersComponent } from './routing/routing-peers/routing-peers.component';
import { ECLReportsComponent } from './reports/reports.component';
import { ECLRoutingReportComponent } from './reports/routing/routing-report.component';
import { ECLTransactionsReportComponent } from './reports/transactions/transactions-report.component';
import { ECLUnlockedGuard } from '../shared/services/auth.guard';
import { NotFoundComponent } from '../shared/components/not-found/not-found.component';
2021-12-29 23:08:41 +00:00
import { ECLGraphComponent } from './graph/graph.component';
2022-11-24 03:23:05 +00:00
type PathMatch = 'full' | 'prefix' | undefined;
export const EclRoutes: Routes = [
2021-08-28 21:03:18 +00:00
{
path: '', component: ECLRootComponent,
children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'home' },
{ path: 'home', component: ECLHomeComponent, canActivate: [ECLUnlockedGuard()] },
2021-08-28 21:03:18 +00:00
{
path: 'onchain', component: ECLOnChainComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'receive' },
{ path: 'receive', component: ECLOnChainReceiveComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'send', component: ECLOnChainSendComponent, canActivate: [ECLUnlockedGuard()] }
2021-08-28 21:03:18 +00:00
]
},
{
path: 'connections', component: ECLConnectionsComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'channels' },
2021-08-28 21:03:18 +00:00
{
path: 'channels', component: ECLChannelsTablesComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'open' },
{ path: 'open', component: ECLChannelOpenTableComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'pending', component: ECLChannelPendingTableComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'inactive', component: ECLChannelInactiveTableComponent, canActivate: [ECLUnlockedGuard()] }
2021-08-28 21:03:18 +00:00
]
},
{ path: 'peers', component: ECLPeersComponent, data: { sweepAll: false }, canActivate: [ECLUnlockedGuard()] }
2021-08-28 21:03:18 +00:00
]
},
{
path: 'transactions', component: ECLTransactionsComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'payments' },
{ path: 'payments', component: ECLLightningPaymentsComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'invoices', component: ECLLightningInvoicesComponent, canActivate: [ECLUnlockedGuard()] }
2021-08-28 21:03:18 +00:00
]
},
{
path: 'routing', component: ECLRoutingComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'forwardinghistory' },
{ path: 'forwardinghistory', component: ECLForwardingHistoryComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'peers', component: ECLRoutingPeersComponent, canActivate: [ECLUnlockedGuard()] }
2021-08-28 21:03:18 +00:00
]
},
{
path: 'reports', component: ECLReportsComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'routingreport' },
{ path: 'routingreport', component: ECLRoutingReportComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'transactions', component: ECLTransactionsReportComponent, canActivate: [ECLUnlockedGuard()] }
2021-08-28 21:03:18 +00:00
]
},
2021-12-29 23:08:41 +00:00
{
path: 'graph', component: ECLGraphComponent, canActivate: [ECLUnlockedGuard()], children: [
2022-11-24 03:23:05 +00:00
{ path: '', pathMatch: <PathMatch>'full', redirectTo: 'lookups' },
{ path: 'lookups', component: ECLLookupsComponent, canActivate: [ECLUnlockedGuard()] },
{ path: 'queryroutes', component: ECLQueryRoutesComponent, canActivate: [ECLUnlockedGuard()] }
2021-12-29 23:08:41 +00:00
]
},
{ path: '**', component: NotFoundComponent }
]
}
];
export const ECLRouting: ModuleWithProviders<RouterModule> = RouterModule.forChild(EclRoutes);