diff --git a/com.creditease.uav.console.buildComponent/config/web_pro.xml b/com.creditease.uav.console.buildComponent/config/web_pro.xml index 59536a82..587f9287 100644 --- a/com.creditease.uav.console.buildComponent/config/web_pro.xml +++ b/com.creditease.uav.console.buildComponent/config/web_pro.xml @@ -14,7 +14,7 @@ com.creditease.uav.apphub.core.AppHubRestServlet jersey.config.server.provider.packages - com.creditease.uav.apphub.rest,com.creditease.uav.godeye.rest,com.creditease.uav.manage.rest,com.creditease.uav.appmongo.rest,com.creditease.uav.grafana + com.creditease.uav.apphub.rest,com.creditease.uav.godeye.rest,com.creditease.uav.manage.rest,com.creditease.uav.appmongo.rest,com.creditease.uav.grafana,com.creditease.uav.opentsdb 1 true @@ -41,17 +41,6 @@ es-serlvet /es/* - - opentsdb-crdu-servlet - com.creditease.uav.opentsdb.OpenTSDBRestCRDUServlet - 2 - true - - - - opentsdb-crdu-servlet - /db/* - opentsdb-agent-servlet @@ -130,6 +119,10 @@ uav.app.godeye.redis.store.addr 127.0.0.1:26379 + + uav.app.opentsdb.redis.store.addr + 127.0.0.1:26379 + uav.app.gui.redis.store.params {"min":50,"max":300,"queue":10} @@ -146,6 +139,14 @@ uav.app.godeye.redis.store.params {"min":30,"max":100,"queue":5,"cacheaccess":5} + + uav.app.opentsdb.redis.store.params + {"min":30,"max":100,"queue":5,"cacheaccess":5} + + + uav.app.opentsdb.http.client.params + {"max.con":50,"max.tot.con":200,"sock.time.out":10000,"con.time.out":10000,"req.time.out":10000} + uav.app.gui.http.client.params {"max.con":5,"max.tot.con":20,"sock.time.out":10000,"con.time.out":10000,"req.time.out":10000} @@ -178,7 +179,7 @@ @url:uav.app.godeye.notify.view.http.addr http://127.0.0.1:9011,http://127.0.0.1:9011 - + @url:uav.app.godeye.notify.strategy.http.addr http://127.0.0.1:9004,http://127.0.0.1:9004 @@ -186,11 +187,11 @@ @url:uav.app.manage.apphubmanager.http.addr http://127.0.0.1:8031,http://127.0.0.1:8031 - + @url:uav.app.upgrade.server.http.addr http://127.0.0.1:8888 - + @url:uav.app.apm.ivc.http.addr http://127.0.0.1:7799,http://127.0.0.1:7799 @@ -222,7 +223,7 @@ uav.apphub.sso.guest.password guestAbc23781ADSKHbnwe - + uav.apphub.sso.implclass com.creditease.uav.apphub.sso.GUISSOLdapClient @@ -234,10 +235,6 @@ uav.apphub.sso.grafana.connection.info {"api.url":"http://127.0.0.1:3000","web.url":"http://uav.creditease.corp/datacenter","datasource.opentsdb.url":"http://127.0.0.1:4242","datasource.elasticsearch.url":"http://127.0.0.1:9300","authorization.loginId":"apiuser","authorization.loginPwd":"Uav!630admin","authorization.register.defPwd":"1q@W3e","authorization.register.sleep.time":"2000"} - - uav.app.opentsdb.http.client.params - {"max.con":50,"max.tot.con":200,"sock.time.out":10000,"con.time.out":10000,"req.time.out":10000} - uav.apphub.sso.white.list {"vipgroup":""} - - uav.app.opentsdb.http.client.params - {"max.con":50,"max.tot.con":200,"sock.time.out":10000,"con.time.out":10000,"req.time.out":10000} - + 30 diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/db.css b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/db.css deleted file mode 100644 index 0d26635f..00000000 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/db.css +++ /dev/null @@ -1,15 +0,0 @@ -.editor-input { - height: 23px; - border: 1px solid #ddd; - padding-left: 10px; - font-size: 13px; - border-radius: 3px; - width: 200px; -} -.editor-label { - width: 120px; - font-size: 14px; - line-height: 30px; - display: inline-block; - text-align: right; -} diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/uav.opentsdb.css b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/uav.agent.opentsdb.css similarity index 51% rename from com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/uav.opentsdb.css rename to com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/uav.agent.opentsdb.css index 5712019d..4e09dcd8 100644 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/uav.opentsdb.css +++ b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/css/uav.agent.opentsdb.css @@ -3,7 +3,6 @@ html { height: 100%; } - body { font-size: 14px; font-family: "微软雅黑"; @@ -14,41 +13,23 @@ body { text-align: center; height: 100%; } - .ListBG { background: white; color: black; font-size: 14px; } - .ObjectBG { font-size: 16px; color: #333333; background: white; } -.AppHubMVCSearchBarInputText { - width: 207px; - text-align: left; -} - .icon-myout { float: right; margin-top: -3px; margin-right: 15px; font-size: 2em; } - -.icon-myout:hover { - border-radius: 3px; - box-shadow: 0 0 4px 4px #fff; -} - - - - -/*详情页面布局 BEGIN*/ - .ObjectBG span{ word-break:break-all; white-space:normal ; @@ -61,11 +42,15 @@ body { word-wrap : break-word ; display:inline-block; } -.colon{ - color: #000000; - font-weight:bold; +.ObjectBG ul { + margin: 0 10px 0 10px; + text-align: left; + padding: 0px; } +.ObjectBG li { + list-style-type: none; +} .title-head { font-size: 16px; color: #ffffff; @@ -74,73 +59,56 @@ body { padding-bottom:12px; } -.titleH { - font-weight: bold; - color: #008040; +.editor-input { + height: 23px; + border: 1px solid #ddd; + padding-left: 10px; + font-size: 13px; + border-radius: 3px; + width: 90%; + resize:none; } - -.timeLH{ - font-weight: bold; - color: #ff0000; -} - - -.listBody li{ - color: #959595; - font-size: 14px; -} - -.listBdesc{ - color: #000000; - margin-left:10px; -} - -.ObjectBG ul { - margin: 0 10px 0 10px; +.title +{ text-align: left; - padding: 0px; -} - -.ObjectBG li { - list-style-type: none; + width: 15%; } - -.publicheadDiv { - color: #777; -} - -.publicheadDiv .tValue{ - color: #DC143C; +.userinput +{ + text-align: left; + width: 85%; } - -.listDiv { - margin-top:3px; - box-shadow: 0 0 0px 1px #009ad6; - font-size: 14px; - background: #FFFFE0; - margin-bottom:5px; +.icon-myout:hover { + border-radius: 3px; + box-shadow: 0 0 4px 4px #fff; } - -.listDiv .title { - font-size: 16px; - color:#fff; - padding-top:2px; - padding-bottom:2px; - background:#87CEEB; +.modal-header +{ + padding: 2px 2px; + padding-top: 2px; + padding-right: 15px; + padding-bottom: 2px; + padding-left: 15px; + border-bottom: 1px solid #eee; + text-align: left; + background-color: #337ab7; } - -.listDiv .argsTitle{ - margin-left:0px; - color: #DC143C; - !font-weight:bold; +.modal-footer { + padding: 2px 2px; } -.listDiv .argsSubTitle{ - margin-left:10px; - color: #6B8E23; +.modal-body { + position: relative; + max-height: 400px; + padding: 5px; + overflow-y: auto; } -.listDiv .argsSubValue { - color:#333; +.errorMsg +{ + color: red; + margin-right: 10px; } -/*详情页面布局 END*/ \ No newline at end of file +.pointer { + cursor : pointer; +} \ No newline at end of file diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/index.html b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/index.html index dd41b960..f7b1d0b6 100644 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/index.html +++ b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/index.html @@ -12,8 +12,7 @@ - - + @@ -36,9 +35,96 @@ + + + + + - - - + + \ No newline at end of file diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/confirm.js b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/confirm.js deleted file mode 100644 index e44fa7c7..00000000 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/confirm.js +++ /dev/null @@ -1,17 +0,0 @@ - -var modalConfig = { - head:"用户输入标题", - content:"用户输入验证信息", - callback:"clickSureCallback()" -}; - -function clickSureCallback(){ - console.log('adfadfadf'); -}; - -$("document").ready(function(){ - showConfirm(modalConfig); -}); - - - diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/db_manage.js b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/db_manage.js deleted file mode 100644 index 340b2b11..00000000 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/db_manage.js +++ /dev/null @@ -1,74 +0,0 @@ -var delmodalConfig = { - id :0, - head :"提示", - content :"", - callback :"clickSureCallback()" -} - -var addmodalConfig = { - id :0, - head :"添加", - content :"", - callback :"clickSureCallback_add()" -} - -var modifymodalConfig = { - id :0, - head :"修改", - content :"", - callback :"clickSureCallback_modify()" - } - -var opentsdb = { - name :'0', - url :'0', - version :'0' -} - -function clickSureCallback(){ - deleteDb_RESTClient(delmodalConfig.id); -} - -function userDelete(id,trObj){ - delmodalConfig.id=id; - delmodalConfig.content="是否确定删除["+trObj.getElementsByTagName("td")[0].id+"]"; - showConfirm(delmodalConfig); -} - -function userClickRow(v) { - queryDbById_RESTClient(v); -} - -function showDbById(data) { - modifymodalConfig.id = data[0].name; - modifymodalConfig.content=":
"; - modifymodalConfig.content+=":
"; - modifymodalConfig.content+=":
"; - showConfirm(modifymodalConfig); -} - -function clickSureCallback_modify() { - opentsdb.name = document.getElementById("opentsdb_name").value; - opentsdb.url = document.getElementById("opentsdb_url").value; - opentsdb.version = document.getElementById("opentsdb_version").value; - modifyDb_RESTClient(opentsdb); -} - -function ajaxGetdatas() { - loadDbs_RESTClient(); -} - -function addOpenTSDB() { - addmodalConfig.content=":
"; - addmodalConfig.content+=":
"; - addmodalConfig.content+=":
"; - showConfirm(addmodalConfig); -} - - -function clickSureCallback_add(){ - opentsdb.name = document.getElementById("opentsdb_name").value; - opentsdb.url = document.getElementById("opentsdb_url").value; - opentsdb.version = document.getElementById("opentsdb_version").value; - addDb_RESTClient(opentsdb); -} diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/dialog.js b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/dialog.js deleted file mode 100644 index 47f65a96..00000000 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/dialog.js +++ /dev/null @@ -1,12 +0,0 @@ - -var modalConfig = { - head:"用户输入标题", - content:"用户输入提示信息" -}; - -$("document").ready(function(){ - showDialog(modalConfig); -}); - - - diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/list_manage.js b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/list_manage.js new file mode 100644 index 00000000..0f784387 --- /dev/null +++ b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/list_manage.js @@ -0,0 +1,268 @@ +var url = "../../rs/db/"; +var list = null; + +var delmodalConfig = { + head :"提示", + content :"", + callback :"clickSureCallback_del()" +}; + +var addmodalConfig = { + head :"添加", + content :"", + callback :"clickSureCallback_add()" +}; + +var modifymodalConfig = { + head :"修改", + content :"", + callback :"clickSureCallback_modify()" +}; + +var opentsdbmodalConfig = { + name :'0', + url :'0', + version :'0' +}; + +function ListManage() { + + var pageNum; + var pageSize; + + this.deleteDb_RESTClient = function(name) { + + var data={"name":name}; + var subUrl = "delDb"; + lm.invokeAjaxFunction(subUrl, JSON.stringify(data), "POST", lm.delSuccessFunc, lm.delErrorFunc); + } + + this.modifyDb_RESTClient = function(data) { + + //验证 + var name = data.name; + var url_modify = data.url; + var version_modify = data.version; + + var matchString = "(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"; + if(url_modify.match(matchString) == null) { + showErrMsg("请输入正确格式的URL","modify", data); + return; + } + + var datas = { + "name" : name, + "url" : url_modify, + "version" : version_modify + }; + + var subUrl = "modifyDb"; + lm.invokeAjaxFunction(subUrl, JSON.stringify(datas), "POST", lm.modifySuccessFunc, lm.modifyErrorFunc); + } + + this.addDb_RESTClient = function(data) { + + //验证 + var name_add = data.name; + var url_add = data.url; + var version_add = data.version; + + if(null == name_add || name_add == "") { + showErrMsg("请输入名称", "add", data); + return; + } + + var matchString = "(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"; + if(url_add.match(matchString) == null) { + showErrMsg("请输入正确格式的URL", "add", data); + return; + } + + var datas = { + "name" : name_add, + "url" : url_add, + "version" : version_add + }; + + var subUrl = 'addDb'; + lm.invokeAjaxFunction(subUrl, JSON.stringify(datas), "POST", lm.addSuccessFunc, lm.addErrorFunc); + } + + this.queryDbById_RESTClient = function(db_name) { + + var subUrl = "queryDb"; + var data = { "name" : db_name }; + lm.invokeAjaxFunction(subUrl, data, "GET", lm.querySuccessFunc, lm.queryErrorFunc); + } + + this.loadDbs_RESTClient = function() { + + var subUrl = "loadDbs"; + lm.invokeAjaxFunction(subUrl, null, "GET", lm.loadSuccessFunc, lm.loadErrorFunc); + } + + this.showOpenTSDBById = function(data) { + + document.getElementById("OpenTSDBModifyName").value = data[0].name; + document.getElementById("OpenTSDBModifyURL").value = data[0].url; + document.getElementById("OpenTSDBModifyVersion").value = data[0].version; + $('#OpenTSDBModifyModal').modal({ + backdrop : 'static', + keyboard : false}); + + } + + this.showOpenTSDBList = function(data, list) { + + list = new Array(); + var href = location.href; + href = href.substring(0, href.indexOf("uavapp_baseclassmgt")); + for(var i=0; i"+data[i].url+"", + version :data[i].version, + }; + list.push(row); + } + + var count = list.length; + + //清空数据 + table.clearTable(); + //必须先显示分页 + table.setTotalRow(count); + lm.getPageParam(); + //然后添加数据 + $.each(list, function(index, obj) { + if(index >=(pageNum-1)*pageSize && index"); + div.append(''); + + div.append(''); + div.append(''); + div.append(''); + + div.append('
'); + div.append(''); + + div.append(''); + div.append('
'); + div.append(''); + + HtmlHelper.id("notifyList").innerHTML += div.toString(); + +}; + +function loadDescDiv(href, ip) { + + var url = href+"db2?url="+ip; + var sb=new StringBuffer(); + sb.append("
"); + sb.append(""+ip+""); + sb.append("
"); + sb.append("
"); + sb.append(""); + $('#descDiv').html(sb.toString()); + showDescDiv(); +}; + +function showDescDiv() { + + window.winmgr.show("descDiv"); + window.winmgr.hide("notifyList"); +}; + +function showNotifyList() { + + window.winmgr.hide("descDiv"); + window.winmgr.show("notifyList"); +}; + +function showErrMsg(val,id,data) { + + var v; + console.log(val); + if (id == "add") { + v = document.getElementById("errorAddMsg"); + } else if(id == "modify") { + v = document.getElementById("errorModifyMsg"); + } else if(id == "del"){ + v = document.getElementById("errorDelMsg"); + } else if(id == null){ + alert(val); + return; + } else { + return; + } + v.style.display=""; + v.innerText = val; +}; + +function initErrMsg(id) { + + var v; + if (id == "add") { + v = document.getElementById("errorAddMsg"); + } else if(id == "modify") { + v = document.getElementById("errorModifyMsg"); + } else if(id == "del"){ + v = document.getElementById("errorDelMsg"); + } else { + return; + } + v.style.display="none"; + v.innerText = ""; +}; + +function closeModal(id) { + + initErrMsg(id); + if(id == "add") { + $('#OpenTSDBAddModal').modal('hide'); + document.getElementById("OpenTSDBAddName").value = ""; + document.getElementById("OpenTSDBAddURL").value = ""; + document.getElementById("OpenTSDBAddVersion").value = ""; + } else if(id == "modify") { + $('#OpenTSDBModifyModal').modal('hide'); + } else if(id == "del") { + $('#OpenTSDBDelModal').modal('hide'); + } +}; + +var index_id; + +var listConfig = { + + id:"list", + pid:"notifyList", + openDelete:true, + key:"id", + pagerSwitchThreshold:600, + pagesize : 5, + head:{ + id : ['实例名称', '25%'], + dburl : ['URL'], + version : ['版本编号', '25%'] + }, + cloHideStrategy:{ + 1000 :[0,1,2], + 500 :[0,1], + 400 :[0,1] + }, + events:{ + onRow : function(index, value) { + switch(index) { + case 0: + index_id = value; + case 2: + return clickTab(index_id, value); + case 1: + return value; + } + + } + + } +}; + +function clickTab(id, value) { + + if(null == value || value == "") { + value = "NULL"; + } + var res = "
"+value+"
"; + return res; +}; + +function changeFrameHeight() { + + var ifm= document.getElementById("opentsdb_frame"); + try{ + var bHeight = ifm.contentWindow.document.body.scrollHeight; + var dHeight = ifm.contentWindow.document.documentElement.scrollHeight; + var height = Math.max(bHeight, dHeight); + ifm.height = height; + }catch (ex){ + + } + window.setInterval("changeFrameHeight()", 100); + + window.onresize=function(){ + changeFrameWidth(); + } + +}; + +function changeFrameWidth() { + + var ifm= document.getElementById("opentsdb_frame"); + try{ + var bWidth = ifm.contentWindow.document.body.scrollWidth; + var dWidth = ifm.contentWindow.document.documentElement.scrollWidth; + var width = Math.max(bWidth, dWidth); + ifm.width = width; + }catch (ex){ + + } +}; + +function changeFrameHeightAndWidth() { + + changeFrameHeight(); + changeFrameWidth(); +}; + +function deleteOpenTSDBById(id,trObj){ + + document.getElementById("OpenTSDBDelName").innerText = trObj.getElementsByTagName("td")[0].id; + $('#OpenTSDBDelModal').modal({ + backdrop : 'static', + keyboard : false}); +}; + +function loadOpenTSDBList() { + lm.loadDbs_RESTClient(); +}; + +function clickTabForQuery(v) { + lm.queryDbById_RESTClient(v); +}; + +function addOpenTSDBInfo() { + + $('#OpenTSDBAddModal').modal({ + backdrop : 'static', + keyboard : false}); +}; + +function searchEvent(){ + + table.setPageNum(1); + var input = $("#AppManagerSearchBar_keyword").val(); + lm.searchDbs_RESTClient(input); +}; + +function searchAllEvent(){ + + table.setPageNum(1); + var input = ""; + lm.searchDbs_RESTClient(input); +}; + +var table= new AppHubTable(listConfig); + +$(document).ready(function() { + + initBody(); + table.delRowUser = deleteOpenTSDBById; + table.sendRequest = loadOpenTSDBList; + table.initTable(); +}); \ No newline at end of file diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/table.js b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/table.js deleted file mode 100644 index 0f378a5b..00000000 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/table.js +++ /dev/null @@ -1,260 +0,0 @@ -var url = "../../db/"; - -var nameConfig = { - head:"验证失败", - content:"请输入名称" -}; -var nameMultiConfig = { - head:"添加失败", - content:"此名称已存在" -}; -var urlConfig = { - head:"验证失败", - content:"请输入正确格式的URL" -}; -function deleteDb_RESTClient(id) { - var getPagingInfo = table.getPagingInfo(); - var pageNum = getPagingInfo.pageNum; - var pageSize = getPagingInfo.pageSize; - var data = { - "name" : id - }; - AjaxHelper.call({ - url : url + "delDb", - data : JSON.stringify(data), - async : true, - cache : false, - type : "POST", - contentType : "application/json; charset=utf-8", - success : function(data) { - if (data) { - data = eval(data); - //当前页数据为空 自动退一页 - if(data.length == (pageNum-1)*pageSize) { - table.setPageNum(pageNum-1); - } - ajaxGetdatas(); - - } else { - alert("删除OpenTSDB实例"+id+"返回值为空"); - } - }, - error : function(data) { - alert("删除OpenTSDB实例"+id+"失败:"+data); - }, - }); -} - -function modifyDb_RESTClient(data) { - - var data = { - "name" : data.name, - "url": data.url, - "version": data.version - }; - AjaxHelper.call({ - url : url + "modifyDb", - data : JSON.stringify(data), - async : true, - cache : false, - type : "POST", - contentType : "application/json; charset=utf-8", - success : function(data) { - if (data) { - ajaxGetdatas(); - } else { - alert("修改OpenTSDB实例"+data.name+"返回值为空"); - } - }, - error : function(data) { - alert("修改OpenTSDB实例"+data.name+"失败:"+data); - }, - }); -} - -function addDb_RESTClient(data) { - - //验证 - var name = data.name; - var url_add = data.url; - var version = data.version; - - if(null == name || name == "") { - showDialog(nameConfig); - return; - } - - var matchString = "(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"; - if(url_add.match(matchString) == null) { - showDialog(urlConfig); - return; - } - - var datas = { - "name" : name, - "url": url_add, - "version": version - }; - AjaxHelper.call({ - url : url + "addDb", - data : JSON.stringify(datas), - async : true, - cache : false, - type : "POST", - contentType : "application/json; charset=utf-8", - success : function(data) { - - if(data == "multi_name") { - showDialog(nameMultiConfig); - return; - } - - data = eval(data); - if (data) { - ajaxGetdatas(); - } else { - alert("添加OpenTSDB实例"+name+"返回值为空"); - } - }, - error : function(data) { - alert("添加OpenTSDB实例"+name+"失败:"+data); - }, - }); -} - -function queryDbById_RESTClient(db_name) { - - var data = { - "name" : db_name - }; - AjaxHelper.call({ - url : url + "queryDb", - data : JSON.stringify(data), - async : true, - cache : false, - type : "POST", - contentType : "application/json; charset=utf-8", - success : function(data) { - data = eval(data); - if (data) { - showDbById(data); - } else { - alert("加载OpenTSDB实例"+db_name+"为空"); - } - }, - error : function(data) { - }, - }); -} - -function loadDbs_RESTClient() { - - var datas = new Array(),number=10; - AjaxHelper.call({ - url : url + "loadDbs", - async : true, - cache : false, - type : "GET", - contentType : "application/json; charset=utf-8", - success : function(data) { - - data = eval(data); - showDb(data,datas); - }, - error : function(data) { - alert("加载OpenTSDB实例列表失败: "+data); - }, - }); -} - -function searchDbs_RESTClient(input) { - - var getPagingInfo = table.getPagingInfo(); - var datas = new Array(),number=10; - - var data = { - "url" : input, - "pageindex" : getPagingInfo.pageNum, - "pagesize" : getPagingInfo.pageSize - }; - AjaxHelper.call({ - url : url + "searchDbs", - data : JSON.stringify(data), - async : true, - cache : false, - type : "POST", - contentType : "application/json; charset=utf-8", - success : function(data) { - data = eval(data); - showDb(data,datas); - }, - error : function(data) { - alert("查询失败:"+data); - }, - }); -}; - -function userClickRow(key){ - showDialog(modalConfig); -}; -var pageNum; -var pageSize; -function getPageParam(){ - var getPagingInfo = table.getPagingInfo(); - pageNum = getPagingInfo.pageNum; - pageSize = getPagingInfo.pageSize - console.log("pageNum:"+pageNum); - console.log("pageSize:"+pageSize); -} - -function showDb(data,datas) { - var href = location.href; - href = href.substring(0, href.indexOf("uavapp_baseclassmgt")); - for(var i=0; i"+data[i].url+"", - type:data[i].type, - access:data[i].access, - version:data[i].version, - }; - datas.push(row); - } - - var count = datas.length; - - //清空数据 - table.clearTable(); - //必须先显示分页 - table.setTotalRow(count); - getPageParam(); - //然后添加数据 - $.each(datas, function(index, obj) { - if(index >=(pageNum-1)*pageSize && index"); - sb.append(""+ip+""); - sb.append("
"); - sb.append(""); - sb.append(""); - $('#descDiv').html(sb.toString()); - showDescDiv(); -} - -function showDescDiv() { - window.winmgr.show("descDiv"); - window.winmgr.hide("notifyList"); -} - -function showNotifyList() { - window.winmgr.hide("descDiv"); - window.winmgr.show("notifyList"); -} \ No newline at end of file diff --git a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/uav.opentsdb.js b/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/uav.opentsdb.js deleted file mode 100644 index b454f795..00000000 --- a/com.creditease.uav.console/src/main/webapp/uavapp_baseclassmgt/dbhead/js/uav.opentsdb.js +++ /dev/null @@ -1,143 +0,0 @@ - -/** - * TODO 窗体初始化,必须在body后面加载,因为窗口容器会追加到body - */ -window.winmgr.build({ - id : "notifyList", - height : "auto", - "overflow-y" : "auto", - order : 999, - theme : "ListBG" -}); -window.winmgr.build({ - id : "descDiv", - height : "auto", - "overflow-y" : "auto", - order : 999, - theme : "ObjectBG" -}); -window.winmgr.show("notifyList"); - -function initBody() { - var div = new StringBuffer(); - - div.append("
"); - div.append(''); - - div.append(''); - div.append(''); - div.append(''); - - div.append('
'); - div.append(''); - - div.append(''); - div.append('
'); - div.append('
'); - - HtmlHelper.id("notifyList").innerHTML += div.toString(); -} - -function searchEvent(){ - table.setPageNum(1); - var input = $("#AppManagerSearchBar_keyword").val(); - searchDbs_RESTClient(input); -}; - -function searchAllEvent(){ - table.setPageNum(1); - var input = ""; - searchDbs_RESTClient(input); -}; - -/** - * 列表配置 - */ -var index_id; -var listConfig = { - - id:"list", - pid:"notifyList", - openDelete:true, - key:"id", - pagerSwitchThreshold:600, - pagesize : 5, - head:{ - id : ['实例名称', '15%'], - dburl : ['URL'], - version : ['版本号', '15%'] - }, - cloHideStrategy:{ - 1000:[0,1,2], - 500:[0,1], - 400:[1] - }, - events:{ - onRow : function(index, value) { - switch(index) { - case 0: - index_id = value; - case 2: - return setOnClick(index_id, value); - break; - case 1: - return value; - } - - } - - } -}; -function setOnClick(id, value) { - if(null == value || value == "") { - value = "NULL"; - } - var res = "
"+value+"
"; - return res; -} - -function changeFrameHeight() { - - var ifm= document.getElementById("opentsdb_frame"); - try{ - var bHeight = ifm.contentWindow.document.body.scrollHeight; - var dHeight = ifm.contentWindow.document.documentElement.scrollHeight; - var height = Math.max(bHeight, dHeight); - ifm.height = height; - }catch (ex){} - window.setInterval("changeFrameHeight()", 100); - window.onresize=function(){ - changeFrameWidth(); - - } -} - -function changeFrameWidth() { - var ifm= document.getElementById("opentsdb_frame"); - var head = document.getElementById("opentsdb_head"); - try{ - var wWidth = window.document.body.offsetWidth; - var bWidth = ifm.contentWindow.document.body.scrollWidth; - var dWidth = ifm.contentWindow.document.documentElement.scrollWidth; - var width = Math.max(bWidth, dWidth, wWidth); - ifm.width = width; - }catch (ex){} -} - -function changeFrameHeightAndWidth() { - changeFrameHeight(); - changeFrameWidth(); -} -var table= new AppHubTable(listConfig); -$(document).ready(function() { - initBody(); - table.delRowUser = userDelete; //Config the delete function of user - table.sendRequest = ajaxGetdatas; - table.initTable(); -}); diff --git a/com.creditease.uav.hook.mq/src/main/java/com/creditease/uav/hook/rabbitmq/interceptors/RabbitmqIT.java b/com.creditease.uav.hook.mq/src/main/java/com/creditease/uav/hook/rabbitmq/interceptors/RabbitmqIT.java index 90e811fc..6802f694 100644 --- a/com.creditease.uav.hook.mq/src/main/java/com/creditease/uav/hook/rabbitmq/interceptors/RabbitmqIT.java +++ b/com.creditease.uav.hook.mq/src/main/java/com/creditease/uav/hook/rabbitmq/interceptors/RabbitmqIT.java @@ -165,7 +165,8 @@ public void preProcess(Channel t, Object proxy, Method method, Object[] args) { ivcContextParams = (Map) UAVServer.instance().runSupporter( "com.creditease.uav.apm.supporters.InvokeChainSupporter", "runCap", InvokeChainConstants.CHAIN_APP_CLIENT, InvokeChainConstants.CapturePhase.PRECAP, params, - RabbitmqProducerAdapter.class, new Object[] { (BasicProperties) args[2], args[3] }); + RabbitmqProducerAdapter.class, + new Object[] { (BasicProperties) args[args.length - 2], args[args.length - 1] }); if (ivcContextParams != null && ivcContextParams.containsKey(InvokeChainConstants.PARAM_MQHEAD_INFO)) { args[2] = ivcContextParams.get(InvokeChainConstants.PARAM_MQHEAD_INFO); diff --git a/com.creditease.uav.monitorframework.agent/src/main/java/com/creditease/uav/monitorframework/adaptors/SpringBootTomcatAdaptor.java b/com.creditease.uav.monitorframework.agent/src/main/java/com/creditease/uav/monitorframework/adaptors/SpringBootTomcatAdaptor.java index 2a6632de..cc2dac9e 100644 --- a/com.creditease.uav.monitorframework.agent/src/main/java/com/creditease/uav/monitorframework/adaptors/SpringBootTomcatAdaptor.java +++ b/com.creditease.uav.monitorframework.agent/src/main/java/com/creditease/uav/monitorframework/adaptors/SpringBootTomcatAdaptor.java @@ -104,7 +104,7 @@ public void process(CtMethod m) throws Exception { aa.addLocalVar(m, "mObj", "com.creditease.tomcat.plus.interceptor.SpringBootTomcatPlusIT"); m.insertBefore( - "{mObj=new SpringBootTomcatPlusIT();mObj.startServer(this.getEnvironment().getProperty(\"server.port\"),this.getEnvironment().getProperty(\"server.context-path\"));}"); + "{mObj=new SpringBootTomcatPlusIT();mObj.startServer(this.getEnvironment().getProperty(\"server.port\"),this.getEnvironment().getProperty(\"server.context-path\"),this);}"); } @Override diff --git a/com.creditease.uav.tomcat.plus.core/src/main/java/com/creditease/tomcat/plus/interceptor/SpringBootTomcatPlusIT.java b/com.creditease.uav.tomcat.plus.core/src/main/java/com/creditease/tomcat/plus/interceptor/SpringBootTomcatPlusIT.java index 8b5a4337..a34181af 100644 --- a/com.creditease.uav.tomcat.plus.core/src/main/java/com/creditease/tomcat/plus/interceptor/SpringBootTomcatPlusIT.java +++ b/com.creditease.uav.tomcat.plus.core/src/main/java/com/creditease/tomcat/plus/interceptor/SpringBootTomcatPlusIT.java @@ -43,8 +43,11 @@ public class SpringBootTomcatPlusIT extends TomcatPlusIT { /** * startUAVServer */ - public void startServer(String port, String contextPath) { + public void startServer(String port, String contextPath, Object arg) { + if (!"AnnotationConfigEmbeddedWebApplicationContext".equals(arg.getClass().getSimpleName())) { + return; + } // integrate Tomcat log UAVServer.instance().setLog(new TomcatLog("MonitorServer")); // start Monitor Server when server starts @@ -313,10 +316,10 @@ public void onAppStop(Object... args) { } /** - * NOTE: spring boot rewrite the tomcat webappclassloader, makes the addURL for nothing, then we can't do - * anything on this we may use its webappclassloader's parent as the classloader + * NOTE: spring boot will reset tomcat webappclassloader to null when shutdown, we may use the currentThread's + * classloader as the classloader */ - context.put(InterceptConstants.WEBAPPLOADER, sc.getLoader().getClassLoader().getParent()); + context.put(InterceptConstants.WEBAPPLOADER, Thread.currentThread().getContextClassLoader()); context.put(InterceptConstants.WEBWORKDIR, sc.getWorkPath()); String contextPath = (String) ReflectHelper.getField(StandardContext.class, sc, "encodedPath", true); @@ -383,6 +386,9 @@ public void onServletStop(Object... args) { */ public void onSpringBeanRegist(String contextPath) { + if (contextPath == null) { + contextPath = ""; + } InterceptSupport iSupport = InterceptSupport.instance(); InterceptContext context = iSupport.createInterceptContext(Event.SPRING_BEAN_REGIST); context.put(InterceptConstants.WEBAPPLOADER, Thread.currentThread().getContextClassLoader());