more platform changes

This commit is contained in:
Eugene Pankov
2021-06-03 19:07:48 +02:00
parent faa9a1269c
commit c0bd008f40
36 changed files with 318 additions and 165 deletions

View File

@@ -4,7 +4,7 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { Observable } from 'rxjs'
import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators'
import { ElectronService, HostAppService, ConfigService } from 'terminus-core'
import { ElectronService, HostAppService, ConfigService, PlatformService } from 'terminus-core'
import { PasswordStorageService } from '../services/passwordStorage.service'
import { SSHConnection, LoginScript, ForwardedPortConfig, SSHAlgorithmType, ALGORITHM_BLACKLIST } from '../api'
import { PromptModalComponent } from './promptModal.component'
@@ -29,6 +29,7 @@ export class EditConnectionModalComponent {
public config: ConfigService,
private modalInstance: NgbActiveModal,
private electron: ElectronService,
private platform: PlatformService,
private hostApp: HostAppService,
private passwordStorage: PasswordStorageService,
private ngbModal: NgbModal,
@@ -153,8 +154,7 @@ export class EditConnectionModalComponent {
}
async deleteScript (script: LoginScript) {
if (this.connection.scripts && (await this.electron.showMessageBox(
this.hostApp.getWindow(),
if (this.connection.scripts && (await this.platform.showMessageBox(
{
type: 'warning',
message: 'Delete this script?',

View File

@@ -2,7 +2,7 @@
import deepClone from 'clone-deep'
import { Component } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { ConfigService, ElectronService, HostAppService, Platform } from 'terminus-core'
import { ConfigService, HostAppService, Platform, PlatformService } from 'terminus-core'
import { PasswordStorageService } from '../services/passwordStorage.service'
import { SSHConnection } from '../api'
import { EditConnectionModalComponent } from './editConnectionModal.component'
@@ -28,7 +28,7 @@ export class SSHSettingsTabComponent {
constructor (
public config: ConfigService,
public hostApp: HostAppService,
private electron: ElectronService,
private platform: PlatformService,
private ngbModal: NgbModal,
private passwordStorage: PasswordStorageService,
) {
@@ -81,8 +81,7 @@ export class SSHSettingsTabComponent {
}
async deleteConnection (connection: SSHConnection) {
if ((await this.electron.showMessageBox(
this.hostApp.getWindow(),
if ((await this.platform.showMessageBox(
{
type: 'warning',
message: `Delete "${connection.name}"?`,
@@ -115,8 +114,7 @@ export class SSHSettingsTabComponent {
}
async deleteGroup (group: SSHConnectionGroup) {
if ((await this.electron.showMessageBox(
this.hostApp.getWindow(),
if ((await this.platform.showMessageBox(
{
type: 'warning',
message: `Delete "${group.name}"?`,

View File

@@ -210,8 +210,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
if (!(this.connection?.warnOnClose ?? this.config.store.ssh.warnOnClose)) {
return true
}
return (await this.electron.showMessageBox(
this.hostApp.getWindow(),
return (await this.platform.showMessageBox(
{
type: 'warning',
message: `Disconnect from ${this.connection?.host}?`,