服务器页面,添加全量查询按钮

jieling
grimm 2023-12-24 22:08:09 +08:00
parent 020fd2bfc1
commit 79d57afaba
3 changed files with 26 additions and 1 deletions

View File

@ -88,6 +88,26 @@ public class ServerInfoController {
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";
}
/**
* 刷新缓存
*/

View File

@ -49,7 +49,6 @@ public class ServerInfoDaoImpl implements ServerInfoDao {
Query query = new Query(Criteria.where("isSlave").is(isSlaveServer));
List<ServerInfo> serverInfos = mongoTemplate.find(query, ServerInfo.class);
return serverInfos.stream().sorted().collect(Collectors.toList());
}

View File

@ -38,6 +38,7 @@
<div th:id="serverIds" style="float: left;width: 230px;"></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-success radius" style="margin-left: 10px;height: 40px;line-height: 40px;" type="button" onclick="findAllServer()">全量查询</button>
</div>
<div class="mt-20">
<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
@ -211,6 +212,11 @@
window.location = "/toServerInfoEdit?id=" + serverId;
}
// 查询全部服务器
function findAllServer() {
window.location = "/findAllServerInfo";
}
// 删除服务器列表
function deleteServer(obj) {
var serverId = $(obj).attr("id");