cpu性能开发

parent e589cfa9
...@@ -19,5 +19,6 @@ public class MyMvcConfig extends WebMvcConfigurerAdapter { ...@@ -19,5 +19,6 @@ public class MyMvcConfig extends WebMvcConfigurerAdapter {
registry.addViewController("/servicesfenye").setViewName("servicefenye"); registry.addViewController("/servicesfenye").setViewName("servicefenye");
registry.addViewController("/serviceform").setViewName("servicefrom"); registry.addViewController("/serviceform").setViewName("servicefrom");
registry.addViewController("/serviceupdate").setViewName("serviceupdate"); registry.addViewController("/serviceupdate").setViewName("serviceupdate");
registry.addViewController("/serviceCapability").setViewName("serviceCapability");
} }
} }
...@@ -35,7 +35,7 @@ public class ServiceController { ...@@ -35,7 +35,7 @@ public class ServiceController {
/* /*
获取服务list 获取服务list
*/ */
@GetMapping("/services") @GetMapping("/serviceslist")
@ResponseBody @ResponseBody
public ResultMap serviceslist(Model model, Services services){ public ResultMap serviceslist(Model model, Services services){
ResultMap resultMap=new ResultMap(); ResultMap resultMap=new ResultMap();
...@@ -43,6 +43,16 @@ public class ServiceController { ...@@ -43,6 +43,16 @@ public class ServiceController {
return resultMap; return resultMap;
} }
/* /*
获取服务器list
*/
@GetMapping("/services")
@ResponseBody
public ResultMap services(Model model, Services services){
ResultMap resultMap=new ResultMap();
resultMap =serviceService.Services(services);
return resultMap;
}
/*
修改服务页面 修改服务页面
*/ */
@GetMapping("/services/{id}") @GetMapping("/services/{id}")
......
...@@ -5,8 +5,10 @@ import java.util.List; ...@@ -5,8 +5,10 @@ import java.util.List;
public interface ServiceMapper { public interface ServiceMapper {
List<Services> selectPageList(Services service); List<Services> selectPageList(Services service);
List<Services> selectServiceList();
int selectPageCount(Services service); int selectPageCount(Services service);
List<Services> selectServicesPageList(Services service);
int selectServicesPageCount(Services service);
List<Services> selectServiceList();
Services selectServices(int id); Services selectServices(int id);
int saveService(Services service); int saveService(Services service);
int updateService(Services service); int updateService(Services service);
......
...@@ -19,6 +19,7 @@ public interface ServiceService { ...@@ -19,6 +19,7 @@ public interface ServiceService {
* @return * @return
*/ */
ResultMap ServiceAll(Services service); ResultMap ServiceAll(Services service);
ResultMap Services(Services service);
XzxtRestResult SelectServiceList(); XzxtRestResult SelectServiceList();
XzxtRestResult SelectServices(int id); XzxtRestResult SelectServices(int id);
XzxtRestResult SaveService(Services service); XzxtRestResult SaveService(Services service);
......
...@@ -37,6 +37,20 @@ public class ServiceIServiceImpl implements ServiceService { ...@@ -37,6 +37,20 @@ public class ServiceIServiceImpl implements ServiceService {
} }
@Override @Override
public ResultMap Services(Services service) {
List<Services> serviceslist=serviceMapper.selectServicesPageList(service);
ResultMap resultMap=new ResultMap();
resultMap.setData(serviceslist);
/* if (!StringUtils.isEmpty(serviceslist)) {
int totals=serviceMapper.selectServicesPageCount(service);
resultMap.setCount(totals);
resultMap.setData(serviceslist);
return resultMap;
}*/
return resultMap ;
}
@Override
public XzxtRestResult SelectServiceList() { public XzxtRestResult SelectServiceList() {
List<Services> serviceslist=serviceMapper.selectServiceList(); List<Services> serviceslist=serviceMapper.selectServiceList();
if(!StringUtils.isEmpty(serviceslist)){ if(!StringUtils.isEmpty(serviceslist)){
......
...@@ -48,6 +48,20 @@ ...@@ -48,6 +48,20 @@
<include refid="queryWhere"/> <include refid="queryWhere"/>
</select> </select>
<!-- 通过条件分页查询,返回数据集 服务器-->
<select id="selectServicesPageList" parameterType="com.cc.bean.Services" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from service
GROUP BY service_ip
order by id
</select>
<!-- 通过条件分页查询,返回总记录数 服务器-->
<select id="selectServicesPageCount" parameterType="com.cc.bean.Services" resultType="java.lang.Integer">
select count(1) from (select * from service GROUP BY service_ip) service
</select>
<select id="selectServices" parameterType="java.lang.Integer" resultType="com.cc.bean.Services"> <select id="selectServices" parameterType="java.lang.Integer" resultType="com.cc.bean.Services">
select <include refid="Base_Column_List"/> select <include refid="Base_Column_List"/>
from service from service
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</a> </a>
<ul class="sub-menu"> <ul class="sub-menu">
<li> <li>
<a href="servicefenye"> <a href="/serviceCapability">
<i class="iconfont">&#xe6a7;</i> <i class="iconfont">&#xe6a7;</i>
性能监控 性能监控
</a> </a>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</li> </li>
</ul> </ul>
</li> </li>
<li class="list" > <%-- <li class="list" >
<a href="javascript:;"> <a href="javascript:;">
<i class="iconfont">&#xe6a3;</i> <i class="iconfont">&#xe6a3;</i>
资源管理 资源管理
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
</a> </a>
</li> </li>
</ul> </ul>
</li> </li>--%>
<li class="list" > <li class="list" >
<a href="javascript:;"> <a href="javascript:;">
<i class="iconfont">&#xe6a3;</i> <i class="iconfont">&#xe6a3;</i>
......
<%--
Created by IntelliJ IDEA.
User: changc
Date: 2018/9/6
Time: 14:37
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/css/xadmin.css">
<link rel="stylesheet" href="/fenye/fenye.css" media="all">
<link rel="stylesheet" href="/fenye/font-awesome.min.css" media="all">
<script type="text/javascript" src="/jquery/jquery.min.js"></script>
<!-- 引入公共js-->
<script type="text/javascript" src="/js/common.js"></script>
<!-- 引入公共页面-->
<jsp:include page="../common/index.jsp"></jsp:include>
<style type="text/css">
table{border-collapse: collapse;width: 100%;overflow: hidden;text-align: center;margin: 10px auto;}
table td,th{border:1px solid #ccc;}
thead tr{background: rgba(0,0,0,0.4);height:40px;line-height: 40px;}
tbody tr{background: rgba(255,255,255,0.3);}
.fwq-img{height:100px;}
.rel-td{position: relative;}
.magnifier{
position: absolute;
top: 0;
line-height: 100px;
cursor: pointer;
color: #fff;
background: -moz-linear-gradient(45deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
background: -webkit-linear-gradient(45deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
background: linear-gradient(45deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000', GradientType=1);
left: 0;
bottom: 0;
right: 0;
z-index: 1;
zoom: 1;
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;}
.rel-td:hover .magnifier {
zoom: 1;
filter: alpha(opacity=100);
opacity: 1;
}
.fwq-p{margin-top:5px;margin-bottom: 44px;}
.fwq-btn{ position: absolute;bottom: 10px;left:50%;margin-left:-48px;}
</style>
</head>
<body>
<div class="page-content" style="display: none">
<div class="content">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="insertService" onclick="connect()">服务器控制台</button>
</div>
<%--<table class="layui-hide" id="test" lay-filter="test" width="100%"></table>--%>
<table class="serviceslist">
<%-- <thead>
<tr>
<td>图片1</td>
<td>图片2</td>
<td>图片3</td>
<td>图片4</td>
</tr>
</thead>--%>
<%--<tbody>--%>
<%-- <tr>
<td class="rel-td"><img src="fwq.png" class="fwq-img" /><p class="fwq-p">192.168.193.133</p><div class="magnifier">192.168.2.110<a class="layui-btn layui-btn-xs fwq-btn" lay-event="start" onclick="fwq(this)">性能分析</a></div></td>
<td class="rel-td"><img src="fwq.png" class="fwq-img"/><p class="fwq-p">192.168.193.134</p><div class="magnifier">192.168.2.110<a class="layui-btn layui-btn-xs fwq-btn" lay-event="start" onclick="fwq(this)">性能分析</a></div></td>
<td class="rel-td"><img src="fwq.png" class="fwq-img"/><p class="fwq-p">192.168.193.134</p><div class="magnifier">192.168.2.110<a class="layui-btn layui-btn-xs fwq-btn" lay-event="start" onclick="fwq(this)">性能分析</a></div></td>
<td class="rel-td"><img src="fwq.png" class="fwq-img"/><p class="fwq-p">192.168.193.133</p><div class="magnifier">192.168.2.110<a class="layui-btn layui-btn-xs fwq-btn" lay-event="start" onclick="fwq(this)">性能分析</a></div></td>
</tr>--%>
<%-- </tbody>--%>
</table>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="insertService">服务器控制台</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="start">性能分析</a>
</script>
<script src="/layui/layui.js" charset="utf-8"></script>
<!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
<script>
function fwq(obj) {
var ip= $(obj).parent(".magnifier").prev("p").text()
//http://192.168.193.133:90/#/system-status
window.open("http://"+ip+":90");
}
function connect() {
window.open("http://192.168.193.134:3001/");
}
$(function(){
$.ajax({
type: "GET",
url: "/services",
dataType: "json",
success:function (data) {
var servicelist=data.data;
var trs = "";
trs += "<tbody><tr>"
$.each(servicelist,function(n,value) {
trs += "<td class=\"rel-td\"><img src=\"fwq.png\" class=\"fwq-img\" />";
trs += "<p class=\"fwq-p\">"+value.serviceIp+"</p>";
trs +="<div class=\"magnifier\">"+value.applyName+"<a class=\"layui-btn layui-btn-xs fwq-btn\" lay-event=\"start\" onclick=\"fwq(this)\">性能分析</a></div></td>"
});
trs += "</tr></tbody>"
$(".serviceslist ").append(trs);
}
})
})
</script>
</body>
</html>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
table.render({ table.render({
elem: '#test' elem: '#test'
,url:'/services' ,url:'/serviceslist'
,toolbar: '#toolbarDemo' ,toolbar: '#toolbarDemo'
,title: '用户数据表' ,title: '用户数据表'
,page: true ,page: true
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
//window.location.reload(); //window.location.reload();
//当前页的刷新 //当前页的刷新
$(".layui-laypage-btn").click(); $(".layui-laypage-btn").click();
}, 3000); }, 60000);
}); });
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment