Fixing routes to /tv and /status
This commit is contained in:
		
							parent
							
								
									f5260b72e5
								
							
						
					
					
						commit
						2ebdb27dcb
					
				@ -58,173 +58,133 @@ const routes: Routes = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'liquid',
 | 
			
		||||
    component: MasterPageComponent,
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        path: '',
 | 
			
		||||
        component: StartComponent,
 | 
			
		||||
        component: MasterPageComponent,
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            path: '',
 | 
			
		||||
            component: LatestBlocksComponent
 | 
			
		||||
            component: StartComponent,
 | 
			
		||||
            children: [
 | 
			
		||||
              {
 | 
			
		||||
                path: '',
 | 
			
		||||
                component: LatestBlocksComponent
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                path: 'tx/:id',
 | 
			
		||||
                component: TransactionComponent
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                path: 'block/:id',
 | 
			
		||||
                component: BlockComponent
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                path: 'mempool-block/:id',
 | 
			
		||||
                component: MempoolBlockComponent
 | 
			
		||||
              },
 | 
			
		||||
            ],
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'tx/:id',
 | 
			
		||||
            component: TransactionComponent
 | 
			
		||||
            path: 'graphs',
 | 
			
		||||
            component: StatisticsComponent,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'block/:id',
 | 
			
		||||
            component: BlockComponent
 | 
			
		||||
            path: 'about',
 | 
			
		||||
            component: AboutComponent,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'mempool-block/:id',
 | 
			
		||||
            component: MempoolBlockComponent
 | 
			
		||||
            path: 'address/:id',
 | 
			
		||||
            component: AddressComponent
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'asset/:id',
 | 
			
		||||
            component: AssetComponent
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'assets',
 | 
			
		||||
            component: AssetsComponent,
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'graphs',
 | 
			
		||||
        component: StatisticsComponent,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'tv',
 | 
			
		||||
        component: TelevisionComponent,
 | 
			
		||||
        component: TelevisionComponent
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'about',
 | 
			
		||||
        component: AboutComponent,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'address/:id',
 | 
			
		||||
        children: [],
 | 
			
		||||
        component: AddressComponent
 | 
			
		||||
        path: 'status',
 | 
			
		||||
        component: StatusViewComponent
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: '**',
 | 
			
		||||
        redirectTo: ''
 | 
			
		||||
      },
 | 
			
		||||
    ],
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'liquid',
 | 
			
		||||
    component: MasterPageComponent,
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        path: '',
 | 
			
		||||
        component: StartComponent,
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            path: '',
 | 
			
		||||
            component: LatestBlocksComponent
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'tx/:id',
 | 
			
		||||
            component: TransactionComponent
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'block/:id',
 | 
			
		||||
            component: BlockComponent
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'mempool-block/:id',
 | 
			
		||||
            component: MempoolBlockComponent
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'graphs',
 | 
			
		||||
        component: StatisticsComponent,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'about',
 | 
			
		||||
        component: AboutComponent,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'address/:id',
 | 
			
		||||
        children: [],
 | 
			
		||||
        component: AddressComponent
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'asset/:id',
 | 
			
		||||
        component: AssetComponent
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'assets',
 | 
			
		||||
        component: AssetsComponent,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: '**',
 | 
			
		||||
        redirectTo: ''
 | 
			
		||||
      },
 | 
			
		||||
    ],
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'testnet',
 | 
			
		||||
    component: MasterPageComponent,
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        path: '',
 | 
			
		||||
        component: StartComponent,
 | 
			
		||||
        component: MasterPageComponent,
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            path: '',
 | 
			
		||||
            component: LatestBlocksComponent
 | 
			
		||||
            component: StartComponent,
 | 
			
		||||
            children: [
 | 
			
		||||
              {
 | 
			
		||||
                path: '',
 | 
			
		||||
                component: LatestBlocksComponent
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                path: 'tx/:id',
 | 
			
		||||
                component: TransactionComponent
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                path: 'block/:id',
 | 
			
		||||
                component: BlockComponent
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                path: 'mempool-block/:id',
 | 
			
		||||
                component: MempoolBlockComponent
 | 
			
		||||
              },
 | 
			
		||||
            ],
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'tx/:id',
 | 
			
		||||
            component: TransactionComponent
 | 
			
		||||
            path: 'graphs',
 | 
			
		||||
            component: StatisticsComponent,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'block/:id',
 | 
			
		||||
            component: BlockComponent
 | 
			
		||||
            path: 'about',
 | 
			
		||||
            component: AboutComponent,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            path: 'mempool-block/:id',
 | 
			
		||||
            component: MempoolBlockComponent
 | 
			
		||||
            path: 'address/:id',
 | 
			
		||||
            children: [],
 | 
			
		||||
            component: AddressComponent
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'graphs',
 | 
			
		||||
        component: StatisticsComponent,
 | 
			
		||||
        path: 'tv',
 | 
			
		||||
        component: TelevisionComponent
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'about',
 | 
			
		||||
        component: AboutComponent,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'address/:id',
 | 
			
		||||
        children: [],
 | 
			
		||||
        component: AddressComponent
 | 
			
		||||
        path: 'status',
 | 
			
		||||
        component: StatusViewComponent
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: '**',
 | 
			
		||||
        redirectTo: ''
 | 
			
		||||
      },
 | 
			
		||||
    ],
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'tv',
 | 
			
		||||
    component: TelevisionComponent,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'liquid-tv',
 | 
			
		||||
    component: TelevisionComponent,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'testnet-tv',
 | 
			
		||||
    component: TelevisionComponent,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'status-view',
 | 
			
		||||
    component: StatusViewComponent
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'liquid-status-view',
 | 
			
		||||
    component: StatusViewComponent
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'testnet-status-view',
 | 
			
		||||
    path: 'status',
 | 
			
		||||
    component: StatusViewComponent
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,7 @@
 | 
			
		||||
        <a class="nav-link" [routerLink]="['/graphs' | relativeUrl]" (click)="collapse()">Graphs</a>
 | 
			
		||||
      </li>
 | 
			
		||||
      <li class="nav-item" routerLinkActive="active">
 | 
			
		||||
        <a class="nav-link" [routerLink]="[tvViewRoute]" (click)="collapse()">TV view  <img src="./resources/expand.png" width="15"/></a>
 | 
			
		||||
        <a class="nav-link" [routerLink]="['/tv' | relativeUrl]" (click)="collapse()">TV view  <img src="./resources/expand.png" width="15"/></a>
 | 
			
		||||
      </li>
 | 
			
		||||
      <li *ngIf="network === 'liquid'" class="nav-item" routerLinkActive="active">
 | 
			
		||||
        <a class="nav-link" [routerLink]="['/assets' | relativeUrl]" (click)="collapse()">Assets</a>
 | 
			
		||||
 | 
			
		||||
@ -53,16 +53,12 @@ export class StateService {
 | 
			
		||||
  setNetworkBasedonUrl(url: string) {
 | 
			
		||||
    switch (url.split('/')[1]) {
 | 
			
		||||
      case 'liquid':
 | 
			
		||||
      case 'liquid-tv':
 | 
			
		||||
      case 'liquid-status-view':
 | 
			
		||||
        if (this.network !== 'liquid') {
 | 
			
		||||
          this.network = 'liquid';
 | 
			
		||||
          this.networkChanged$.next('liquid');
 | 
			
		||||
        }
 | 
			
		||||
        return;
 | 
			
		||||
      case 'testnet':
 | 
			
		||||
      case 'testnet-tv':
 | 
			
		||||
      case 'testnet-status-view':
 | 
			
		||||
        if (this.network !== 'testnet') {
 | 
			
		||||
          this.network = 'testnet';
 | 
			
		||||
          this.networkChanged$.next('testnet');
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user