Re-define sub mining routes properly and use router outlet

This commit is contained in:
nymkappa 2022-02-18 15:26:15 +09:00
parent 50f86ba152
commit 38b37a3ee7
No known key found for this signature in database
GPG key ID: E155910B16E8BD04
7 changed files with 124 additions and 30 deletions

View file

@ -29,6 +29,8 @@ import { AssetsComponent } from './components/assets/assets.component';
import { PoolComponent } from './components/pool/pool.component';
import { MiningDashboardComponent } from './components/mining-dashboard/mining-dashboard.component';
import { DifficultyChartComponent } from './components/difficulty-chart/difficulty-chart.component';
import { HashrateChartComponent } from './components/hashrate-chart/hashrate-chart.component';
import { MiningStartComponent } from './components/mining-start/mining-start.component';
let routes: Routes = [
{
@ -70,16 +72,35 @@ let routes: Routes = [
component: LatestBlocksComponent,
},
{
path: 'mining/difficulty',
component: DifficultyChartComponent,
},
{
path: 'mining/pools',
component: PoolRankingComponent,
},
{
path: 'mining/pool/:poolId',
component: PoolComponent,
path: 'mining',
component: MiningStartComponent,
children: [
{
path: 'difficulty',
component: DifficultyChartComponent,
},
{
path: 'hashrate',
component: HashrateChartComponent,
},
{
path: 'pools',
component: PoolRankingComponent,
},
{
path: 'pool',
children: [
{
path: ':poolId',
component: PoolComponent,
},
{
path: ':poolId/hashrate',
component: HashrateChartComponent,
},
]
},
]
},
{
path: 'graphs',
@ -170,16 +191,35 @@ let routes: Routes = [
component: LatestBlocksComponent,
},
{
path: 'mining/difficulty',
component: DifficultyChartComponent,
},
{
path: 'mining/pools',
component: PoolRankingComponent,
},
{
path: 'mining/pool/:poolId',
component: PoolComponent,
path: 'mining',
component: MiningStartComponent,
children: [
{
path: 'difficulty',
component: DifficultyChartComponent,
},
{
path: 'hashrate',
component: HashrateChartComponent,
},
{
path: 'pools',
component: PoolRankingComponent,
},
{
path: 'pool',
children: [
{
path: ':poolId',
component: PoolComponent,
},
{
path: ':poolId/hashrate',
component: HashrateChartComponent,
},
]
},
]
},
{
path: 'graphs',
@ -264,16 +304,35 @@ let routes: Routes = [
component: LatestBlocksComponent,
},
{
path: 'mining/difficulty',
component: DifficultyChartComponent,
},
{
path: 'mining/pools',
component: PoolRankingComponent,
},
{
path: 'mining/pool/:poolId',
component: PoolComponent,
path: 'mining',
component: MiningStartComponent,
children: [
{
path: 'difficulty',
component: DifficultyChartComponent,
},
{
path: 'hashrate',
component: HashrateChartComponent,
},
{
path: 'pools',
component: PoolRankingComponent,
},
{
path: 'pool',
children: [
{
path: ':poolId',
component: PoolComponent,
},
{
path: ':poolId/hashrate',
component: HashrateChartComponent,
},
]
},
]
},
{
path: 'graphs',

View file

@ -71,6 +71,8 @@ import { AssetGroupComponent } from './components/assets/asset-group/asset-group
import { AssetCirculationComponent } from './components/asset-circulation/asset-circulation.component';
import { MiningDashboardComponent } from './components/mining-dashboard/mining-dashboard.component';
import { DifficultyChartComponent } from './components/difficulty-chart/difficulty-chart.component';
import { HashrateChartComponent } from './components/hashrate-chart/hashrate-chart.component';
import { MiningStartComponent } from './components/mining-start/mining-start.component';
@NgModule({
declarations: [
@ -124,6 +126,8 @@ import { DifficultyChartComponent } from './components/difficulty-chart/difficul
AssetCirculationComponent,
MiningDashboardComponent,
DifficultyChartComponent,
HashrateChartComponent,
MiningStartComponent,
],
imports: [
BrowserModule.withServerTransition({ appId: 'serverApp' }),

View file

@ -0,0 +1 @@
<p>hashrate-chart works!</p>

View file

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-hashrate-chart',
templateUrl: './hashrate-chart.component.html',
styleUrls: ['./hashrate-chart.component.scss']
})
export class HashrateChartComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View file

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

View file

@ -0,0 +1,14 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-mining-start',
templateUrl: './mining-start.component.html',
})
export class MiningStartComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}