From ff5d88728d04f52afd48859f476280708987a016 Mon Sep 17 00:00:00 2001 From: lujianbo <387852424@qq.com> Date: Thu, 1 Aug 2013 22:43:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/http/resources/js/common.js | 13 +++++ .../support/http/resources/spring.html | 20 +++---- .../resources/support/http/resources/sql.html | 18 +++---- .../support/http/resources/wall.html | 52 ++++++++----------- .../support/http/resources/websession.html | 26 +++++----- .../support/http/resources/weburi.html | 22 ++++---- 6 files changed, 77 insertions(+), 74 deletions(-) diff --git a/src/main/resources/support/http/resources/js/common.js b/src/main/resources/support/http/resources/js/common.js index d365e5bbf8..77349ca057 100644 --- a/src/main/resources/support/http/resources/js/common.js +++ b/src/main/resources/support/http/resources/js/common.js @@ -169,3 +169,16 @@ druid.common = function () { $(document).ready(function() { druid.common.init(); }); + +function replace (data) { + if((!data)||data === undefined){ + return ''; + }else{ + return format(data); + } +} + +function format(s) { + var str=s+=''; + return str.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,"); +} \ No newline at end of file diff --git a/src/main/resources/support/http/resources/spring.html b/src/main/resources/support/http/resources/spring.html index 6bfc26f180..dc6ba5c771 100644 --- a/src/main/resources/support/http/resources/spring.html +++ b/src/main/resources/support/http/resources/spring.html @@ -73,16 +73,16 @@ html += "" + (i + 1) + ""; html += "" + stat.Class + ""; html += "" + '' + stat.Method + '' + ""; - html += "" + stat.ExecuteCount + ""; - html += "" + stat.ExecuteTimeMillis + ""; - html += "" + stat.RunningCount + ""; - html += "" + stat.ConcurrentMax + ""; - html += "" + stat.JdbcExecuteCount + ""; - html += "" + stat.JdbcExecuteTimeMillis + ""; - html += "" + stat.JdbcCommitCount + ""; - html += "" + stat.JdbcRollbackCount + ""; - html += "" + stat.JdbcFetchRowCount + ""; - html += "" + stat.JdbcUpdateCount + ""; + html += "" + replace(stat.ExecuteCount) + ""; + html += "" + replace(stat.ExecuteTimeMillis) + ""; + html += "" + replace(stat.RunningCount) + ""; + html += "" + replace(stat.ConcurrentMax) + ""; + html += "" + replace(stat.JdbcExecuteCount) + ""; + html += "" + replace(stat.JdbcExecuteTimeMillis) + ""; + html += "" + replace(stat.JdbcCommitCount) + ""; + html += "" + replace(stat.JdbcRollbackCount) + ""; + html += "" + replace(stat.JdbcFetchRowCount) + ""; + html += "" + replace(stat.JdbcUpdateCount) + ""; html += ""; } $("#dataTable tbody").html(html); diff --git a/src/main/resources/support/http/resources/sql.html b/src/main/resources/support/http/resources/sql.html index 7314583523..57a1f8e68d 100644 --- a/src/main/resources/support/http/resources/sql.html +++ b/src/main/resources/support/http/resources/sql.html @@ -108,20 +108,20 @@ html += ""; html += "" + (i + 1) + ""; html += "" + '' + druid.common.subSqlString(stat.SQL, 25) + '' + ""; - html += "" + stat.ExecuteCount + ""; - html += "" + stat.TotalTime + ""; + html += "" + replace(stat.ExecuteCount) + ""; + html += "" + replace(stat.TotalTime) + ""; var lastSlowHtml = stat.MaxTimespan; if (stat.LastSlowParameters!=null && stat.LastSlowParameters.length>0) { lastSlowHtml =''+stat.MaxTimespan+''; } - html += "" + lastSlowHtml + ""; - html += "" + stat.InTransactionCount + ""; - html += "" + stat.ErrorCount + ""; - html += "" + stat.EffectedRowCount + ""; - html += "" + stat.FetchRowCount + ""; - html += "" + stat.RunningCount + ""; - html += "" + stat.ConcurrentMax + ""; + html += "" + replace(lastSlowHtml) + ""; + html += "" + replace(stat.InTransactionCount) + ""; + html += "" + replace(stat.ErrorCount) + ""; + html += "" + replace(stat.EffectedRowCount) + ""; + html += "" + replace(stat.FetchRowCount) + ""; + html += "" + replace(stat.RunningCount) + ""; + html += "" + replace(stat.ConcurrentMax) + ""; html += "" + '[' + stat.Histogram + ']' + ""; html += "" + '[' + stat.ExecuteAndResultHoldTimeHistogram + ']' + ""; html += "" + '[' + stat.FetchRowCountHistogram + ']' + ""; diff --git a/src/main/resources/support/http/resources/wall.html b/src/main/resources/support/http/resources/wall.html index ad385195c0..320c526d34 100644 --- a/src/main/resources/support/http/resources/wall.html +++ b/src/main/resources/support/http/resources/wall.html @@ -173,17 +173,17 @@ }, handleAjaxResult : function(data) { - $("#CheckCount").text(data.Content.checkCount) - $("#HardCheckCount").text(data.Content.hardCheckCount) - $("#ViolationCount").text(data.Content.violationCount) + $("#CheckCount").text(format(data.Content.checkCount)) + $("#HardCheckCount").text(replace(data.Content.hardCheckCount)) + $("#ViolationCount").text(replace(data.Content.violationCount)) $("#BlackListHitCount") - .text(data.Content.blackListHitCount) - $("#BlackListSize").text(data.Content.blackListSize) + .text(replace(data.Content.blackListHitCount)) + $("#BlackListSize").text(replace(data.Content.blackListSize)) $("#WhiteListHitCount") - .text(data.Content.whiteListHitCount) - $("#WhiteListSize").text(data.Content.whiteListSize) + .text(replace(data.Content.whiteListHitCount)) + $("#WhiteListSize").text(replace(data.Content.whiteListSize)) $("#SyntaxErrrorCount") - .text(data.Content.syntaxErrrorCount) + .text(replace(data.Content.syntaxErrrorCount)) var html = ""; var tables = data.Content.tables; @@ -193,43 +193,33 @@ html += ""; html += "" + table.name + ""; html += "" - + (table.selectCount ? table.selectCount : '') + ""; + + replace(table.selectCount) + ""; html += "" - + (table.selectIntoCount ? table.selectIntoCount - : '') + ""; + + replace(table.selectIntoCount) + ""; html += "" - + (table.insertCount ? table.insertCount - : '') + ""; + + replace(table.insertCount) + ""; html += "" - + (table.updateCount ? table.updateCount - : '') + ""; + + replace(table.updateCount) + ""; html += "" - + (table.deleteCount ? table.deleteCount - : '') + ""; + + replace(table.deleteCount) + ""; html += "" - + (table.truncateCount ? table.truncateCount - : '') + ""; + + replace(table.truncateCount) + ""; html += "" - + (table.createCount ? table.createCount - : '') + ""; + + replace(table.createCount) + ""; html += "" - + (table.alterCount ? table.alterCount : '') + + replace(table.alterCount) + ""; html += "" - + (table.dropCount ? table.dropCount : '') + + replace(table.dropCount) + ""; html += "" - + (table.replaceCount ? table.replaceCount - : '') + ""; + + replace(table.replaceCount) + ""; html += "" - + (table.deleteDataCount ? table.deleteDataCount - : '') + ""; + + replace(table.deleteDataCount) + ""; html += "" - + (table.updateDataCount ? table.updateDataCount - : '') + ""; + + replace(table.updateDataCount) + ""; html += "" - + (table.fetchRowCount ? table.fetchRowCount - : '') + ""; + + replace(table.fetchRowCount)+ ""; html += ""; } $("#dataTable1 tbody").html(html); diff --git a/src/main/resources/support/http/resources/websession.html b/src/main/resources/support/http/resources/websession.html index 9f93312e88..8bcd78d28c 100644 --- a/src/main/resources/support/http/resources/websession.html +++ b/src/main/resources/support/http/resources/websession.html @@ -80,19 +80,19 @@ } else { html += ""; } - html += "" + stat.CreateTime + ""; - html += "" + stat.LastAccessTime + ""; - html += "" + stat.RemoteAddress + ""; - html += "" + stat.RequestCount + ""; - html += "" + stat.RequestTimeMillisTotal + ""; - html += "" + stat.RunningCount + ""; - html += "" + stat.ConcurrentMax + ""; - html += "" + stat.JdbcExecuteCount + ""; - html += "" + stat.JdbcExecuteTimeMillis + ""; - html += "" + stat.JdbcCommitCount + ""; - html += "" + stat.JdbcRollbackCount + ""; - html += "" + stat.JdbcFetchRowCount + ""; - html += "" + stat.JdbcUpdateCount + ""; + html += "" + replace(stat.CreateTime) + ""; + html += "" + replace(stat.LastAccessTime) + ""; + html += "" + replace(stat.RemoteAddress) + ""; + html += "" + replace(stat.RequestCount) + ""; + html += "" + replace(stat.RequestTimeMillisTotal) + ""; + html += "" + replace(stat.RunningCount) + ""; + html += "" + replace(stat.ConcurrentMax) + ""; + html += "" + replace(stat.JdbcExecuteCount) + ""; + html += "" + replace(stat.JdbcExecuteTimeMillis) + ""; + html += "" + replace(stat.JdbcCommitCount) + ""; + html += "" + replace(stat.JdbcRollbackCount) + ""; + html += "" + replace(stat.JdbcFetchRowCount) + ""; + html += "" + replace(stat.JdbcUpdateCount) + ""; html += ""; } $("#dataTable tbody").html(html); diff --git a/src/main/resources/support/http/resources/weburi.html b/src/main/resources/support/http/resources/weburi.html index 25f95ab9fd..7171360af7 100644 --- a/src/main/resources/support/http/resources/weburi.html +++ b/src/main/resources/support/http/resources/weburi.html @@ -74,17 +74,17 @@ html += ""; html += "" + (i + 1) + ""; html += "" + '' + druid.common.subSqlString(stat.URI, 64) + '' + ""; - html += "" + stat.RequestCount + ""; - html += "" + stat.RequestTimeMillis + ""; - html += "" + stat.RunningCount + ""; - html += "" + stat.ConcurrentMax + ""; - html += "" + stat.JdbcExecuteCount + ""; - html += "" + stat.JdbcExecuteErrorCount + ""; - html += "" + stat.JdbcExecuteTimeMillis + ""; - html += "" + stat.JdbcCommitCount + ""; - html += "" + stat.JdbcRollbackCount + ""; - html += "" + stat.JdbcFetchRowCount + ""; - html += "" + stat.JdbcUpdateCount + ""; + html += "" + replace(stat.RequestCount) + ""; + html += "" + replace(stat.RequestTimeMillis) + ""; + html += "" + replace(stat.RunningCount) + ""; + html += "" + replace(stat.ConcurrentMax) + ""; + html += "" + replace(stat.JdbcExecuteCount) + ""; + html += "" + replace(stat.JdbcExecuteErrorCount) + ""; + html += "" + replace(stat.JdbcExecuteTimeMillis) + ""; + html += "" + replace(stat.JdbcCommitCount) + ""; + html += "" + replace(stat.JdbcRollbackCount) + ""; + html += "" + replace(stat.JdbcFetchRowCount) + ""; + html += "" + replace(stat.JdbcUpdateCount) + ""; html += ""; } $("#dataTable tbody").html(html); From 0b46c8814a55748f17153794c826d25e4f8183b5 Mon Sep 17 00:00:00 2001 From: lujianbo <387852424@qq.com> Date: Thu, 1 Aug 2013 22:46:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9wall.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/support/http/resources/wall.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/support/http/resources/wall.html b/src/main/resources/support/http/resources/wall.html index 320c526d34..834387370b 100644 --- a/src/main/resources/support/http/resources/wall.html +++ b/src/main/resources/support/http/resources/wall.html @@ -173,7 +173,7 @@ }, handleAjaxResult : function(data) { - $("#CheckCount").text(format(data.Content.checkCount)) + $("#CheckCount").text(replace(data.Content.checkCount)) $("#HardCheckCount").text(replace(data.Content.hardCheckCount)) $("#ViolationCount").text(replace(data.Content.violationCount)) $("#BlackListHitCount")