|
|
$(
|
|
|
updateOverView(),
|
|
|
updateClusterView(),
|
|
|
updateQueuesView()
|
|
|
refreshView()
|
|
|
);
|
|
|
|
|
|
function refreshView() {
|
|
|
updateOverView();
|
|
|
updateClusterView();
|
|
|
updateQueuesView();
|
|
|
|
|
|
setTimeout('refreshView()', 30000);
|
|
|
}
|
|
|
function updateOverView() {
|
|
|
$.ajax({
|
|
|
url: contextPath + "rabbitmq/overview",
|
...
|
...
|
@@ -18,6 +23,7 @@ function updateOverView() { |
|
|
error: function (e) {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function updateOverview(response) {
|
...
|
...
|
@@ -26,35 +32,47 @@ function updateOverview(response) { |
|
|
|
|
|
div.innerHTML = "";
|
|
|
|
|
|
var connections = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Connections: ").appendTo(div);
|
|
|
var cpus = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("CPU(%): ").appendTo(div);
|
|
|
|
|
|
var cpusValue = $("<strong>").html(response.data.cpu).appendTo(cpus);
|
|
|
|
|
|
var mems = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("可用/总内存(MB): ").appendTo(div);
|
|
|
|
|
|
var memsValue = $("<strong>").html(response.data.mem).appendTo(mems);
|
|
|
|
|
|
var nets = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("网络I/O(Mbps): ").appendTo(div);
|
|
|
|
|
|
var netsValue = $("<strong>").html(response.data.net).appendTo(nets);
|
|
|
|
|
|
var connections = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Connections: ").appendTo(div);
|
|
|
|
|
|
var conValue = $("<strong>").html(response.data.connections).appendTo(connections);
|
|
|
|
|
|
var channels = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Channels: ").appendTo(div);
|
|
|
var channels = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Channels: ").appendTo(div);
|
|
|
|
|
|
var chaValue = $("<strong>").html(response.data.channels).appendTo(channels);
|
|
|
|
|
|
var exchanges = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Exchanges: ").appendTo(div);
|
|
|
var exchanges = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Exchanges: ").appendTo(div);
|
|
|
|
|
|
var excValue = $("<strong>").html(response.data.exchanges).appendTo(exchanges);
|
|
|
|
|
|
var Queues = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Queues: ").appendTo(div);
|
|
|
var Queues = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Queues: ").appendTo(div);
|
|
|
|
|
|
var quevalue = $("<strong>").html(response.data.queues).appendTo(Queues);
|
|
|
|
|
|
var consumers = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Consumers: ").appendTo(div);
|
|
|
var consumers = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Consumers: ").appendTo(div);
|
|
|
|
|
|
var consValue = $("<strong>").html(response.data.consumers).appendTo(consumers);
|
|
|
|
|
|
var Messages_Ready = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Message_Ready: ").appendTo(div);
|
|
|
var Messages_Ready = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Message_Ready: ").appendTo(div);
|
|
|
|
|
|
var readyValue = $("<strong>").html(response.data.messages_ready).appendTo(Messages_Ready);
|
|
|
|
|
|
var Messages_unack = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Message_Unack: ").appendTo(div);
|
|
|
var Messages_unack = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Message_Unack: ").appendTo(div);
|
|
|
|
|
|
var unValue = $("<strong>").html(response.data.messages_unack).appendTo(Messages_unack);
|
|
|
|
|
|
var Messages_total = $("<div style='margin-left: 35px'>").addClass("micro-highlight").html("Message_Total: ").appendTo(div);
|
|
|
var Messages_total = $("<div style='margin-left: 35px; margin-top: 5px'>").addClass("micro-highlight").html("Message_Total: ").appendTo(div);
|
|
|
|
|
|
var totValue = $("<strong>").html(response.data.messages).appendTo(Messages_total);
|
|
|
}
|
...
|
...
|
@@ -89,12 +107,10 @@ function updateClusterView() { |
|
|
var div = $("<div style='width: 240px;'>").addClass("status-bar");
|
|
|
var nameDiv = $("<div style='margin-bottom: 5px;background-repeat: no-repeat;'>")
|
|
|
.html(rowData.fd_used);
|
|
|
if (rowData.fd_used > rowData.fd_total/2)
|
|
|
{
|
|
|
if (rowData.fd_used > rowData.fd_total / 2) {
|
|
|
nameDiv.addClass("status-bar-main red");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
else {
|
|
|
nameDiv.addClass("status-bar-main green");
|
|
|
}
|
|
|
var nameAvliable = $("<sub>").html(rowData.fd_total + " vailable");
|
...
|
...
|
@@ -110,12 +126,10 @@ function updateClusterView() { |
|
|
var nameDiv = $("<div style='margin-bottom: 5px;background-repeat: no-repeat;'>")
|
|
|
.addClass("status-bar-main green")
|
|
|
.html(rowData.sockets_used);
|
|
|
if (rowData.sockets_used > rowData.sockets_total/2)
|
|
|
{
|
|
|
if (rowData.sockets_used > rowData.sockets_total / 2) {
|
|
|
nameDiv.addClass("status-bar-main red");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
else {
|
|
|
nameDiv.addClass("status-bar-main green");
|
|
|
}
|
|
|
|
...
|
...
|
@@ -133,12 +147,10 @@ function updateClusterView() { |
|
|
.addClass("status-bar-main green")
|
|
|
.html(rowData.proc_used);
|
|
|
|
|
|
if (rowData.proc_used > rowData.proc_total/2)
|
|
|
{
|
|
|
if (rowData.proc_used > rowData.proc_total / 2) {
|
|
|
nameDiv.addClass("status-bar-main red");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
else {
|
|
|
nameDiv.addClass("status-bar-main green");
|
|
|
}
|
|
|
var nameAvliable = $("<sub>").html(rowData.proc_total + " available");
|
...
|
...
|
@@ -153,12 +165,10 @@ function updateClusterView() { |
|
|
var div = $("<div style='width: 240px;'>").addClass("status-bar");
|
|
|
var nameDiv = $("<div style='margin-bottom: 5px;background-repeat: no-repeat;'>")
|
|
|
.html(rowData.mem_used);
|
|
|
if (rowData.mem_alarm)
|
|
|
{
|
|
|
if (rowData.mem_alarm) {
|
|
|
nameDiv.addClass("status-bar-main red");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
else {
|
|
|
nameDiv.addClass("status-bar-main green");
|
|
|
}
|
|
|
var nameAvliable = $("<sub>").html(rowData.mem_limit + " vailable");
|
...
|
...
|
@@ -174,12 +184,10 @@ function updateClusterView() { |
|
|
var nameDiv = $("<div style='margin-bottom: 5px;background-repeat: no-repeat;'>")
|
|
|
.html(rowData.disk_free);
|
|
|
|
|
|
if (rowData.disk_free_alarm)
|
|
|
{
|
|
|
if (rowData.disk_free_alarm) {
|
|
|
nameDiv.addClass("status-bar-main red");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
else {
|
|
|
nameDiv.addClass("status-bar-main green");
|
|
|
}
|
|
|
var nameAvliable = $("<sub>").html(rowData.disk_free_limit + " available");
|
...
|
...
|
@@ -191,6 +199,7 @@ function updateClusterView() { |
|
|
|
|
|
]
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function updateQueuesView() {
|
...
|
...
|
|