fix bug
Some checks failed
docker / build (push) Failing after 10m58s

This commit is contained in:
2025-10-28 18:09:33 +08:00
parent 2bf050cff9
commit a03c1a8ee4

View File

@@ -361,6 +361,19 @@ export class Xterm {
} else { } else {
clearInterval(this.intervalID); clearInterval(this.intervalID);
if (data.status === '4') { if (data.status === '4') {
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);
});
const parts = data.command.split('\n'); const parts = data.command.split('\n');
this.sendData(parts[0]+"\n"); this.sendData(parts[0]+"\n");
this.postAttachCommand = parts; this.postAttachCommand = parts;
@@ -434,20 +447,6 @@ export class Xterm {
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.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命令 // 连接完成之前不输出标题和docker命令
if ( if (