mempool/frontend/src/app/app-routing.module.ts

237 lines
6.1 KiB
TypeScript
Raw Normal View History

2019-07-21 17:59:47 +03:00
import { NgModule } from '@angular/core';
2022-08-28 13:43:57 +02:00
import { Routes, RouterModule } from '@angular/router';
import { AppPreloadingStrategy } from './app.preloading-strategy'
import { BlockViewComponent } from './components/block-view/block-view.component';
2023-09-28 15:48:37 +01:00
import { EightBlocksComponent } from './components/eight-blocks/eight-blocks.component';
import { MempoolBlockViewComponent } from './components/mempool-block-view/mempool-block-view.component';
import { ClockComponent } from './components/clock/clock.component';
2020-07-02 17:56:15 +07:00
import { StatusViewComponent } from './components/status-view/status-view.component';
2019-07-21 17:59:47 +03:00
const browserWindow = window || {};
// @ts-ignore
const browserWindowEnv = browserWindow.__env || {};
let routes: Routes = [
2022-07-12 22:04:20 +00:00
{
path: 'testnet',
2019-07-27 18:43:17 +03:00
children: [
2021-10-19 15:37:45 +04:00
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
2022-08-28 13:43:57 +02:00
data: { preload: true },
2021-10-19 15:37:45 +04:00
},
2019-07-27 18:43:17 +03:00
{
path: '',
loadChildren: () => import('./master-page.module').then(m => m.MasterPageModule),
data: { preload: true },
2021-02-20 23:12:22 +07:00
},
{
path: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid'] },
2021-02-20 23:12:22 +07:00
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
data: { preload: true },
},
2021-02-20 23:12:22 +07:00
{
path: '**',
redirectTo: '/testnet'
2021-02-20 23:12:22 +07:00
},
]
},
{
path: 'signet',
children: [
{
path: 'mining/blocks',
redirectTo: 'blocks',
pathMatch: 'full'
},
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
data: { preload: true },
},
{
path: '',
loadChildren: () => import('./master-page.module').then(m => m.MasterPageModule),
data: { preload: true },
},
{
2020-07-02 22:34:16 +07:00
path: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid'] },
2020-07-02 22:34:16 +07:00
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
data: { preload: true },
},
{
path: '**',
redirectTo: '/signet'
},
2020-07-02 22:34:16 +07:00
]
},
2019-07-21 17:59:47 +03:00
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
data: { preload: true },
2022-04-05 21:00:36 +04:00
},
2019-07-21 17:59:47 +03:00
{
path: '',
loadChildren: () => import('./master-page.module').then(m => m.MasterPageModule),
data: { preload: true },
},
2022-07-12 22:04:20 +00:00
{
path: 'preview',
children: [
{
path: '',
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
2022-08-11 17:19:12 +00:00
},
{
path: 'testnet',
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
2022-08-11 17:19:12 +00:00
},
{
path: 'signet',
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
2022-08-11 17:19:12 +00:00
},
2022-07-12 22:04:20 +00:00
],
},
2023-04-15 05:26:18 +09:00
{
path: 'clock',
2023-06-14 21:53:51 +02:00
redirectTo: 'clock/mempool/0'
2023-04-15 05:26:18 +09:00
},
{
path: 'clock/:mode',
redirectTo: 'clock/:mode/0'
},
{
path: 'clock/:mode/:index',
component: ClockComponent,
2023-04-15 05:26:18 +09:00
},
{
path: 'view/block/:id',
component: BlockViewComponent,
},
{
path: 'view/mempool-block/:index',
component: MempoolBlockViewComponent,
},
2023-09-28 15:48:37 +01:00
{
path: 'eight-blocks',
component: EightBlocksComponent,
},
{
path: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid'] },
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./bitcoin-graphs.module').then(m => m.BitcoinGraphsModule),
data: { preload: true },
},
{
path: '**',
redirectTo: ''
},
];
if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'bisq') {
routes = [{
path: '',
loadChildren: () => import('./bisq/bisq.module').then(m => m.BisqModule)
}];
}
if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') {
routes = [
{
path: 'testnet',
children: [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./liquid/liquid-graphs.module').then(m => m.LiquidGraphsModule),
data: { preload: true },
},
{
path: '',
loadChildren: () => import ('./liquid/liquid-master-page.module').then(m => m.LiquidMasterPageModule),
data: { preload: true },
},
{
path: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid'] },
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./liquid/liquid-graphs.module').then(m => m.LiquidGraphsModule),
data: { preload: true },
},
{
path: '**',
redirectTo: '/signet'
},
]
},
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./liquid/liquid-graphs.module').then(m => m.LiquidGraphsModule),
data: { preload: true },
},
{
path: '',
loadChildren: () => import ('./liquid/liquid-master-page.module').then(m => m.LiquidMasterPageModule),
data: { preload: true },
},
{
path: 'preview',
children: [
{
path: '',
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
2022-08-15 23:14:34 +00:00
},
{
path: 'testnet',
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
2022-08-15 23:14:34 +00:00
},
],
},
{
path: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid']},
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./liquid/liquid-graphs.module').then(m => m.LiquidGraphsModule),
data: { preload: true },
},
{
path: '**',
redirectTo: ''
},
];
}
2019-07-21 17:59:47 +03:00
@NgModule({
2020-11-07 04:30:52 +07:00
imports: [RouterModule.forRoot(routes, {
2022-11-28 11:55:23 +09:00
initialNavigation: 'enabledBlocking',
scrollPositionRestoration: 'enabled',
2022-05-20 15:08:45 +04:00
anchorScrolling: 'enabled',
2022-08-28 13:43:57 +02:00
preloadingStrategy: AppPreloadingStrategy
})],
2019-07-21 17:59:47 +03:00
})
export class AppRoutingModule { }