Authored by simba

Merge branch 'master' of http://git.yoho.cn/ops/monitor-ui

package com.ui.model.req;
import lombok.Data;
/**
* Created by yoho on 2016/7/1.
*/
@Data
public class RabbitInfoReq extends PageRequest {
String moId;
}
... ...
... ... @@ -2,8 +2,8 @@ package com.ui.ctrl;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.MObjectInfoReq;
import com.ui.model.req.RabbitAlertReq;
import com.ui.model.req.RabbitInfoReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
... ... @@ -19,7 +19,7 @@ public class RabbitMonitorCtrl {
HttpRestClient httpRestClient;
@RequestMapping(value = "/overview")
public BaseResponse queryOverView(MObjectInfoReq request) {
public BaseResponse queryOverView(RabbitInfoReq request) {
BaseResponse response = httpRestClient.defaultPost("/middleware/rabbitmq/overview", request, BaseResponse.class);
... ... @@ -28,7 +28,7 @@ public class RabbitMonitorCtrl {
@RequestMapping(value = "/clusterView")
public BaseResponse queryClusterView(MObjectInfoReq request) {
public BaseResponse queryClusterView(RabbitInfoReq request) {
BaseResponse response = httpRestClient.defaultPost("/middleware/rabbitmq/cluster", request, BaseResponse.class);
... ... @@ -37,7 +37,7 @@ public class RabbitMonitorCtrl {
@RequestMapping(value = "/queueView")
public BaseResponse queryQueueView(MObjectInfoReq request) {
public BaseResponse queryQueueView(RabbitInfoReq request) {
BaseResponse response = httpRestClient.defaultPost("/middleware/rabbitmq/queue", request, BaseResponse.class);
... ... @@ -46,7 +46,7 @@ public class RabbitMonitorCtrl {
@RequestMapping(value = "/allRabbitMq")
public BaseResponse queryQueueAll(MObjectInfoReq request) {
public BaseResponse queryQueueAll(RabbitInfoReq request) {
BaseResponse response = httpRestClient.defaultPost("/middleware/rabbitmq/allRabbitMq", request, BaseResponse.class);
return response;
}
... ...
monitor.service.url=http://127.0.0.1:8080/monitor
\ No newline at end of file
monitor.service.url=http://127.0.0.1:8880/monitor
\ No newline at end of file
... ...
... ... @@ -21,39 +21,46 @@
</encoder>
</appender>
<!-- WARN级别日志 appender -->
<appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/Data/tomcat_logs/monitor/warn-log</file>
<!-- 过滤器,过滤掉 TRACE 和 DEBUG 和 INFO 级别的日志 -->
<file>${catalina.home}/logs/warn.log</file>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
<level>ERROR</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/warn-log.log</fileNamePattern>
<!-- 日志最大的保存天数 -->
<!-- daily rollover -->
<fileNamePattern>
${catalina.home}/logs/warn.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${maxFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days' worth of history -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}:%line -- %msg%n</pattern>
</encoder>
</appender>
<!-- DEBUG级别日志 appender -->
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/Data/tomcat_logs/monitor/debug-log</file>
<file>${catalina.home}/logs/debug.log</file>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/debug-log.log</fileNamePattern>
<fileNamePattern>
${catalina.home}/logs/debug.%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${maxFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 日志最大的历史 60天 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
... ...
$(
initRabbitSelect(),
updateOverView(),
updateClusterView(),
updateQueuesView()
initRabbitSelect()
);
function updateOverView(moId) {
$.ajax({
url: contextPath + "rabbitmq/overview",
type: "post",
... ... @@ -18,16 +14,16 @@ function updateOverView(moId) {
updateOverview(response);
},
error: function (e) {
}
});
}
function updateOverview(response) {
var div = document.getElementById("overviewDiv");
div.innerHTML="";
div.innerHTML = "";
var connections = $("<div>").addClass("micro-highlight").html("Connections:").appendTo(div);
... ... @@ -63,13 +59,14 @@ function updateOverview(response) {
}
function updateClusterView(moId) {
$("#clusterViewTable").table(
{
url: contextPath + "rabbitmq/clusterView",
queryParams : {
queryParams: {
moId: moId
}, //调用url传递的参数
method : "POST",
method: "POST",
striped: true,
panelClass: "panel-success",
pagination: true,
... ... @@ -159,10 +156,10 @@ function updateQueuesView(moId) {
$("#queueViewTable").table(
{
url: contextPath + "rabbitmq/queueView",
queryParams : {
method: "POST",
queryParams: {
moId: moId
}, //调用url传递的参数
method : "POST",
striped: true,
panelClass: "panel-success",
pagination: true,
... ... @@ -240,14 +237,14 @@ function updateQueuesView(moId) {
function fixAlertHigh(rowData, rowIndex) {
/* alert(rowIndex);
/* alert(rowIndex);
alert(rowData.name);
alert($("#msg_alert_high_" + rowIndex + "").val());*/
$.ajax({
url: contextPath + "rabbitmq/fixAlertHigh",
type: "post",
dataType: "json",
data:{
data: {
moId: $('#rabbitMqSelected option:selected').val(),
queueName: rowData.name,
alertHigh: $("#msg_alert_high_" + rowIndex + "").val()
... ... @@ -264,6 +261,10 @@ function initRabbitSelect() {
success: function (response) {
//将查询到的数据,update到选择框中
genarateRabbitSelectOption(response.data);
updateOverView((response.data)[0].moId);
updateClusterView((response.data)[0].moId);
updateQueuesView((response.data)[0].moId);
},
error: function (e) {
}
... ... @@ -285,17 +286,15 @@ function genarateRabbitSelectOption(optionList) {
*/
function rabbitUpdateSelectOnChange() {
var rabbitId = $('#rabbitMqSelected option:selected').val().replace(/\'/g, '\"');
updateOverView(rabbitId);
updateClusterView(rabbitId);
updateQueuesView(rabbitId);
}
/*function updateTable() {
$("#queueViewTable").table("load", {moId: 135});
$("#clusterViewTable").table("load", {moId: 135});
}*/
updateOverView(rabbitId);
$("#clusterViewTable").table("load", {
'moId': rabbitId
});
$("#queueViewTable").table("load", {
'moId': rabbitId
});
}
... ...
... ... @@ -154,81 +154,6 @@
</div>
<script>
$(function () {
$.ajax({
url: "",
type: "post",
dataType: "json",
data: {
moId: paramObj.moId
},
success: function (data) {
updateViewTable(data);
}
});
function updateViewTable(data) {
var innerHTML = "";
for (var i = 0; i < orderMsgList.length; i++) {
innerHTML += "<tr><td>" + orderMsgList[i].influxTime + "</td>";
innerHTML += "<td>" + orderMsgList[i].isSend + "</td>";
innerHTML += "<td>" + orderMsgList[i].orderCode + "</td>";
innerHTML += "<td>" + orderMsgList[i].event + "</td></tr>";
}
document.getElementById('viewTable').getElementsByTagName("tbody")[0].innerHTML = innerHTML;
};
$.ajax({
url: "",
type: "post",
dataType: "json",
data: {
moId: paramObj.moId
},
success: function (data) {
updateModelTable(data);
}
});
function updateModelTable(data) {
var innerHTML = "";
for (var i = 0; i < orderMsgList.length; i++) {
innerHTML += "<tr><td>" + orderMsgList[i].influxTime + "</td>";
innerHTML += "<td>" + orderMsgList[i].isSend + "</td>";
innerHTML += "<td>" + orderMsgList[i].orderCode + "</td>";
innerHTML += "<td>" + orderMsgList[i].event + "</td></tr>";
}
document.getElementById('modelTable').getElementsByTagName("tbody")[0].innerHTML = innerHTML;
}
});
$.ajax({
url: "",
type: "post",
dataType: "json",
data: {
moId: paramObj.moId
},
success: function (data) {
updateQueueTable(data);
}
});
function updateQueueTable(data) {
var innerHTML = "";
for (var i = 0; i < orderMsgList.length; i++) {
innerHTML += "<tr><td>" + orderMsgList[i].influxTime + "</td>";
innerHTML += "<td>" + orderMsgList[i].isSend + "</td>";
innerHTML += "<td>" + orderMsgList[i].orderCode + "</td>";
innerHTML += "<td>" + orderMsgList[i].event + "</td></tr>";
}
document.getElementById('queueTable').getElementsByTagName("tbody")[0].innerHTML = innerHTML;
}
;
</script>
<script src="<%=basePath %>js/rabbit.js" type="text/javascript"></script>
\ No newline at end of file
... ...