...
|
...
|
@@ -218,8 +218,23 @@ |
|
|
}
|
|
|
});
|
|
|
});
|
|
|
var createJavaAppDiv = function (apps, serviceId, toggle) {
|
|
|
var createJavaAppDiv = function (apps, serviceId, toggle,apiUrlCustom) {
|
|
|
var rel = $("<div>");
|
|
|
if(apiUrlCustom==1){
|
|
|
var span;
|
|
|
if (toggle == 1) {
|
|
|
span = $("<button class='btn btn-default btn-xs tag_javaapp has-popover' >").attr("id", "span_" + serviceId + "_0" ).html("node");
|
|
|
span.attr("data-toggle", "popover");
|
|
|
span.attr("data-placement", "bottom");
|
|
|
span.attr("data-html", "true");
|
|
|
// span.attr("title", "message");
|
|
|
span.attr("data-content", "unkown");
|
|
|
} else {
|
|
|
span = $("<button class='btn btn-inverse btn-xs tag_javaapp' >").attr("id", "span_no_" + serviceId + "_0").html("node");
|
|
|
}
|
|
|
rel.append(span);
|
|
|
return rel;
|
|
|
}
|
|
|
$.each(apps, function (idx, val) {
|
|
|
var span;
|
|
|
if (toggle == 1) {
|
...
|
...
|
@@ -243,7 +258,7 @@ |
|
|
|
|
|
var setStatus = function (statusObj) {
|
|
|
var id = "span_" + statusObj.serviceId + "_" + statusObj.mObjectId;
|
|
|
// console.log(statusObj);
|
|
|
console.log(statusObj);
|
|
|
var content = "start: " + statusObj.startTime + " ";
|
|
|
content += "end: " + statusObj.endTime + " ";
|
|
|
content += "cost: " + statusObj.costTime + "ms<br>";
|
...
|
...
|
@@ -283,15 +298,22 @@ |
|
|
$.each(table_data.rows, function (idx, val) {
|
|
|
if (val.apiToggle == 0) //关闭了
|
|
|
return;
|
|
|
var apps = java_app["" + val.serviceType];
|
|
|
var serviceId = val.serviceId;
|
|
|
var reqList = [];
|
|
|
$.each(apps, function (idx, val) {
|
|
|
if(val.apiUrlCustom==1){ //custom url get status
|
|
|
reqList.push({
|
|
|
serviceId: serviceId,
|
|
|
mObjectId: val.moId
|
|
|
mObjectId: 0
|
|
|
});
|
|
|
});
|
|
|
}else {
|
|
|
var apps = java_app["" + val.serviceType];
|
|
|
$.each(apps, function (idx, val) {
|
|
|
reqList.push({
|
|
|
serviceId: serviceId,
|
|
|
mObjectId: val.moId
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
//每行就去获取,缩短整个表请求时间
|
|
|
$.ajax({
|
|
|
url: contextPath + "/javaApi/status?list=" + JSON.stringify(reqList),
|
...
|
...
|
@@ -324,7 +346,7 @@ |
|
|
$.each(table_data.rows, function (idx, val) {
|
|
|
var apps = java_app["" + val.serviceType];
|
|
|
//创建服务状态
|
|
|
var appDiv = createJavaAppDiv(apps, val.serviceId, val.apiToggle);
|
|
|
var appDiv = createJavaAppDiv(apps, val.serviceId, val.apiToggle,val.apiUrlCustom);
|
|
|
$("#status_" + val.serviceId).html("");
|
|
|
$("#status_" + val.serviceId).append(appDiv);
|
|
|
|
...
|
...
|
|