mirror of
https://github.com/Eugeny/tabby.git
synced 2025-01-05 09:34:56 +03:00
angular 9 fixes
This commit is contained in:
parent
092820173f
commit
df2f4d4a6c
@ -1,6 +1,6 @@
|
|||||||
import colors from 'ansi-colors'
|
import colors from 'ansi-colors'
|
||||||
import { Spinner } from 'cli-spinner'
|
import { Spinner } from 'cli-spinner'
|
||||||
import { Component } from '@angular/core'
|
import { Component, Injector } from '@angular/core'
|
||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { BaseTerminalTabComponent } from 'terminus-terminal'
|
import { BaseTerminalTabComponent } from 'terminus-terminal'
|
||||||
import { SerialService } from '../services/serial.service'
|
import { SerialService } from '../services/serial.service'
|
||||||
@ -16,14 +16,19 @@ import { Subscription } from 'rxjs'
|
|||||||
})
|
})
|
||||||
export class SerialTabComponent extends BaseTerminalTabComponent {
|
export class SerialTabComponent extends BaseTerminalTabComponent {
|
||||||
connection: SerialConnection
|
connection: SerialConnection
|
||||||
serial: SerialService
|
|
||||||
session: SerialSession
|
session: SerialSession
|
||||||
serialPort: any
|
serialPort: any
|
||||||
private homeEndSubscription: Subscription
|
private homeEndSubscription: Subscription
|
||||||
|
|
||||||
|
constructor (
|
||||||
|
injector: Injector,
|
||||||
|
private serial: SerialService,
|
||||||
|
) {
|
||||||
|
super(injector)
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.logger = this.log.create('terminalTab')
|
this.logger = this.log.create('terminalTab')
|
||||||
this.serial = this.injector.get(SerialService)
|
|
||||||
|
|
||||||
this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
||||||
if (!this.hasFocus) {
|
if (!this.hasFocus) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import colors from 'ansi-colors'
|
import colors from 'ansi-colors'
|
||||||
import { Spinner } from 'cli-spinner'
|
import { Spinner } from 'cli-spinner'
|
||||||
import { Component } from '@angular/core'
|
import { Component, Injector } from '@angular/core'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { BaseTerminalTabComponent } from 'terminus-terminal'
|
import { BaseTerminalTabComponent } from 'terminus-terminal'
|
||||||
@ -18,16 +18,19 @@ import { Subscription } from 'rxjs'
|
|||||||
})
|
})
|
||||||
export class SSHTabComponent extends BaseTerminalTabComponent {
|
export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||||
connection: SSHConnection
|
connection: SSHConnection
|
||||||
ssh: SSHService
|
|
||||||
session: SSHSession
|
session: SSHSession
|
||||||
private ngbModal: NgbModal
|
|
||||||
private homeEndSubscription: Subscription
|
private homeEndSubscription: Subscription
|
||||||
|
|
||||||
ngOnInit () {
|
constructor (
|
||||||
this.ngbModal = this.injector.get<NgbModal>(NgbModal)
|
injector: Injector,
|
||||||
|
public ssh: SSHService,
|
||||||
|
private ngbModal: NgbModal,
|
||||||
|
) {
|
||||||
|
super(injector)
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit () {
|
||||||
this.logger = this.log.create('terminalTab')
|
this.logger = this.log.create('terminalTab')
|
||||||
this.ssh = this.injector.get(SSHService)
|
|
||||||
|
|
||||||
this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
||||||
if (!this.hasFocus) {
|
if (!this.hasFocus) {
|
||||||
|
@ -2,7 +2,7 @@ import { Observable, Subject, Subscription } from 'rxjs'
|
|||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { ToastrService } from 'ngx-toastr'
|
import { ToastrService } from 'ngx-toastr'
|
||||||
import colors from 'ansi-colors'
|
import colors from 'ansi-colors'
|
||||||
import { NgZone, OnInit, OnDestroy, Inject, Injector, Optional, ViewChild, HostBinding, Input, ElementRef } from '@angular/core'
|
import { NgZone, OnInit, OnDestroy, Injector, ViewChild, HostBinding, Input, ElementRef, InjectFlags } from '@angular/core'
|
||||||
import { trigger, transition, style, animate, AnimationTriggerMetadata } from '@angular/animations'
|
import { trigger, transition, style, animate, AnimationTriggerMetadata } from '@angular/animations'
|
||||||
import { AppService, ConfigService, BaseTabComponent, ElectronService, HostAppService, HotkeysService, Platform, LogService, Logger, TabContextMenuItemProvider } from 'terminus-core'
|
import { AppService, ConfigService, BaseTabComponent, ElectronService, HostAppService, HotkeysService, Platform, LogService, Logger, TabContextMenuItemProvider } from 'terminus-core'
|
||||||
|
|
||||||
@ -63,6 +63,22 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
*/
|
*/
|
||||||
enablePassthrough = true
|
enablePassthrough = true
|
||||||
|
|
||||||
|
// Deps start
|
||||||
|
config: ConfigService
|
||||||
|
element: ElementRef
|
||||||
|
protected zone: NgZone
|
||||||
|
protected app: AppService
|
||||||
|
protected hostApp: HostAppService
|
||||||
|
protected hotkeys: HotkeysService
|
||||||
|
protected sessions: SessionsService
|
||||||
|
protected electron: ElectronService
|
||||||
|
protected terminalContainersService: TerminalFrontendService
|
||||||
|
protected toastr: ToastrServiceProxy
|
||||||
|
protected log: LogService
|
||||||
|
protected decorators: TerminalDecorator[]
|
||||||
|
protected contextMenuProviders: TabContextMenuItemProvider[]
|
||||||
|
// Deps end
|
||||||
|
|
||||||
protected logger: Logger
|
protected logger: Logger
|
||||||
protected output = new Subject<string>()
|
protected output = new Subject<string>()
|
||||||
private sessionCloseSubscription: Subscription
|
private sessionCloseSubscription: Subscription
|
||||||
@ -76,24 +92,24 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
get alternateScreenActive$ (): Observable<boolean> { return this.frontend.alternateScreenActive$ }
|
get alternateScreenActive$ (): Observable<boolean> { return this.frontend.alternateScreenActive$ }
|
||||||
get frontendReady$ (): Observable<void> { return this.frontendReady }
|
get frontendReady$ (): Observable<void> { return this.frontendReady }
|
||||||
|
|
||||||
constructor (
|
constructor (protected injector: Injector) {
|
||||||
public config: ConfigService,
|
|
||||||
public element: ElementRef,
|
|
||||||
protected injector: Injector,
|
|
||||||
protected zone: NgZone,
|
|
||||||
protected app: AppService,
|
|
||||||
protected hostApp: HostAppService,
|
|
||||||
protected hotkeys: HotkeysService,
|
|
||||||
protected sessions: SessionsService,
|
|
||||||
protected electron: ElectronService,
|
|
||||||
protected terminalContainersService: TerminalFrontendService,
|
|
||||||
@Inject(ToastrService) protected toastr: ToastrServiceProxy,
|
|
||||||
protected log: LogService,
|
|
||||||
@Optional() @Inject(TerminalDecorator) protected decorators: TerminalDecorator[],
|
|
||||||
@Optional() @Inject(TabContextMenuItemProvider) protected contextMenuProviders: TabContextMenuItemProvider[],
|
|
||||||
) {
|
|
||||||
super()
|
super()
|
||||||
this.logger = log.create('baseTerminalTab')
|
|
||||||
|
this.config = injector.get(ConfigService)
|
||||||
|
this.element = injector.get(ElementRef)
|
||||||
|
this.zone = injector.get(NgZone)
|
||||||
|
this.app = injector.get(AppService)
|
||||||
|
this.hostApp = injector.get(HostAppService)
|
||||||
|
this.hotkeys = injector.get(HotkeysService)
|
||||||
|
this.sessions = injector.get(SessionsService)
|
||||||
|
this.electron = injector.get(ElectronService)
|
||||||
|
this.terminalContainersService = injector.get(TerminalFrontendService)
|
||||||
|
this.toastr = injector.get(ToastrService)
|
||||||
|
this.log = injector.get(LogService)
|
||||||
|
this.decorators = injector.get<any>(TerminalDecorator, null, InjectFlags.Optional) as TerminalDecorator[]
|
||||||
|
this.contextMenuProviders = injector.get<any>(TabContextMenuItemProvider, null, InjectFlags.Optional) as TabContextMenuItemProvider[]
|
||||||
|
|
||||||
|
this.logger = this.log.create('baseTerminalTab')
|
||||||
this.decorators = this.decorators || []
|
this.decorators = this.decorators || []
|
||||||
this.setTitle('Terminal')
|
this.setTitle('Terminal')
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input, Injector } from '@angular/core'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { BaseTabProcess, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'terminus-core'
|
import { BaseTabProcess, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'terminus-core'
|
||||||
@ -17,6 +17,13 @@ export class TerminalTabComponent extends BaseTerminalTabComponent {
|
|||||||
@Input() sessionOptions: SessionOptions
|
@Input() sessionOptions: SessionOptions
|
||||||
private homeEndSubscription: Subscription
|
private homeEndSubscription: Subscription
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
||||||
|
constructor (
|
||||||
|
injector: Injector,
|
||||||
|
) {
|
||||||
|
super(injector)
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.logger = this.log.create('terminalTab')
|
this.logger = this.log.create('terminalTab')
|
||||||
this.session = new Session(this.config)
|
this.session = new Session(this.config)
|
||||||
|
Loading…
Reference in New Issue
Block a user