修改虚拟机统计和容器统计返回给前端的字段

This commit is contained in:
2023-03-22 22:04:33 +08:00
parent d00bb26d25
commit 813d9226a8
2 changed files with 6 additions and 6 deletions
@@ -61,9 +61,9 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container
//设置查询所有离线vm的条件 //设置查询所有离线vm的条件
LambdaQueryWrapper<Container> exitedWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Container> exitedWrapper = new LambdaQueryWrapper<>();
exitedWrapper.eq(Container::getContainerState, SystemConstant.CONTAINER_STATE_EXITED); exitedWrapper.eq(Container::getContainerState, SystemConstant.CONTAINER_STATE_EXITED);
//设置查询所有睡眠vm的条件 //设置查询所有未知vm的条件
LambdaQueryWrapper<Container> pausedWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Container> pausedWrapper = new LambdaQueryWrapper<>();
pausedWrapper.eq(Container::getContainerState, SystemConstant.CONTAINER_STATE_PAUSED); pausedWrapper.eq(Container::getContainerState, SystemConstant.CONTAINER_STATE_UNKNOWN);
int total = count(); int total = count();
int running = count(runningWrapper); int running = count(runningWrapper);
@@ -73,7 +73,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container
result.put("total", total); result.put("total", total);
result.put("running", running); result.put("running", running);
result.put("exited", exited); result.put("exited", exited);
result.put("paused", paused); result.put("unknown", paused);
return ResponseResult.okResult(result); return ResponseResult.okResult(result);
} }
@@ -117,9 +117,9 @@ public class HostMachineServiceImpl extends ServiceImpl<HostMachineMapper, HostM
LambdaQueryWrapper<HostMachine> offlineWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HostMachine> offlineWrapper = new LambdaQueryWrapper<>();
offlineWrapper.eq(HostMachine::getHostMachineState, SystemConstant.HOST_MACHINE_STATE_OFFLINE); offlineWrapper.eq(HostMachine::getHostMachineState, SystemConstant.HOST_MACHINE_STATE_OFFLINE);
offlineWrapper.ne(HostMachine::getHostMachineId, SystemConstant.HOST_MACHINE_ID_HOST); offlineWrapper.ne(HostMachine::getHostMachineId, SystemConstant.HOST_MACHINE_ID_HOST);
//设置查询所有睡眠vm的条件 //设置查询所有未知vm的条件
LambdaQueryWrapper<HostMachine> sleepWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HostMachine> sleepWrapper = new LambdaQueryWrapper<>();
sleepWrapper.eq(HostMachine::getHostMachineState, SystemConstant.HOST_MACHINE_STATE_SLEEP); sleepWrapper.eq(HostMachine::getHostMachineState, SystemConstant.HOST_MACHINE_STATE_UNKNOWN);
sleepWrapper.ne(HostMachine::getHostMachineId, SystemConstant.HOST_MACHINE_ID_HOST); sleepWrapper.ne(HostMachine::getHostMachineId, SystemConstant.HOST_MACHINE_ID_HOST);
int total = count(wrapper); int total = count(wrapper);
@@ -130,7 +130,7 @@ public class HostMachineServiceImpl extends ServiceImpl<HostMachineMapper, HostM
result.put("total", total); result.put("total", total);
result.put("online", online); result.put("online", online);
result.put("offline", offline); result.put("offline", offline);
result.put("sleep", sleep); result.put("unknown", sleep);
return ResponseResult.okResult(result); return ResponseResult.okResult(result);
} }