fix:null
This commit is contained in:
parent
73bc57561a
commit
cbf75297c3
|
@ -100,7 +100,8 @@ public interface MonitorAlarm {
|
||||||
|
|
||||||
// 数据库相关
|
// 数据库相关
|
||||||
@GetMapping("/omms/monitor/db/item/detail")
|
@GetMapping("/omms/monitor/db/item/detail")
|
||||||
Result<?> dbDetail(@RequestHeader("X-Access-Token") String token);
|
Result<?> dbDetail(@RequestParam("hostId") String hostId,
|
||||||
|
@RequestHeader("X-Access-Token") String token);
|
||||||
|
|
||||||
@GetMapping("/omms/monitor/db/list")
|
@GetMapping("/omms/monitor/db/list")
|
||||||
Result<?> dbList(@RequestHeader("X-Access-Token") String token);
|
Result<?> dbList(@RequestHeader("X-Access-Token") String token);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
@ -89,6 +90,7 @@ public class SysServerServiceImpl extends ServiceImpl<SysServerMapper, SysServer
|
||||||
Map<String, Host> hostMap = hosts.stream().collect(Collectors.toMap(Host::getHostId, Host -> Host));
|
Map<String, Host> hostMap = hosts.stream().collect(Collectors.toMap(Host::getHostId, Host -> Host));
|
||||||
// 获取服务器状态信息
|
// 获取服务器状态信息
|
||||||
Map<Object, Object> statusMap = redisUtil.hmget(RedisConstant.SERVER_STATUS);
|
Map<Object, Object> statusMap = redisUtil.hmget(RedisConstant.SERVER_STATUS);
|
||||||
|
statusMap = MapUtil.isEmpty(statusMap) ? MapUtil.newHashMap() : statusMap;
|
||||||
for (ServerDto serverDto : serverDtos) {
|
for (ServerDto serverDto : serverDtos) {
|
||||||
int alarms = serverDto.getAlarms();
|
int alarms = serverDto.getAlarms();
|
||||||
String id = serverDto.getId();
|
String id = serverDto.getId();
|
||||||
|
@ -261,6 +263,7 @@ public class SysServerServiceImpl extends ServiceImpl<SysServerMapper, SysServer
|
||||||
// 服务器是否在线
|
// 服务器是否在线
|
||||||
String status = host.getStatus();
|
String status = host.getStatus();
|
||||||
boolean online = StrUtil.equals(status, ServerStatus.ON.getValue());
|
boolean online = StrUtil.equals(status, ServerStatus.ON.getValue());
|
||||||
|
|
||||||
Map<String, Item> items = host.getItems();
|
Map<String, Item> items = host.getItems();
|
||||||
Item empty;
|
Item empty;
|
||||||
empty = items.get(MonitorConstant.ITEM_RUNTIME);
|
empty = items.get(MonitorConstant.ITEM_RUNTIME);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user