forked from mirror/MCSM-Daemon
修复 resize 预设不存在
This commit is contained in:
parent
c7de9fa206
commit
1d22c8b2ed
@ -91,3 +91,5 @@ async function _7zipDecompress(sourceZip: string, destDir: string) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function linuxUnzip(sourceZip: string, destDir: string) {}
|
||||||
|
@ -65,6 +65,7 @@ export default class FunctionDispatcher extends InstanceCommand {
|
|||||||
instance.setPreset("start", new GeneralStartCommand());
|
instance.setPreset("start", new GeneralStartCommand());
|
||||||
}
|
}
|
||||||
if (instance.config.processType === "docker") {
|
if (instance.config.processType === "docker") {
|
||||||
|
instance.setPreset("resize", new DockerResizeCommand());
|
||||||
instance.setPreset("start", new DockerStartCommand());
|
instance.setPreset("start", new DockerStartCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ export default class DockerResizeCommand extends InstanceCommand {
|
|||||||
async exec(instance: Instance, size?: IResizeOptions): Promise<any> {
|
async exec(instance: Instance, size?: IResizeOptions): Promise<any> {
|
||||||
if (!instance.process || !(instance.config.processType === "docker")) return;
|
if (!instance.process || !(instance.config.processType === "docker")) return;
|
||||||
const dockerProcess = <DockerProcessAdapter>instance.process;
|
const dockerProcess = <DockerProcessAdapter>instance.process;
|
||||||
await dockerProcess.container.resize({
|
await dockerProcess?.container?.resize({
|
||||||
h: size.h,
|
h: size.h,
|
||||||
w: size.w
|
w: size.w
|
||||||
});
|
});
|
||||||
|
@ -127,6 +127,6 @@ routerApp.on("stream/resize", async (ctx, data) => {
|
|||||||
const instance = InstanceSubsystem.getInstance(instanceUuid);
|
const instance = InstanceSubsystem.getInstance(instanceUuid);
|
||||||
if (instance.config.processType === "docker") await instance.execPreset("resize", data);
|
if (instance.config.processType === "docker") await instance.execPreset("resize", data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
protocol.responseError(ctx, error);
|
// protocol.responseError(ctx, error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user