Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
monitor-ui
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhengyouwei
9 years ago
Commit
8d0ad96ba8b1cc1c81805c0d7ced6021ab0eded8
1 parent
d976c372
host group
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
40 deletions
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/HostGroupCtrl.java
monitor-ui-web/src/main/webapp/js/global.js
monitor-ui-web/src/main/webapp/jsp/host/hostGroupList.jsp
monitor-ui-common/src/main/java/com/ui/contants/HttpUriContants.java
View file @
8d0ad96
...
...
@@ -5,6 +5,11 @@ package com.ui.contants;
*/
public
class
HttpUriContants
{
public
static
String
TEST_GET_URI
=
"/test/get"
;
/*** 机组信息 ****/
public
static
final
String
HOST_GROUP_GETALL
=
"/hostGroup/getHostGroups"
;
/*** 机组信息 ****/
}
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/HostGroupCtrl.java
0 → 100644
View file @
8d0ad96
package
com
.
ui
.
ctrl
;
import
com.alibaba.fastjson.JSON
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.req.PageRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* Created by yoho on 2016/6/14.
* 查询机器信息
*/
@Controller
@RequestMapping
(
"hostGroup"
)
public
class
HostGroupCtrl
{
Logger
log
=
LoggerFactory
.
getLogger
(
HostGroupCtrl
.
class
);
@Autowired
HttpRestClient
httpRestClient
;
@RequestMapping
(
"/getHostGroups"
)
@ResponseBody
public
BaseResponse
getHostGroups
(
PageRequest
req
)
{
BaseResponse
response
=
httpRestClient
.
defaultPost
(
HttpUriContants
.
HOST_GROUP_GETALL
,
req
,
BaseResponse
.
class
);
System
.
out
.
println
(
"*****************************"
+
JSON
.
toJSON
(
response
));
return
response
;
}
}
...
...
monitor-ui-web/src/main/webapp/js/global.js
View file @
8d0ad96
...
...
@@ -46,9 +46,6 @@ var opMap = {
"not_contain"
:
"不包含"
};
//webcontext
var
contextPath
=
"/crm"
;
//全局的panel的样式
var
panelStyle
=
"panel-primary"
;
...
...
monitor-ui-web/src/main/webapp/jsp/host/hostGroupList.jsp
View file @
8d0ad96
...
...
@@ -11,28 +11,15 @@
<div class="widget-box">
<div class="widget-title">
<h5>
Dynamic table
</h5>
<h5>
机组信息列表
</h5>
</div>
<div class="widget-content nopadding">
<div class="widget-title" style="height: 53px;">
<div>
<div class="form-inline" role="form" id="inBoxQueryDiv"
style=" margin-top: 12px;margin-left: 25px;float: left;">
<div class="input-group" style="float: left;">
<span class="input-group-addon">IP:</span>
<input type="text" id="" class="form-control" placeholder=""/>
</div>
<div class="input-group" style="float: left;">
<span class="input-group-addon">IP:</span>
<input type="text" id="" class="form-control" placeholder=""/>
</div>
<button id="submit" class="btn btn-default">搜索</button>
</div>
<button id="addBtn" class="btn btn-primary" style="margin-top: 12px;margin-left: 900px;">新增</button>
</div>
</div>
<div id="table">
<div id="hostGroupTable">
</div>
</div>
...
...
@@ -40,30 +27,42 @@
</div>
<script>
$(function () {
var data = [];
for (var i = 0; i < 20; i++) {
data.push({
userId: i,
userName: "用户" + i,
status: i % 3 == 0 ? 0 : 1
});
}
$("#table").table({
striped: true,
panelClass: "panel-success",
pagination: true,
columns: [{
title: "用户id",
field: "userId"
//加载表格
$("#hostGroupTable").table({
columnAutoWidth : false,
url : contextPath+"hostGroup/getHostGroups",
striped : true,
title : "主机信息列表",
pagination : true,
pageSize : 10,
loadFilter : function(data) {
return defaultLoadFilter(data);
},
columns : [{
title : "ID",
field : "id",
width : "5%"
}, {
title : "机组名",
field : "groupName",
width : "8%"
}, {
title: "用户名称",
field: "userName"
title : "createTime",
field : "createTime",
width : "10%"
}, {
title: "状态",
field: "status"
}],
data: data
title : "updateTime",
field : "updateTime",
width : "5%"
},{
title : "操作",
field : "op",
width : "15%"
}]
});
});
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment