mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixes activeConnectionStackTrace.html didn't show data issue
This commit is contained in:
@@ -1,61 +1,66 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Druid ActiveConnection StackTrace</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
|
||||
<link href='css/bootstrap.min.css' rel="stylesheet" />
|
||||
<link href="css/style.css" type="text/css" rel="stylesheet"/>
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script src="js/common.js" type="text/javascript" charset="utf8"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<h2>ActiveConnection StackTrace for Datasource
|
||||
<a href="activeConnectionStackTrace-{datasourceId}.json" target="_blank">[View JSON API]</a>
|
||||
</h2>
|
||||
<div id="activeConnectionStackTraceDiv">
|
||||
<table id="activeConnectionStackTraceTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$.namespace("druid.activeConnectionStackTrace");
|
||||
druid.activeConnectionStackTrace = function () {
|
||||
var datasourceId = druid.common.getUrlVar("datasourceId");
|
||||
return {
|
||||
init : function() {
|
||||
druid.activeConnectionStackTrace.ajaxRequestForActiveConnectionStackTrace();
|
||||
var time2=setInterval("druid.activeConnectionStackTrace.ajaxRequestForActiveConnectionStackTrace();",2000);
|
||||
},
|
||||
|
||||
ajaxRequestForActiveConnectionStackTrace : function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'activeConnectionStackTrace-' + datasourceId + '.json',
|
||||
success: function(data) {
|
||||
var conntionStackTraceList = data.Content;
|
||||
/* if (conntionStackTraceList == null)
|
||||
return;
|
||||
<head>
|
||||
<title>Druid ActiveConnection StackTrace</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
|
||||
<link href='css/bootstrap.min.css' rel="stylesheet" />
|
||||
<link href="css/style.css" type="text/css" rel="stylesheet"/>
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script src="js/common.js" type="text/javascript" charset="utf8"></script>
|
||||
</head>
|
||||
<body onload="init();">
|
||||
<div class="container-fluid">
|
||||
<h2>ActiveConnection StackTrace for Datasource
|
||||
<a href="activeConnectionStackTrace-{datasourceId}.json" target="_blank">[View JSON API]</a>
|
||||
</h2>
|
||||
<div id="activeConnectionStackTraceDiv">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function init() {
|
||||
druid.common.buildHead(7);
|
||||
}
|
||||
$.namespace("druid.activeConnectionStackTrace");
|
||||
druid.activeConnectionStackTrace = function () {
|
||||
var datasourceId = druid.common.getUrlVar("datasourceId");
|
||||
return {
|
||||
init : function() {
|
||||
druid.activeConnectionStackTrace.ajaxRequestForActiveConnectionStackTrace();
|
||||
var time2=setInterval("druid.activeConnectionStackTrace.ajaxRequestForActiveConnectionStackTrace();",8000);
|
||||
},
|
||||
|
||||
ajaxRequestForActiveConnectionStackTrace : function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'activeConnectionStackTrace-' + datasourceId + '.json',
|
||||
success: function(data) {
|
||||
var conntionStackTraceList = data.Content;
|
||||
if (conntionStackTraceList == null)
|
||||
return;
|
||||
|
||||
var activeConnectionStackTraceTable = document.getElementById("activeConnectionStackTraceTable");
|
||||
while (activeConnectionStackTraceTable.rows.length > 0) {
|
||||
activeConnectionStackTraceTable.deleteRow(0);
|
||||
}
|
||||
for ( var i = 0; i < conntionStackTraceList.length; i++) {
|
||||
var conntionStackTrace = conntionStackTraceList[i];
|
||||
var newRow = activeConnectionStackTraceTable.insertRow(-1);
|
||||
newRow.insertCell(-1).innerHTML = conntionStackTrace;
|
||||
} */
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
}
|
||||
}
|
||||
}();
|
||||
var content = [];
|
||||
|
||||
$(document).ready(function() {
|
||||
druid.activeConnectionStackTrace.init();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
for ( var i = 0; i < conntionStackTraceList.length; i++) {
|
||||
if (i > 0) {
|
||||
content.push("<br>");
|
||||
}
|
||||
var conntionStackTrace = conntionStackTraceList[i];
|
||||
content.push("<textarea rows='15' style='width:680px;' >");
|
||||
content.push(conntionStackTrace);
|
||||
content.push("</textarea>");
|
||||
}
|
||||
$("#activeConnectionStackTraceDiv").html(content.join(""));
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
$(document).ready(function() {
|
||||
druid.activeConnectionStackTrace.init();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user