Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit abaf6f7

Browse files
committed
Feat: 统一文案口径
1 parent 6083435 commit abaf6f7

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

src/entity/commands/pty/pty_start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ${instance.config.startCommand}
153153
参数:${JSON.stringify(ptyParameter)}
154154
155155
请将此信息报告给管理员,技术人员或自行排查故障。
156-
如果您认为是面板伪终端导致的问题,请在左侧终端设置中关闭“伪终端”选项,我们将会采用原始输入输出流的方式监听程序。
156+
如果您认为是面板仿真终端导致的问题,请在左侧终端设置中关闭“仿真终端”选项,我们将会采用原始输入输出流的方式监听程序。
157157
`
158158
);
159159
throw new StartupError("实例启动失败,请检查启动命令,主机环境和配置文件等");

src/entity/commands/pty/pty_stop.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,28 @@ export default class PtyStopCommand extends InstanceCommand {
3030

3131
async exec(instance: Instance) {
3232
const stopCommand = instance.config.stopCommand;
33-
if (stopCommand.toLocaleLowerCase() == "^c") return instance.failure(new Error("伪终端无法使用^C命令关闭进程,请重新设置关服命令"));
33+
if (stopCommand.toLocaleLowerCase() == "^c")
34+
return instance.failure(new Error("仿真终端无法使用Ctrl+C命令关闭进程,请重新设置关服命令"));
3435

35-
if (instance.status() === Instance.STATUS_STOP || !instance.process) return instance.failure(new Error("实例未处于运行中状态,无法进行停止"));
36+
if (instance.status() === Instance.STATUS_STOP || !instance.process)
37+
return instance.failure(new Error("实例未处于运行中状态,无法进行停止"));
3638
instance.status(Instance.STATUS_STOPPING);
3739

3840
await instance.exec(new SendCommand(stopCommand));
3941

40-
instance.println("INFO", `已执行预设的关闭命令:${stopCommand}\n如果无法关闭实例请前往实例设置更改关闭实例的正确命令,比如 exit,stop,end 等`);
42+
instance.println(
43+
"INFO",
44+
`已执行预设的关闭命令:${stopCommand}\n如果无法关闭实例请前往实例设置更改关闭实例的正确命令,比如 exit,stop,end 等`
45+
);
4146

4247
// 若 10 分钟后实例还处于停止中状态,则恢复状态
4348
const cacheStartCount = instance.startCount;
4449
setTimeout(() => {
4550
if (instance.status() === Instance.STATUS_STOPPING && instance.startCount === cacheStartCount) {
46-
instance.println("ERROR", "关闭命令已发出但长时间未能关闭实例,可能是实例关闭命令错误或实例进程假死导致,现在将恢复到运行中状态,可使用强制终止指令结束进程。");
51+
instance.println(
52+
"ERROR",
53+
"关闭命令已发出但长时间未能关闭实例,可能是实例关闭命令错误或实例进程假死导致,现在将恢复到运行中状态,可使用强制终止指令结束进程。"
54+
);
4755
instance.status(Instance.STATUS_RUNNING);
4856
}
4957
}, 1000 * 60 * 10);

src/entity/instance/Instance_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default class InstanceConfig {
5151
public terminalOption = {
5252
haveColor: false,
5353
pty: true,
54-
ptyWindowCol: 80,
54+
ptyWindowCol: 140,
5555
ptyWindowRow: 40
5656
};
5757

src/routers/instance_event_router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import RouterContext from "../entity/ctx";
2525
import * as protocol from "../service/protocol";
2626
import InstanceSubsystem from "../service/system_instance";
2727
import fs from "fs-extra";
28-
const MAX_LOG_SIZE = 1024;
28+
const MAX_LOG_SIZE = 512;
2929

3030
// 缓存区
3131
const buffer = new Map<string, string>();

src/routers/stream_router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ routerApp.on("stream/input", async (ctx, data) => {
109109
}
110110
});
111111

112-
// 处理终端输入,适用于伪终端的直连输入输出流
112+
// 处理终端输入,适用于仿真终端的直连输入输出流
113113
routerApp.on("stream/write", async (ctx, data) => {
114114
try {
115115
const buf = data.input;

0 commit comments

Comments
 (0)