Force disable mining dashboard if base_module not mempool
This commit is contained in:
		
							parent
							
								
									32f3acd2f0
								
							
						
					
					
						commit
						71648bf01e
					
				@ -4,7 +4,7 @@
 | 
			
		||||
      <div class="card mb-3">
 | 
			
		||||
        <div class="card-header">
 | 
			
		||||
          <i class="fa fa-area-chart"></i> <span i18n="statistics.memory-by-vBytes">Mempool by vBytes (sat/vByte)</span>
 | 
			
		||||
          <form [formGroup]="radioGroupForm" class="formRadioGroup" (click)="saveGraphPreference()">
 | 
			
		||||
          <form [formGroup]="radioGroupForm" class="formRadioGroup" [class]="stateService.env.MINING_DASHBOARD ? 'mining' : ''" (click)="saveGraphPreference()">
 | 
			
		||||
            <div class="btn-group btn-group-toggle" ngbRadioGroup name="radioBasic" formControlName="dateSpan">
 | 
			
		||||
              <label ngbButtonLabel class="btn-primary btn-sm">
 | 
			
		||||
                <input ngbButton type="radio" [value]="'2h'" [routerLink]="['/graphs' | relativeUrl]" fragment="2h"> 2H (LIVE)
 | 
			
		||||
 | 
			
		||||
@ -40,14 +40,6 @@
 | 
			
		||||
  margin-top: 6px;
 | 
			
		||||
  display: flex;
 | 
			
		||||
  flex-direction: column;
 | 
			
		||||
  @media (min-width: 1130px) {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    top: -65px;
 | 
			
		||||
  }
 | 
			
		||||
  @media (min-width: 830px) and (max-width: 1130px) {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    top: 0px;
 | 
			
		||||
  }
 | 
			
		||||
  @media (min-width: 830px) {
 | 
			
		||||
    flex-direction: row;
 | 
			
		||||
    float: right;
 | 
			
		||||
@ -60,6 +52,16 @@
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.formRadioGroup.mining {
 | 
			
		||||
  @media (min-width: 1130px) {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    top: -65px;
 | 
			
		||||
  }
 | 
			
		||||
  @media (min-width: 830px) and (max-width: 1130px) {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    top: 0px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.loading{
 | 
			
		||||
  display: flex;
 | 
			
		||||
 | 
			
		||||
@ -45,7 +45,7 @@ export class StatisticsComponent implements OnInit {
 | 
			
		||||
    private route: ActivatedRoute,
 | 
			
		||||
    private websocketService: WebsocketService,
 | 
			
		||||
    private apiService: ApiService,
 | 
			
		||||
    private stateService: StateService,
 | 
			
		||||
    public stateService: StateService,
 | 
			
		||||
    private seoService: SeoService,
 | 
			
		||||
    private storageService: StorageService,
 | 
			
		||||
  ) { }
 | 
			
		||||
 | 
			
		||||
@ -111,6 +111,10 @@ export class StateService {
 | 
			
		||||
    const browserWindowEnv = browserWindow.__env || {};
 | 
			
		||||
    this.env = Object.assign(defaultEnv, browserWindowEnv);
 | 
			
		||||
 | 
			
		||||
    if (defaultEnv.BASE_MODULE !== 'mempool') {
 | 
			
		||||
      this.env.MINING_DASHBOARD = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (this.isBrowser) {
 | 
			
		||||
      this.setNetworkBasedonUrl(window.location.pathname);
 | 
			
		||||
      this.isTabHidden$ = fromEvent(document, 'visibilitychange').pipe(map(() => this.isHidden()), shareReplay());
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user