build fixes

This commit is contained in:
Eugene Pankov 2021-05-13 17:00:29 +02:00
parent 76ffef751c
commit 4aafcf82e8
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 14 additions and 19 deletions

View File

@ -92,18 +92,18 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
}
protected attachSessionHandlers () {
this.attachSessionHandler(this.session!.serviceMessage$.subscribe(msg => {
this.attachSessionHandler(this.session!.serviceMessage$, msg => {
this.write(`\r\n${colors.black.bgWhite(' Serial ')} ${msg}\r\n`)
this.session?.resize(this.size.columns, this.size.rows)
}))
this.attachSessionHandler(this.session!.destroyed$.subscribe(() => {
})
this.attachSessionHandler(this.session!.destroyed$, () => {
this.write('Press any key to reconnect\r\n')
this.input$.pipe(first()).subscribe(() => {
if (!this.session?.open) {
this.reconnect()
}
})
}))
})
super.attachSessionHandlers()
}

View File

@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import * as yaml from 'js-yaml'
import { debounce } from 'utils-decorators/dist/cjs'
import { Subscription } from 'rxjs'
import { Component, Inject, Input, HostBinding, NgZone } from '@angular/core'
import {
ElectronService,
@ -33,7 +32,6 @@ export class SettingsTabComponent extends BaseTabComponent {
checkingForUpdate = false
updateAvailable = false
@HostBinding('class.pad-window-controls') padWindowControls = false
private configSubscription: Subscription
constructor (
public config: ConfigService,
@ -58,7 +56,7 @@ export class SettingsTabComponent extends BaseTabComponent {
&& config.store.appearance.tabsLocation !== 'top'
}
this.configSubscription = this.subscribeUntilDestroyed(config.changed$, onConfigChange)
this.subscribeUntilDestroyed(config.changed$, onConfigChange)
onConfigChange()
}
@ -76,7 +74,6 @@ export class SettingsTabComponent extends BaseTabComponent {
}
ngOnDestroy () {
this.configSubscription.unsubscribe()
this.config.save()
}

View File

@ -92,13 +92,11 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
await this.setupOneSession(jumpSession)
this.attachSessionHandler(
jumpSession.destroyed$.subscribe(() => {
if (session.open) {
session.destroy()
}
})
)
this.attachSessionHandler(jumpSession.destroyed$, () => {
if (session.open) {
session.destroy()
}
})
session.jumpStream = await new Promise((resolve, reject) => jumpSession.ssh.forwardOut(
'127.0.0.1', 0, session.connection.host, session.connection.port ?? 22,
@ -122,12 +120,12 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
this.startSpinner()
this.attachSessionHandler(session.serviceMessage$.subscribe(msg => {
this.attachSessionHandler(session.serviceMessage$, msg => {
this.pauseSpinner(() => {
this.write(`\r${colors.black.bgWhite(' SSH ')} ${msg}\r\n`)
session.resize(this.size.columns, this.size.rows)
})
}))
})
try {
await this.ssh.connectSession(session)
@ -141,7 +139,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
protected attachSessionHandlers (): void {
const session = this.session!
this.attachSessionHandler(session.destroyed$.subscribe(() => {
this.attachSessionHandler(session.destroyed$, () => {
if (
// Ctrl-D
this.recentInputs.charCodeAt(this.recentInputs.length - 1) === 4 ||
@ -162,7 +160,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
})
}
}
}))
})
super.attachSessionHandlers()
}