mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 14:04:56 +00:00
more electron/web separation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HotkeysService, ToolbarButtonProvider, ToolbarButton } from 'terminus-core'
|
||||
import { HotkeysService, ToolbarButtonProvider, ToolbarButton, HostAppService, Platform } from 'terminus-core'
|
||||
import { SSHService } from './services/ssh.service'
|
||||
|
||||
/** @hidden */
|
||||
@@ -8,6 +8,7 @@ import { SSHService } from './services/ssh.service'
|
||||
export class ButtonProvider extends ToolbarButtonProvider {
|
||||
constructor (
|
||||
hotkeys: HotkeysService,
|
||||
private hostApp: HostAppService,
|
||||
private ssh: SSHService,
|
||||
) {
|
||||
super()
|
||||
@@ -23,14 +24,20 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
}
|
||||
|
||||
provide (): ToolbarButton[] {
|
||||
return [{
|
||||
icon: require('./icons/globe.svg'),
|
||||
weight: 5,
|
||||
title: 'SSH connections',
|
||||
touchBarNSImage: 'NSTouchBarOpenInBrowserTemplate',
|
||||
click: () => {
|
||||
this.activate()
|
||||
},
|
||||
}]
|
||||
if (this.hostApp.platform === Platform.Web) {
|
||||
return [{
|
||||
icon: require('../../terminus-local/src/icons/plus.svg'),
|
||||
title: 'SSH connections',
|
||||
click: () => this.activate(),
|
||||
}]
|
||||
} else {
|
||||
return [{
|
||||
icon: require('./icons/globe.svg'),
|
||||
weight: 5,
|
||||
title: 'SSH connections',
|
||||
touchBarNSImage: 'NSTouchBarOpenInBrowserTemplate',
|
||||
click: () => this.activate(),
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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, PlatformService } from 'terminus-core'
|
||||
import { ElectronService, 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'
|
||||
@@ -30,7 +30,6 @@ export class EditConnectionModalComponent {
|
||||
private modalInstance: NgbActiveModal,
|
||||
private electron: ElectronService,
|
||||
private platform: PlatformService,
|
||||
private hostApp: HostAppService,
|
||||
private passwordStorage: PasswordStorageService,
|
||||
private ngbModal: NgbModal,
|
||||
) {
|
||||
@@ -104,7 +103,6 @@ export class EditConnectionModalComponent {
|
||||
|
||||
addPrivateKey () {
|
||||
this.electron.dialog.showOpenDialog(
|
||||
this.hostApp.getWindow(),
|
||||
{
|
||||
defaultPath: this.connection.privateKeys![0],
|
||||
title: 'Select private key',
|
||||
|
Reference in New Issue
Block a user