forked from mirror/MCSM-Daemon
新增 通过 Websocket 获取状态
This commit is contained in:
parent
415240b128
commit
739504111c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Copyright(c) 2020 Suwings
|
||||
* @Date: 2021-06-22 22:44:06
|
||||
* @LastEditTime: 2021-07-16 19:25:05
|
||||
* @LastEditTime: 2021-07-17 13:21:26
|
||||
* @Description: 文件管理系统路由层
|
||||
* @Projcet: MCSManager Daemon
|
||||
* @License: MIT
|
||||
@ -62,6 +62,23 @@ routerApp.on("stream/auth", (ctx, data) => {
|
||||
}
|
||||
});
|
||||
|
||||
// 获取实例详细信息
|
||||
routerApp.on("stream/detail", (ctx) => {
|
||||
try {
|
||||
const instanceUuid = ctx.session.stream.instanceUuid;
|
||||
const instance = InstanceSubsystem.getInstance(instanceUuid);
|
||||
protocol.response(ctx, {
|
||||
instanceUuid: instance.instanceUuid,
|
||||
started: instance.startCount,
|
||||
status: instance.status(),
|
||||
config: instance.config,
|
||||
info: instance.info
|
||||
});
|
||||
} catch (error) {
|
||||
protocol.responseError(ctx, error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 列出指定实例工作目录的文件列表
|
||||
routerApp.on("stream/input", (ctx, data) => {
|
||||
|
Loading…
Reference in New Issue
Block a user