修复 resize 预设不存在

This commit is contained in:
Suwings 2022-05-11 16:43:16 +08:00
parent c7de9fa206
commit 1d22c8b2ed
4 changed files with 5 additions and 2 deletions

View File

@ -91,3 +91,5 @@ async function _7zipDecompress(sourceZip: string, destDir: string) {
});
});
}
async function linuxUnzip(sourceZip: string, destDir: string) {}

View File

@ -65,6 +65,7 @@ export default class FunctionDispatcher extends InstanceCommand {
instance.setPreset("start", new GeneralStartCommand());
}
if (instance.config.processType === "docker") {
instance.setPreset("resize", new DockerResizeCommand());
instance.setPreset("start", new DockerStartCommand());
}

View File

@ -37,7 +37,7 @@ export default class DockerResizeCommand extends InstanceCommand {
async exec(instance: Instance, size?: IResizeOptions): Promise<any> {
if (!instance.process || !(instance.config.processType === "docker")) return;
const dockerProcess = <DockerProcessAdapter>instance.process;
await dockerProcess.container.resize({
await dockerProcess?.container?.resize({
h: size.h,
w: size.w
});

View File

@ -127,6 +127,6 @@ routerApp.on("stream/resize", async (ctx, data) => {
const instance = InstanceSubsystem.getInstance(instanceUuid);
if (instance.config.processType === "docker") await instance.execPreset("resize", data);
} catch (error) {
protocol.responseError(ctx, error);
// protocol.responseError(ctx, error);
}
});