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

663 lines
18 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 { StartComponent } from './components/start/start.component';
import { TransactionComponent } from './components/transaction/transaction.component';
import { BlockComponent } from './components/block/block.component';
import { ClockComponent } from './components/clock/clock.component';
import { AddressComponent } from './components/address/address.component';
import { MasterPageComponent } from './components/master-page/master-page.component';
import { AboutComponent } from './components/about/about.component';
2020-07-02 17:56:15 +07:00
import { StatusViewComponent } from './components/status-view/status-view.component';
2020-10-11 19:23:52 +09:00
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component';
import { TrademarkPolicyComponent } from './components/trademark-policy/trademark-policy.component';
import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component';
2021-10-19 15:37:45 +04:00
import { PushTransactionComponent } from './components/push-transaction/push-transaction.component';
import { BlocksList } from './components/blocks-list/blocks-list.component';
2022-12-14 16:51:53 -06:00
import { RbfList } from './components/rbf-list/rbf-list.component';
import { LiquidMasterPageComponent } from './components/liquid-master-page/liquid-master-page.component';
2022-02-06 01:20:26 +04:00
import { AssetGroupComponent } from './components/assets/asset-group/asset-group.component';
import { AssetsFeaturedComponent } from './components/assets/assets-featured/assets-featured.component';
import { AssetsComponent } from './components/assets/assets.component';
import { AssetComponent } from './components/asset/asset.component';
import { AssetsNavComponent } from './components/assets/assets-nav/assets-nav.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',
2022-08-28 13:43:57 +02:00
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule),
data: { preload: true },
2021-10-19 15:37:45 +04:00
},
2019-07-27 18:43:17 +03:00
{
path: '',
component: MasterPageComponent,
children: [
{
path: 'mining/blocks',
redirectTo: 'blocks',
pathMatch: 'full'
},
{
path: 'tx/push',
component: PushTransactionComponent,
},
{
path: 'about',
component: AboutComponent,
},
2022-04-09 01:07:13 +09:00
{
path: 'blocks',
component: BlocksList,
2022-04-11 20:57:13 +09:00
},
2022-12-14 16:51:53 -06:00
{
path: 'rbf',
component: RbfList,
},
2022-04-11 20:57:13 +09:00
{
path: 'terms-of-service',
component: TermsOfServiceComponent
2022-04-15 00:21:38 +09:00
},
{
path: 'privacy-policy',
component: PrivacyPolicyComponent
2022-04-15 00:21:38 +09:00
},
2022-05-10 16:40:56 +02:00
{
path: 'trademark-policy',
component: TrademarkPolicyComponent
2022-05-10 16:40:56 +02:00
},
2021-10-19 15:37:45 +04:00
{
path: 'address/:id',
children: [],
2022-07-27 18:13:37 +00:00
component: AddressComponent,
data: {
2022-10-12 22:13:29 +00:00
ogImage: true,
networkSpecific: true,
2022-07-27 18:13:37 +00:00
}
2021-10-19 15:37:45 +04:00
},
2021-02-20 23:12:22 +07:00
{
path: 'tx',
2021-02-20 23:12:22 +07:00
component: StartComponent,
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
2021-02-20 23:12:22 +07:00
children: [
{
path: ':id',
2021-02-20 23:12:22 +07:00
component: TransactionComponent
},
],
},
{
path: 'block',
component: StartComponent,
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
children: [
2022-05-10 16:40:56 +02:00
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
2022-05-10 16:40:56 +02:00
},
],
2021-02-20 23:12:22 +07:00
},
{
path: 'docs',
2022-08-28 20:06:15 +02:00
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule),
data: { preload: true },
},
2021-02-20 23:12:22 +07:00
{
path: 'api',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
2021-02-20 23:12:22 +07:00
},
{
path: 'lightning',
2022-08-28 13:43:57 +02:00
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule),
2022-10-12 22:13:29 +00:00
data: { preload: browserWindowEnv && browserWindowEnv.LIGHTNING === true, networks: ['bitcoin'] },
},
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('./graphs/graphs.module').then(m => m.GraphsModule)
},
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('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '',
2020-07-02 22:34:16 +07:00
component: MasterPageComponent,
children: [
2021-10-19 15:37:45 +04:00
{
path: 'tx/push',
component: PushTransactionComponent,
},
2022-02-16 21:20:28 +09:00
{
path: 'about',
component: AboutComponent,
2022-02-08 18:56:51 +09:00
},
2020-07-02 22:34:16 +07:00
{
path: 'blocks',
component: BlocksList,
},
2022-12-14 16:51:53 -06:00
{
path: 'rbf',
component: RbfList,
},
{
path: 'terms-of-service',
component: TermsOfServiceComponent
},
{
path: 'privacy-policy',
component: PrivacyPolicyComponent
},
{
path: 'trademark-policy',
component: TrademarkPolicyComponent
2020-07-02 22:34:16 +07:00
},
{
path: 'address/:id',
children: [],
2022-07-27 18:13:37 +00:00
component: AddressComponent,
data: {
2022-10-12 22:13:29 +00:00
ogImage: true,
networkSpecific: true,
2022-07-27 18:13:37 +00:00
}
},
{
path: 'tx',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'docs',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
},
2020-10-07 23:24:01 +07:00
{
path: 'api',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
2020-10-07 23:24:01 +07:00
},
{
path: 'lightning',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin'] },
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule)
},
],
},
{
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('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '**',
redirectTo: '/signet'
},
2020-07-02 22:34:16 +07:00
]
},
2019-07-21 17:59:47 +03:00
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
2022-04-05 21:00:36 +04:00
},
2019-07-21 17:59:47 +03:00
{
path: '',
component: MasterPageComponent,
children: [
{
path: 'mining/blocks',
redirectTo: 'blocks',
pathMatch: 'full'
},
{
path: 'tx/push',
component: PushTransactionComponent,
},
{
path: 'about',
component: AboutComponent,
},
{
path: 'blocks',
component: BlocksList,
},
2022-12-14 16:51:53 -06:00
{
path: 'rbf',
component: RbfList,
},
{
path: 'terms-of-service',
component: TermsOfServiceComponent
},
{
path: 'privacy-policy',
component: PrivacyPolicyComponent
},
{
path: 'trademark-policy',
component: TrademarkPolicyComponent
},
{
path: 'address/:id',
children: [],
2022-07-27 18:13:37 +00:00
component: AddressComponent,
data: {
2022-10-12 22:13:29 +00:00
ogImage: true,
networkSpecific: true,
2022-07-27 18:13:37 +00:00
}
},
{
path: 'tx',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'docs',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
2021-07-28 22:32:13 +03:00
},
{
path: 'api',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
2021-07-28 22:32:13 +03:00
},
{
path: 'lightning',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin'] },
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule)
},
],
},
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',
redirectTo: 'clock/mined/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: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid'] },
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '**',
redirectTo: ''
},
];
if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'bisq') {
routes = [{
path: '',
component: BisqMasterPageComponent,
loadChildren: () => import('./bisq/bisq.module').then(m => m.BisqModule)
}];
}
if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') {
routes = [
{
path: 'testnet',
children: [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '',
component: LiquidMasterPageComponent,
children: [
{
path: 'tx/push',
component: PushTransactionComponent,
},
{
path: 'about',
component: AboutComponent,
},
{
path: 'blocks',
component: BlocksList,
},
{
path: 'terms-of-service',
component: TermsOfServiceComponent
},
{
path: 'privacy-policy',
component: PrivacyPolicyComponent
},
{
path: 'trademark-policy',
component: TrademarkPolicyComponent
},
{
path: 'address/:id',
children: [],
2022-07-27 18:13:37 +00:00
component: AddressComponent,
data: {
2022-10-12 22:13:29 +00:00
ogImage: true,
networkSpecific: true,
2022-07-27 18:13:37 +00:00
}
},
{
path: 'tx',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'assets',
2022-10-12 22:13:29 +00:00
data: { networks: ['liquid'] },
component: AssetsNavComponent,
children: [
{
path: 'all',
2022-10-12 22:13:29 +00:00
data: { networks: ['liquid'] },
component: AssetsComponent,
},
{
path: 'asset/:id',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: AssetComponent
},
{
path: 'group/:id',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: AssetGroupComponent
},
{
path: '**',
redirectTo: 'all'
}
]
},
{
path: 'docs',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
},
{
path: 'api',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
},
],
},
{
path: 'status',
2022-10-12 22:13:29 +00:00
data: { networks: ['bitcoin', 'liquid'] },
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '**',
redirectTo: '/signet'
},
]
},
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '',
component: LiquidMasterPageComponent,
children: [
{
path: 'tx/push',
component: PushTransactionComponent,
},
{
path: 'about',
component: AboutComponent,
},
{
path: 'blocks',
component: BlocksList,
},
{
path: 'terms-of-service',
component: TermsOfServiceComponent
},
{
path: 'privacy-policy',
component: PrivacyPolicyComponent
},
{
path: 'trademark-policy',
component: TrademarkPolicyComponent
},
{
path: 'address/:id',
children: [],
2022-07-27 18:13:37 +00:00
component: AddressComponent,
data: {
2022-10-12 22:13:29 +00:00
ogImage: true,
networkSpecific: true,
2022-07-27 18:13:37 +00:00
}
},
{
path: 'tx',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'assets',
2022-10-12 22:13:29 +00:00
data: { networks: ['liquid'] },
component: AssetsNavComponent,
children: [
{
path: 'featured',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: AssetsFeaturedComponent,
},
{
path: 'all',
2022-10-12 22:13:29 +00:00
data: { networks: ['liquid'] },
component: AssetsComponent,
},
{
path: 'asset/:id',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: AssetComponent
},
{
path: 'group/:id',
2022-10-12 22:13:29 +00:00
data: { networkSpecific: true },
component: AssetGroupComponent
},
{
path: '**',
2022-05-20 17:54:06 +04:00
redirectTo: 'featured'
}
]
},
{
path: 'docs',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
},
{
path: 'api',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
},
],
},
{
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('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
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 { }