fix bug
Some checks failed
backend / cross (mips64) (push) Failing after 21m30s
backend / cross (mips64el) (push) Failing after 10s
backend / cross (arm) (push) Failing after 1m33s
backend / cross (mipsel) (push) Failing after 31s
backend / cross (s390x) (push) Failing after 32s
backend / cross (armhf) (push) Failing after 1m33s
backend / cross (win32) (push) Failing after 31s
backend / cross (x86_64) (push) Failing after 31s
docker / build (push) Failing after 36s
backend / cross (i686) (push) Failing after 31s
backend / cross (aarch64) (push) Failing after 13m18s
backend / cross (mips) (push) Failing after 22m12s
Some checks failed
backend / cross (mips64) (push) Failing after 21m30s
backend / cross (mips64el) (push) Failing after 10s
backend / cross (arm) (push) Failing after 1m33s
backend / cross (mipsel) (push) Failing after 31s
backend / cross (s390x) (push) Failing after 32s
backend / cross (armhf) (push) Failing after 1m33s
backend / cross (win32) (push) Failing after 31s
backend / cross (x86_64) (push) Failing after 31s
docker / build (push) Failing after 36s
backend / cross (i686) (push) Failing after 31s
backend / cross (aarch64) (push) Failing after 13m18s
backend / cross (mips) (push) Failing after 22m12s
This commit is contained in:
@@ -103,11 +103,12 @@ export class Xterm {
|
|||||||
private closeOnDisconnect = false;
|
private closeOnDisconnect = false;
|
||||||
private intervalID: NodeJS.Timeout;
|
private intervalID: NodeJS.Timeout;
|
||||||
private writeFunc = (data: ArrayBuffer) => this.writeData(new Uint8Array(data));
|
private writeFunc = (data: ArrayBuffer) => this.writeData(new Uint8Array(data));
|
||||||
private status = false;
|
private connectStatus = false;
|
||||||
private hostTitle = "";
|
private hostTitle = "";
|
||||||
private postAttachCommand = [];
|
private postAttachCommand = [];
|
||||||
private postAttachCommandStatus = false;
|
private postAttachCommandStatus = false;
|
||||||
private workdir = "";
|
private workdir = "";
|
||||||
|
private containerStatus = "";
|
||||||
private beforeCommand?: string;
|
private beforeCommand?: string;
|
||||||
constructor(
|
constructor(
|
||||||
private options: XtermOptions,
|
private options: XtermOptions,
|
||||||
@@ -187,7 +188,7 @@ export class Xterm {
|
|||||||
register(
|
register(
|
||||||
terminal.onData(data =>
|
terminal.onData(data =>
|
||||||
{
|
{
|
||||||
if (this.status) {
|
if (this.connectStatus) {
|
||||||
sendData(data);
|
sendData(data);
|
||||||
} else {
|
} else {
|
||||||
this.writeData('\b \b');
|
this.writeData('\b \b');
|
||||||
@@ -267,7 +268,7 @@ export class Xterm {
|
|||||||
|
|
||||||
@bind
|
@bind
|
||||||
public changeStatus(v: boolean){
|
public changeStatus(v: boolean){
|
||||||
this.status = v;
|
this.connectStatus = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
@@ -357,7 +358,10 @@ export class Xterm {
|
|||||||
this.workdir = data.workdir;
|
this.workdir = data.workdir;
|
||||||
}
|
}
|
||||||
if (data.status !== '4' && data.status !== '0') {
|
if (data.status !== '4' && data.status !== '0') {
|
||||||
this.sendData(data.command);
|
if(this.containerStatus !== data.status){
|
||||||
|
this.sendData(data.command);
|
||||||
|
}
|
||||||
|
this.containerStatus = data.status;
|
||||||
} else {
|
} else {
|
||||||
clearInterval(this.intervalID);
|
clearInterval(this.intervalID);
|
||||||
if (data.status === '4') {
|
if (data.status === '4') {
|
||||||
@@ -438,19 +442,19 @@ export class Xterm {
|
|||||||
this.hostTitle = textDecoder.decode(data).replace(/\s/g, '');
|
this.hostTitle = textDecoder.decode(data).replace(/\s/g, '');
|
||||||
}
|
}
|
||||||
// 检测是否退出devcontainer,标题等于host的标题
|
// 检测是否退出devcontainer,标题等于host的标题
|
||||||
if (this.status && textDecoder.decode(data).replace(/\s/g, '').includes(this.hostTitle)){
|
if (this.connectStatus && textDecoder.decode(data).replace(/\s/g, '').includes(this.hostTitle)){
|
||||||
this.status = false
|
this.connectStatus = false
|
||||||
}
|
}
|
||||||
// this.status = true 连接完成
|
// this.connectStatus = true 连接完成
|
||||||
if (
|
if (
|
||||||
this.status === false &&
|
this.connectStatus === false &&
|
||||||
textDecoder.decode(data).replace(/\s/g, '').includes('Successfully connected to the devcontainer'.replace(/\s/g, ''))
|
textDecoder.decode(data).replace(/\s/g, '').includes('Successfully connected to the devcontainer'.replace(/\s/g, ''))
|
||||||
) {
|
) {
|
||||||
this.status = true;
|
this.connectStatus = true;
|
||||||
}
|
}
|
||||||
// 连接完成之前,不输出标题和docker命令
|
// 连接完成之前,不输出标题和docker命令
|
||||||
if (
|
if (
|
||||||
!(this.status === false && (textDecoder.decode(data).includes('\x1b') || textDecoder.decode(data).replace(/\s/g, '').includes('docker')))
|
!(this.connectStatus === false && (textDecoder.decode(data).includes('\x1b') || textDecoder.decode(data).replace(/\s/g, '').includes('docker')))
|
||||||
){
|
){
|
||||||
this.writeFunc(data);
|
this.writeFunc(data);
|
||||||
fetch('http://' + options.get('domain') + ':'+ options.get('port') +'/' +
|
fetch('http://' + options.get('domain') + ':'+ options.get('port') +'/' +
|
||||||
@@ -468,7 +472,7 @@ export class Xterm {
|
|||||||
console.error('[ttyd] Failed to send output:', err);
|
console.error('[ttyd] Failed to send output:', err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.status && textDecoder.decode(data).replace(/\s/g, '').includes(this.workdir) && !this.postAttachCommandStatus){
|
if (this.connectStatus && textDecoder.decode(data).replace(/\s/g, '').includes(this.workdir) && !this.postAttachCommandStatus){
|
||||||
for (let i = 1; i < this.postAttachCommand.length; i++){
|
for (let i = 1; i < this.postAttachCommand.length; i++){
|
||||||
this.sendData(this.postAttachCommand[i]+"\n");
|
this.sendData(this.postAttachCommand[i]+"\n");
|
||||||
}
|
}
|
||||||
|
|||||||
32367
src/html.h
generated
32367
src/html.h
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user