" +
"
" +
" 时间:"+ TimeHelper.getTime(Number(sObj["stime"]),"FMS") +""+
"
" +
@@ -609,8 +661,8 @@ function APMTool(app) {
"
" +
" 状态:"+ _this.UI_list_state(sObj["state"],false) +""+
"
" +
- "
元数据" +
- "
");
+
html+="
"+sb.toString()+"
";
return html;
};
@@ -716,16 +771,16 @@ function APMTool(app) {
}
if(isEmpty){
- var errMsg = "数据处理中,请刷新重试";
+ var errMsg = "无数据,请刷新重试";
var epinfo = sObj["epinfo"].split(",")[0];
//当前支持的类型
var epinfos = ["http.service","apache.http.Client","apache.http.AsyncClient","mq.service","rabbitmq.client","jdbc.client","method","dubbo.provider","dubbo.consumer"];
if($.inArray(epinfo, epinfos)==-1){
- errMsg = "不支持的数据类型,努力更新中...";
+ errMsg = "不支持的数据类型";
}
sb.append("
"+errMsg+"");
}
- HtmlHelper.id("AppIVCDataWnd_TContainer_ContentDiv").innerHTML+=sb.toString();
+ HtmlHelper.id("AppIVCDataWnd_TContainer_ContentDiv").innerHTML=sb.toString();
}
@@ -941,6 +996,37 @@ function APMTool(app) {
}
switch(intent) {
+ /**
+ * 完整查询
+ */
+ case "qsearch":
+ dataList=this.mainList;
+
+ var timeRange=_this.getCurTimeRange();
+
+ if (timeRange==undefined) {
+ var tmp=new Date().getTime();
+ timeRange={etime:tmp,stime:tmp-60000};
+ }
+
+ var etime=timeRange["etime"];
+ var stime=timeRange["stime"];
+ data["request"]["appuuid"]=appuuid;
+ data["request"]["stime"]=stime+"";
+ data["request"]["etime"]=etime+"";
+ data["request"]["eptype"]="E,S";
+ data["request"]["from"]=0+"";
+ data["request"]["size"]=500+"";
+ data["request"]["indexdate"]=timeRange["indexdate"];
+
+ var timeSort=this.timeSortSelector.value();
+ if (timeSort=="DESC") {
+ data["request"]["sort"]="stime=DESC";
+ }
+ else {
+ data["request"]["sort"]="stime=ASC";
+ }
+ break;
case "lst1min":
dataList=this.mainList;
@@ -1092,6 +1178,97 @@ function APMTool(app) {
this.runIVCCfgWnd=function(sObj) {
};
+
+ //TODO -----------------------------------------------调用链时间控制------------------------------------------
+ /**
+ * 改变时间区段的单位
+ */
+ this.onChangeTimeRangeSelector=function() {
+
+ var val=this.timeRangeSelector.value();
+
+ if (val=="D") {
+ $('.form_datetime').datetimepicker("remove");
+ HtmlHelper.id("AppIVCWnd_TimeRange").value="";
+ $('.form_datetime').datetimepicker({
+ language : 'zh-CN',
+ autoclose : true,
+ minuteStep : 1,
+ minView: 2,
+ format:"yyyy-mm-dd",
+ todayBtn : true
+ });
+ }
+ else if (val=="H") {
+ $('.form_datetime').datetimepicker("remove");
+ HtmlHelper.id("AppIVCWnd_TimeRange").value="";
+ $('.form_datetime').datetimepicker({
+ language : 'zh-CN',
+ autoclose : true,
+ minuteStep : 1,
+ minView: 1,
+ format:"yyyy-mm-dd hh",
+ todayBtn : true
+ });
+ }
+ else if (val=="M") {
+ $('.form_datetime').datetimepicker("remove");
+ HtmlHelper.id("AppIVCWnd_TimeRange").value="";
+ $('.form_datetime').datetimepicker({
+ language : 'zh-CN',
+ autoclose : true,
+ minuteStep : 1,
+ minView: 0,
+ format:"yyyy-mm-dd hh:ii",
+ todayBtn : true
+ });
+ }
+
+ };
+
+ /**
+ * 清除时间选择
+ */
+ this.cleanTimeRange=function() {
+ HtmlHelper.id("AppIVCWnd_TimeRange").value="";
+ };
+
+ /**
+ * 获取当前的时间区段
+ */
+ this.getCurTimeRange=function() {
+
+ var timeRange=HtmlHelper.id("AppIVCWnd_TimeRange").value;
+ var timeUnit=this.timeRangeSelector.value();
+
+ //全部时间
+ if (timeRange=="") {
+ return undefined;
+ }
+
+ var date;
+ var plus;
+ switch(timeUnit) {
+ case "D":
+ date=TimeHelper.toDate(timeRange+" 00:00:00");
+ plus=24*3600*1000;
+ break;
+ case "H":
+ date=TimeHelper.toDate(timeRange+":00:00");
+ plus=3600*1000;
+ break;
+ case "M":
+ date=TimeHelper.toDate(timeRange+":00");
+ plus=60*1000;
+ break;
+ }
+
+ var startTime=date.getTime();
+ var endTime=startTime+plus;
+ var reqDate=TimeHelper.getTime(startTime,"FD");
+
+ return {stime:startTime,etime:endTime,indexdate:reqDate};
+ };
}
diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_godeye/appmonitor/js/uav.appmonitor.js b/com.creditease.uav.console/src/main/webapp/uavapp_godeye/appmonitor/js/uav.appmonitor.js
index 28d8cf1e..dba892d9 100644
--- a/com.creditease.uav.console/src/main/webapp/uavapp_godeye/appmonitor/js/uav.appmonitor.js
+++ b/com.creditease.uav.console/src/main/webapp/uavapp_godeye/appmonitor/js/uav.appmonitor.js
@@ -1019,6 +1019,39 @@ var monitorCfg={
}
};
+/**
+ * TODO: open link
+ */
+var openLink={
+
+ /**
+ * 延迟打开window
+ * @param ip
+ * @param winId
+ * @param func
+ * @param callback
+ * @param tag
+ */
+ showWindowDelay:function(ip,winId,func,callback,tag) {
+ var info={ip:ip,winId:winId,func:func,callback:callback,tag:tag};
+ window["openlink_"+tag]=info;
+ },
+
+ /**
+ * 触发点执行打开窗口
+ * @param tag
+ */
+ runWindowDelay:function(tag) {
+ if (window["openlink_"+tag]==undefined) {
+ return;
+ }
+
+ var info=window["openlink_"+tag];
+ app.controller.showWindow(info["ip"],info["winId"],info["func"],info["callback"]);
+ window["openlink_"+tag]=undefined;
+ }
+};
+
/**
* TODO:应用画像与监控
*/
@@ -1255,12 +1288,25 @@ var mvcObj={
//not start sync
return false;
}
+ // for 应用实例监控
+ else if (view=="appinst") {
+ window.winmgr.show("AppInstWnd");
+ var param=HtmlHelper.getQParams()["param"];
+ param=decodeURI(param);
+ var params=param.split(",");
+ var id=params[0];
+ var instid=params[1];
+ var isJse=params[2];
+ var appInfo={id:id,instid:instid,isJse:isJse};
+ openLink.showWindowDelay(appInfo,"AppInstChartWnd","buildAppInstChart","runAppInstChart","monitorapp");
+ }
//for 应用监控
else {
- window.winmgr.show("AppList");
- window.tablistmgr.build(appTabListConfig);
+ window.winmgr.show("AppList");
}
+ //init app tab list
+ window.tablistmgr.build(appTabListConfig);
//init monitorcfg dialog
this.controller.initMonitorCfgDialog();
},
@@ -1552,6 +1598,7 @@ var mvcObj={
"cpt.jaxrs":"cpt.jaxrs",
"cpt.springmvc":"cpt.springmvc",
"cpt.springmvcRest":"cpt.springmvcRest",
+ "cpt.struts2":"cpt.struts2",
state:"state",
"cpt.services":"cpt.services",
"cpt.clients":"cpt.clients",
@@ -1735,6 +1782,9 @@ var mvcObj={
//启动图谱的Edge的刷新
appStream.startAppEdgeMoUpdate();
+
+ //完成openlink事件
+ openLink.runWindowDelay("monitorapp");
},
//--------------元数据定义-----------------
//primary key
@@ -1924,6 +1974,13 @@ var mvcObj={
*/
controller:{
//----------------------COMMON--------------------------
+ /**
+ * TODO: delay open
+ */
+ showWindowDelay:function(iObj,winId,func,callback,tag) {
+ var info={iObj:iObj,winId:winId,func:func,callback:callback,tag:tag};
+ window["openlink_"+tag]=info;
+ },
/**
* TODO: controller COMMON
*/
@@ -2307,7 +2364,7 @@ var mvcObj={
/**
* check if one app instance window is open and try to query history data
*/
- if (monitorCfg.app["id"]!=undefined) {
+ if (monitorCfg.app["id"]!=undefined&&monitorCfg["app"].isusecustomized==true) {
pdata=[pdata[monitorCfg.app["id"]]];
}
}
@@ -2912,6 +2969,10 @@ var mvcObj={
*/
quitMonitorChartData:function(dType) {
+ if (dType=="app") {
+ monitorCfg.app["id"]=undefined;
+ }
+
if (monitorCfg[dType].isusecustomized==false) {
return;
}
@@ -2923,16 +2984,12 @@ var mvcObj={
if (dType=="app") {
monitorCfg.startTime=undefined;
+ //reset isautorefresh
+ monitorCfg.isautorefresh=true;
+
+ app.refresh("app.monitor");
}
- switch(dType) {
- case "app":
- //reset isautorefresh
- monitorCfg.isautorefresh=true;
- monitorCfg.app["id"]=undefined;
- app.refresh("app.monitor");
- break;
- }
},
/**
* init LogCfgDialog
@@ -3654,6 +3711,13 @@ var mvcObj={
var jsonObj=mdata[obj.id];
+ if(jsonObj==undefined) {
+ setTimeout(function() {
+ openLink.runWindowDelay("monitorapp");
+ },1000);
+ return;
+ }
+
var isJse=this.isJSE(jsonObj.appurl);
if (isJse==true) {
@@ -3665,6 +3729,10 @@ var mvcObj={
var appInstMO=app.mdata("monitor.app")[appInstMOId];
+ if (appInstMO==undefined) {
+ console.log(appInstMOId+" monitor data is null~~~");
+ }
+
var sObjStr=StringHelper.obj2str(obj);
var backWndId="";
@@ -3734,6 +3802,19 @@ var mvcObj={
html+="
"+this.buildAppInstServerWndContent(jsonObj)+
"
";
+ /**
+ * 主机(应用容器)查看窗口
+ */
+ html+="
"+this.buildAppMachineWndContent(jsonObj,appInstMOId,isJse)+
+ "
";
+
+ /**
+ * 应用进程查看窗口
+ */
+ html+="
"+this.buildAppProcessWndContent(jsonObj,appInstMOId,isJse)+
+ "
";
+
+
/**
* AppInst Chart 日志组件按钮列表,可以打开日志组件查看窗口
*/
@@ -3756,6 +3837,42 @@ var mvcObj={
html+="
";
return html;
},
+ /**
+ * buildAppMachineWndContent
+ */
+ buildAppMachineWndContent:function(jsonObj,appInstMOId,isJse) {
+ var ip=jsonObj["ip"];
+ var sb=new StringBuffer();
+ var param=encodeURI(jsonObj["id"]+","+appInstMOId+","+isJse);
+ sb.append("