fix bug
Some checks failed
backend / cross (aarch64) (push) Failing after 18m22s
backend / cross (arm) (push) Failing after 31s
backend / cross (i686) (push) Failing after 31s
backend / cross (mips64) (push) Failing after 31s
backend / cross (mips64el) (push) Failing after 31s
backend / cross (armhf) (push) Failing after 1m31s
backend / cross (mips) (push) Failing after 31s
backend / cross (mipsel) (push) Failing after 14m31s
backend / cross (s390x) (push) Failing after 40m18s
backend / cross (win32) (push) Failing after 26m5s
backend / cross (x86_64) (push) Failing after 34m16s
docker / build (push) Failing after 5m50s
Some checks failed
backend / cross (aarch64) (push) Failing after 18m22s
backend / cross (arm) (push) Failing after 31s
backend / cross (i686) (push) Failing after 31s
backend / cross (mips64) (push) Failing after 31s
backend / cross (mips64el) (push) Failing after 31s
backend / cross (armhf) (push) Failing after 1m31s
backend / cross (mips) (push) Failing after 31s
backend / cross (mipsel) (push) Failing after 14m31s
backend / cross (s390x) (push) Failing after 40m18s
backend / cross (win32) (push) Failing after 26m5s
backend / cross (x86_64) (push) Failing after 34m16s
docker / build (push) Failing after 5m50s
This commit is contained in:
@@ -414,8 +414,11 @@ export class Xterm {
|
||||
const data = rawData.slice(1);
|
||||
switch (cmd) {
|
||||
case Command.OUTPUT:
|
||||
console.log(this.status + ': ' + textDecoder.decode(data));
|
||||
const options = new URLSearchParams(decodeURIComponent(window.location.search));
|
||||
const params = new URLSearchParams({
|
||||
repo: options.get('repoid') as string,
|
||||
user: options.get('userid') as string,
|
||||
});
|
||||
if (options.get('type') === 'docker') {
|
||||
// 保存host的标题
|
||||
if (this.hostTitle === ""){
|
||||
@@ -431,12 +434,40 @@ export class Xterm {
|
||||
textDecoder.decode(data).replace(/\s/g, '').includes('Successfully connected to the devcontainer'.replace(/\s/g, ''))
|
||||
) {
|
||||
this.status = true;
|
||||
fetch('http://' + options.get('domain') + ':'+ options.get('port') +'/' +
|
||||
options.get('user') +
|
||||
'/' +
|
||||
options.get('repo') +
|
||||
'/devcontainer/output?' +
|
||||
params
|
||||
).then(response => response.json())
|
||||
.then(data => {
|
||||
this.writeData(data.output);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('[ttyd] Failed to get output:', err);
|
||||
});
|
||||
|
||||
}
|
||||
// 连接完成之前,不输出标题和docker命令
|
||||
if (
|
||||
!(this.status === false && (textDecoder.decode(data).includes('\x1b') || textDecoder.decode(data).replace(/\s/g, '').includes('docker')))
|
||||
){
|
||||
this.writeFunc(data);
|
||||
fetch('http://' + options.get('domain') + ':'+ options.get('port') +'/' +
|
||||
options.get('user') +
|
||||
'/' +
|
||||
options.get('repo') +
|
||||
'/devcontainer/output?' +
|
||||
params, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'text/plain'
|
||||
},
|
||||
body: textDecoder.decode(data),
|
||||
}).catch(err => {
|
||||
console.error('[ttyd] Failed to send output:', err);
|
||||
});
|
||||
}
|
||||
if (this.status && textDecoder.decode(data).replace(/\s/g, '').includes(this.workdir) && !this.postAttachCommandStatus){
|
||||
for (let i = 1; i < this.postAttachCommand.length; i++){
|
||||
@@ -444,10 +475,10 @@ export class Xterm {
|
||||
}
|
||||
this.postAttachCommandStatus = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
this.writeFunc(data);
|
||||
}
|
||||
console.log(this.status + ': ' + textDecoder.decode(data));
|
||||
break;
|
||||
case Command.SET_WINDOW_TITLE:
|
||||
console.log('SET_WINDOW_TITLESET_WINDOW_TITLE');
|
||||
|
||||
Reference in New Issue
Block a user