2020-05-09 20:37:50 +07:00
|
|
|
import { Component, OnInit, HostListener } from '@angular/core';
|
2020-02-16 22:15:07 +07:00
|
|
|
import { StateService } from '../../services/state.service';
|
2020-06-22 22:10:49 +07:00
|
|
|
import { env } from 'src/app/app.constants';
|
2020-02-16 22:15:07 +07:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-master-page',
|
|
|
|
templateUrl: './master-page.component.html',
|
|
|
|
styleUrls: ['./master-page.component.scss']
|
|
|
|
})
|
|
|
|
export class MasterPageComponent implements OnInit {
|
2020-05-09 20:37:50 +07:00
|
|
|
network = '';
|
|
|
|
tvViewRoute = '/tv';
|
2020-06-22 22:10:49 +07:00
|
|
|
env = env;
|
2020-05-02 17:52:26 +07:00
|
|
|
|
2020-02-16 22:15:07 +07:00
|
|
|
navCollapsed = false;
|
2020-03-09 17:53:54 +07:00
|
|
|
connectionState = 2;
|
2020-02-16 22:15:07 +07:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private stateService: StateService,
|
|
|
|
) { }
|
|
|
|
|
|
|
|
ngOnInit() {
|
2020-03-09 17:53:54 +07:00
|
|
|
this.stateService.connectionState$
|
2020-02-16 22:15:07 +07:00
|
|
|
.subscribe((state) => {
|
2020-03-09 17:53:54 +07:00
|
|
|
this.connectionState = state;
|
2020-02-16 22:15:07 +07:00
|
|
|
});
|
2020-05-09 20:37:50 +07:00
|
|
|
|
|
|
|
this.stateService.networkChanged$
|
|
|
|
.subscribe((network) => {
|
|
|
|
this.network = network;
|
|
|
|
});
|
2020-02-16 22:15:07 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
collapse(): void {
|
|
|
|
this.navCollapsed = !this.navCollapsed;
|
|
|
|
}
|
|
|
|
}
|