generated from root/miduo_server
服务器页面,添加全量查询按钮
parent
020fd2bfc1
commit
79d57afaba
|
|
@ -88,6 +88,26 @@ public class ServerInfoController {
|
||||||
return findServerInfo(map,1);
|
return findServerInfo(map,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务器信息界面
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/findAllServerInfo", method = {RequestMethod.POST, RequestMethod.GET})
|
||||||
|
public String findAllServerInfo(ModelMap map) throws Exception {
|
||||||
|
List<ServerInfoVo> serverInfoVos = new ArrayList<>();
|
||||||
|
List<ServerInfo> serverInfos = serverInfoDao.getAllServerInfo();
|
||||||
|
//查找所有主服和未合服信息
|
||||||
|
// List<ServerInfo> serverInfos = serverInfoDao.getServerInfoOfSlaveServer(0);
|
||||||
|
for (ServerInfo serverInfo : serverInfos) {
|
||||||
|
if (null == serverInfo.getServer_id()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ServerInfoVo serverInfoVo = createServerVo(serverInfo,1);
|
||||||
|
serverInfoVos.add(serverInfoVo);
|
||||||
|
}
|
||||||
|
map.addAttribute("serverInfos", serverInfoVos);
|
||||||
|
return "findServerInfo";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新缓存
|
* 刷新缓存
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ public class ServerInfoDaoImpl implements ServerInfoDao {
|
||||||
Query query = new Query(Criteria.where("isSlave").is(isSlaveServer));
|
Query query = new Query(Criteria.where("isSlave").is(isSlaveServer));
|
||||||
List<ServerInfo> serverInfos = mongoTemplate.find(query, ServerInfo.class);
|
List<ServerInfo> serverInfos = mongoTemplate.find(query, ServerInfo.class);
|
||||||
return serverInfos.stream().sorted().collect(Collectors.toList());
|
return serverInfos.stream().sorted().collect(Collectors.toList());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
<div th:id="serverIds" style="float: left;width: 230px;"></div>
|
<div th:id="serverIds" style="float: left;width: 230px;"></div>
|
||||||
<div th:id="statuss" style="float: left;width: 120px;margin-left: 10px;"></div>
|
<div th:id="statuss" style="float: left;width: 120px;margin-left: 10px;"></div>
|
||||||
<button class="btn btn-secondary radius" style="margin-left: 10px;height: 40px;line-height: 40px;" type="button" onclick="updateServers()">批量修改</button>
|
<button class="btn btn-secondary radius" style="margin-left: 10px;height: 40px;line-height: 40px;" type="button" onclick="updateServers()">批量修改</button>
|
||||||
|
<button class="btn btn-success radius" style="margin-left: 10px;height: 40px;line-height: 40px;" type="button" onclick="findAllServer()">全量查询</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-20">
|
<div class="mt-20">
|
||||||
<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
|
<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
|
||||||
|
|
@ -211,6 +212,11 @@
|
||||||
window.location = "/toServerInfoEdit?id=" + serverId;
|
window.location = "/toServerInfoEdit?id=" + serverId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询全部服务器
|
||||||
|
function findAllServer() {
|
||||||
|
window.location = "/findAllServerInfo";
|
||||||
|
}
|
||||||
|
|
||||||
// 删除服务器列表
|
// 删除服务器列表
|
||||||
function deleteServer(obj) {
|
function deleteServer(obj) {
|
||||||
var serverId = $(obj).attr("id");
|
var serverId = $(obj).attr("id");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue