This commit is contained in:
Eugene Pankov
2019-06-14 17:49:42 +02:00
parent 82e3348122
commit a5ecdeb5ea
62 changed files with 271 additions and 280 deletions

View File

@@ -25,14 +25,14 @@ export class SSHSettingsTabComponent {
}
createConnection () {
let connection: SSHConnection = {
const connection: SSHConnection = {
name: '',
host: '',
port: 22,
user: 'root',
}
let modal = this.ngbModal.open(EditConnectionModalComponent)
const modal = this.ngbModal.open(EditConnectionModalComponent)
modal.componentInstance.connection = connection
modal.result.then(result => {
this.connections.push(result)
@@ -43,7 +43,7 @@ export class SSHSettingsTabComponent {
}
editConnection (connection: SSHConnection) {
let modal = this.ngbModal.open(EditConnectionModalComponent)
const modal = this.ngbModal.open(EditConnectionModalComponent)
modal.componentInstance.connection = Object.assign({}, connection)
modal.result.then(result => {
Object.assign(connection, result)
@@ -71,12 +71,12 @@ export class SSHSettingsTabComponent {
}
editGroup (group: ISSHConnectionGroup) {
let modal = this.ngbModal.open(PromptModalComponent)
const modal = this.ngbModal.open(PromptModalComponent)
modal.componentInstance.prompt = 'New group name'
modal.componentInstance.value = group.name
modal.result.then(result => {
if (result) {
for (let connection of this.connections.filter(x => x.group === group.name)) {
for (const connection of this.connections.filter(x => x.group === group.name)) {
connection.group = result
}
this.config.store.ssh.connections = this.connections
@@ -96,7 +96,7 @@ export class SSHSettingsTabComponent {
defaultId: 1,
}
)).response === 1) {
for (let connection of this.connections.filter(x => x.group === group.name)) {
for (const connection of this.connections.filter(x => x.group === group.name)) {
connection.group = null
}
this.config.save()
@@ -108,7 +108,7 @@ export class SSHSettingsTabComponent {
this.connections = this.config.store.ssh.connections
this.childGroups = []
for (let connection of this.connections) {
for (const connection of this.connections) {
connection.group = connection.group || null
let group = this.childGroups.find(x => x.name === connection.group)
if (!group) {