mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-16 01:19:58 +00:00
Follow the general Terminus style
This commit is contained in:
parent
ce2c72393b
commit
98a7801803
@ -30,27 +30,22 @@ export class SSHSession extends BaseSession {
|
|||||||
let dataString = data.toString()
|
let dataString = data.toString()
|
||||||
this.emitOutput(dataString)
|
this.emitOutput(dataString)
|
||||||
|
|
||||||
if (this.scripts && this.scripts.length > 0)
|
if (this.scripts && this.scripts.length > 0) {
|
||||||
{
|
|
||||||
let found = false
|
let found = false
|
||||||
for (let i = 0; i < this.scripts.length; i++)
|
for (let i = 0; i < this.scripts.length; i++) {
|
||||||
{
|
if (dataString.indexOf(this.scripts[i].expect) >= 0) {
|
||||||
if (dataString.indexOf(this.scripts[i].expect) >= 0)
|
|
||||||
{
|
|
||||||
console.log("Executing: " + this.scripts[i].send)
|
console.log("Executing: " + this.scripts[i].send)
|
||||||
this.shell.write(this.scripts[i].send + "\n")
|
this.shell.write(this.scripts[i].send + "\n")
|
||||||
this.scripts.splice(i, 1)
|
this.scripts.splice(i, 1)
|
||||||
i--
|
i--
|
||||||
found = true
|
found = true
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found)
|
if (found) {
|
||||||
{
|
|
||||||
this.executeScripts()
|
this.executeScripts()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,19 +61,15 @@ export class SSHSession extends BaseSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
executeScripts () {
|
executeScripts () {
|
||||||
if (this.scripts && this.scripts.length > 0)
|
if (this.scripts && this.scripts.length > 0) {
|
||||||
{
|
for (let i = 0; i < this.scripts.length; i++) {
|
||||||
for (let i = 0; i < this.scripts.length; i++)
|
if (!this.scripts[i].expect) {
|
||||||
{
|
|
||||||
if (!this.scripts[i].expect)
|
|
||||||
{
|
|
||||||
console.log("Executing: " + this.scripts[i].send)
|
console.log("Executing: " + this.scripts[i].send)
|
||||||
this.shell.write(this.scripts[i].send + "\n")
|
this.shell.write(this.scripts[i].send + "\n")
|
||||||
this.scripts.splice(i, 1)
|
this.scripts.splice(i, 1)
|
||||||
i--
|
i--
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,7 @@ export class EditConnectionModalComponent {
|
|||||||
|
|
||||||
up (script: LoginScript) {
|
up (script: LoginScript) {
|
||||||
let index = this.connection.scripts.indexOf(script)
|
let index = this.connection.scripts.indexOf(script)
|
||||||
if (index > 0)
|
if (index > 0) {
|
||||||
{
|
|
||||||
this.connection.scripts.splice(index, 1);
|
this.connection.scripts.splice(index, 1);
|
||||||
this.connection.scripts.splice(index - 1, 0, script);
|
this.connection.scripts.splice(index - 1, 0, script);
|
||||||
}
|
}
|
||||||
@ -49,8 +48,7 @@ export class EditConnectionModalComponent {
|
|||||||
|
|
||||||
down (script: LoginScript) {
|
down (script: LoginScript) {
|
||||||
let index = this.connection.scripts.indexOf(script)
|
let index = this.connection.scripts.indexOf(script)
|
||||||
if (index >= 0 && index < this.connection.scripts.length - 1)
|
if (index >= 0 && index < this.connection.scripts.length - 1) {
|
||||||
{
|
|
||||||
this.connection.scripts.splice(index, 1);
|
this.connection.scripts.splice(index, 1);
|
||||||
this.connection.scripts.splice(index + 1, 0, script);
|
this.connection.scripts.splice(index + 1, 0, script);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user