1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {Component, HostListener, OnInit} from '@angular/core';
import {DataStore, User} from '@app/globals';
import {environment} from '@src/environments/environment';
import {ViewService} from '@app/services';
@Component({
selector: 'pages-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css'],
})
export class PageMainComponent implements OnInit {
User = User;
store = DataStore;
constructor(public viewSrv: ViewService) {}
get currentView() {
return this.viewSrv.currentView;
}
get showSplitter() {
if (this.currentView && this.currentView.type !== 'ssh') {
return false;
}
return this.store.showLeftBar;
}
ngOnInit(): void {
}
dragSplitBtn(evt) {
window.dispatchEvent(new Event('resize'));
}
@HostListener('window:beforeunload', ['$event'])
unloadNotification($event: any) {
const notInIframe = window.self === window.top;
const notInReplay = location.pathname.indexOf('/luna/replay') === -1;
return !(environment.production && notInIframe && notInReplay);
}
}