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

672 lines
17 KiB
TypeScript
Raw Normal View History

2019-07-21 17:59:47 +03:00
import { NgModule } from '@angular/core';
2022-05-20 15:08:45 +04:00
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { StartComponent } from './components/start/start.component';
import { TransactionComponent } from './components/transaction/transaction.component';
import { BlockComponent } from './components/block/block.component';
import { BlockAuditComponent } from './components/block-audit/block-audit.component';
2022-07-12 22:04:20 +00:00
import { BlockPreviewComponent } from './components/block/block-preview.component';
import { AddressComponent } from './components/address/address.component';
2022-07-27 18:13:37 +00:00
import { AddressPreviewComponent } from './components/address/address-preview.component';
import { MasterPageComponent } from './components/master-page/master-page.component';
2022-07-12 22:04:20 +00:00
import { MasterPagePreviewComponent } from './components/master-page-preview/master-page-preview.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';
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
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('./graphs/graphs.module').then(m => m.GraphsModule)
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
},
{
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: {
ogImage: true
}
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,
children: [
{
path: ':id',
2021-02-20 23:12:22 +07:00
component: TransactionComponent
},
],
},
{
path: 'block',
component: StartComponent,
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: 'block-audit',
children: [
{
path: ':id',
component: BlockAuditComponent,
},
],
},
{
path: 'docs',
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
},
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',
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule)
},
2021-02-20 23:12:22 +07:00
],
},
{
path: 'status',
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,
},
{
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: {
ogImage: true
}
},
{
path: 'tx',
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'block-audit',
children: [
{
path: ':id',
component: BlockAuditComponent,
},
],
},
{
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',
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule)
},
],
},
{
2020-07-02 22:34:16 +07:00
path: 'status',
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,
},
{
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: {
ogImage: true
}
},
{
path: 'tx',
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'block-audit',
children: [
{
path: ':id',
component: BlockAuditComponent
},
],
},
{
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',
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule)
},
],
},
2022-07-12 22:04:20 +00:00
{
path: 'preview',
component: MasterPagePreviewComponent,
children: [
{
path: 'block/:id',
component: BlockPreviewComponent
},
{
path: 'testnet/block/:id',
component: BlockPreviewComponent
},
{
path: 'signet/block/:id',
component: BlockPreviewComponent
},
2022-07-27 18:13:37 +00:00
{
path: 'address/:id',
children: [],
component: AddressPreviewComponent
},
{
path: 'testnet/address/:id',
children: [],
component: AddressPreviewComponent
},
{
path: 'signet/address/:id',
children: [],
component: AddressPreviewComponent
},
2022-08-11 17:19:12 +00:00
{
path: 'lightning',
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
},
{
path: 'testnet/lightning',
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
},
{
path: 'signet/lightning',
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
},
2022-07-12 22:04:20 +00:00
],
},
{
path: 'status',
component: StatusViewComponent
},
{
path: '',
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
},
{
path: '**',
redirectTo: ''
},
];
const browserWindow = window || {};
// @ts-ignore
const browserWindowEnv = browserWindow.__env || {};
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: {
ogImage: true
}
},
{
path: 'tx',
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'assets',
component: AssetsNavComponent,
children: [
{
path: 'all',
component: AssetsComponent,
},
{
path: 'asset/:id',
component: AssetComponent
},
{
path: 'group/:id',
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',
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: {
ogImage: true
}
},
{
path: 'tx',
component: StartComponent,
children: [
{
path: ':id',
component: TransactionComponent
},
],
},
{
path: 'block',
component: StartComponent,
children: [
{
path: ':id',
component: BlockComponent,
data: {
ogImage: true
}
},
],
},
{
path: 'assets',
component: AssetsNavComponent,
children: [
{
path: 'featured',
component: AssetsFeaturedComponent,
},
{
path: 'all',
component: AssetsComponent,
},
{
path: 'asset/:id',
component: AssetComponent
},
{
path: 'group/:id',
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',
component: MasterPagePreviewComponent,
children: [
{
path: 'block/:id',
component: BlockPreviewComponent
},
{
path: 'testnet/block/:id',
component: BlockPreviewComponent
},
2022-07-27 18:13:37 +00:00
{
path: 'address/:id',
children: [],
component: AddressPreviewComponent
},
{
path: 'testnet/address/:id',
children: [],
component: AddressPreviewComponent
},
],
},
{
path: 'status',
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-07-08 16:45:24 +02:00
initialNavigation: 'enabled',
scrollPositionRestoration: 'enabled',
2022-05-20 15:08:45 +04:00
anchorScrolling: 'enabled',
preloadingStrategy: PreloadAllModules
})],
2019-07-21 17:59:47 +03:00
})
export class AppRoutingModule { }