Authored by fanzelei

zkinfo

... ... @@ -40,4 +40,6 @@ public class HttpUriContants {
public static final String JAVA_API_STATUS = "/javaApiStatus/query";
/*** ZK监控信息查询 ****/
public static final String GET_ZK_INFO = "/zkMonitor/getZkMonitorRecords";
}
... ...
package com.ui.model.req;
import lombok.Data;
@Data
public class ZkInfoReq {
private int id;
private String hostIp;
private int isLive; //0是不活动,1是活动
private String redcordTime;
}
... ...
package com.ui.ctrl;
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;
import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.ZkInfoReq;
/**
* Created by yoho on 2016/6/14.
* 查询机器信息
*/
@Controller
@RequestMapping("zkMonitor")
public class ZkMonitorCtrl {
Logger log = LoggerFactory.getLogger(HostInfoCtrl.class);
@Autowired
HttpRestClient httpRestClient;
@RequestMapping("/getZkMonitorRecords")
@ResponseBody
public BaseResponse getZkMonitorRecords(ZkInfoReq req) throws Exception {
BaseResponse response=httpRestClient.defaultPost(HttpUriContants.GET_ZK_INFO, req, BaseResponse.class);
return response;
}
}
... ...
... ... @@ -29,14 +29,8 @@
<span class="input-group-addon">时间:</span>
<input type="text" id="time" name="time" class="form-control" placeholder=""/>
</div>
<button id="" class="btn btn-default">搜索</button>
<button id="" class="btn btn-primary">搜索</button>
</div>
<button id="addInfoBtn" class="btn btn-primary" style="margin-top: 12px;margin-left: 100px;">
新增
</button>
<button id="modeoBtn" class="btn btn-primary" style="margin-top: 12px;margin-left: 100px;">
编辑
</button>
</div>
</div>
<div id="zkInfoTable">
... ... @@ -50,7 +44,7 @@
$(function(){
$("#zkInfoTable").table({
columnAutoWidth: false,
url: "",
url: contextPath + "zkMonitor/getZkMonitorRecords",
striped: true,
title: "ZK监控列表",
dataType: "json",
... ... @@ -61,16 +55,26 @@
},
columns: [{
title: "ID",
field: ""
field: "id",
formatter : function(value, rowData, rowIndex) {
return rowIndex;
}
},{
title: "ID",
field: ""
title: "IP",
field: "hostIp"
},{
title: "ID",
field: ""
title: "时间",
field: "redcordTime"
},{
title: "ID",
field: ""
title: "是否活动",
field: "isLive",
formatter : function(value, rowData, rowIndex) {
if (value == 1) {
return "是";
} else {
return "否";
}
}
}]
});
});
... ...