Authored by zhengyouwei

host group

... ... @@ -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";
/*** 机组信息 ****/
}
... ...
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;
}
}
... ...
... ... @@ -46,9 +46,6 @@ var opMap = {
"not_contain" : "不包含"
};
//webcontext
var contextPath = "/crm";
//全局的panel的样式
var panelStyle = "panel-primary";
... ...
... ... @@ -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
... ...