From 2cad57ce5ad13c9448d2fc5440ce29483d4d2ef3 Mon Sep 17 00:00:00 2001 From: melin Date: Fri, 24 Aug 2012 15:59:49 +0800 Subject: [PATCH] update html --- .../druid/support/http/StatViewServlet.java | 2 +- .../resources/support/http/resources/api.html | 134 +++++----- .../support/http/resources/css/style.css | 114 ++++----- .../support/http/resources/datasource.html | 34 +-- .../support/http/resources/index.html | 10 +- .../support/http/resources/js/basicStat.js | 3 +- .../support/http/resources/js/common.js | 144 ++++++++--- .../support/http/resources/js/datasource.js | 237 ++++++------------ .../support/http/resources/js/spring.js | 154 ++++-------- .../support/http/resources/js/sql.js | 194 +++++--------- .../support/http/resources/js/websession.js | 168 ++++--------- .../support/http/resources/js/weburi.js | 162 ++++-------- .../support/http/resources/spring.html | 68 ++--- .../resources/support/http/resources/sql.html | 139 +++++----- .../support/http/resources/websession.html | 72 +++--- .../support/http/resources/weburi.html | 67 +++-- 16 files changed, 688 insertions(+), 1014 deletions(-) diff --git a/src/main/java/com/alibaba/druid/support/http/StatViewServlet.java b/src/main/java/com/alibaba/druid/support/http/StatViewServlet.java index 89439e1d86..413fec8464 100644 --- a/src/main/java/com/alibaba/druid/support/http/StatViewServlet.java +++ b/src/main/java/com/alibaba/druid/support/http/StatViewServlet.java @@ -198,7 +198,7 @@ public class StatViewServlet extends HttpServlet { } if (isRequireAuth() && session.getAttribute(SESSION_USER_KEY) == null - && !("/login.html".equals(path) || path.startsWith("/css") || path.startsWith("/js"))) { + && !("/login.html".equals(path) || path.startsWith("/css") || path.startsWith("/js") || path.startsWith("/img"))) { if (contextPath == null || contextPath.equals("") || contextPath.equals("/")) { response.sendRedirect("/login.html"); } else { diff --git a/src/main/resources/support/http/resources/api.html b/src/main/resources/support/http/resources/api.html index b205fcf02e..95fcbeec9f 100644 --- a/src/main/resources/support/http/resources/api.html +++ b/src/main/resources/support/http/resources/api.html @@ -3,85 +3,77 @@ Druid Stat JSON API + + -
-
-

JSON API

- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
NameDescription
basic.json basic info.
datasource.json DatsSourceStat List
datasource-{id}.json - DatasourceStat for id={id},id is DatsSourceStat.ID
- Example: druid/datasource-1.json -
activeConnectionStackTrace-{datasourceId}.json - StrackTrace for activeConnection in datasource which datasource.id={datasourceId},id is DatsSourceStat.ID
+
+
+
+
+

+ JSON API +

+ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - -
NameDescription
basic.jsonbasic info.
datasource.jsonDatsSourceStat List
datasource-{id}.jsonDatasourceStat for id={id},id is DatsSourceStat.ID
+ Example: druid/datasource-1.json
activeConnectionStackTrace-{datasourceId}.jsonStrackTrace for activeConnection in datasource which datasource.id={datasourceId},id is DatsSourceStat.ID
Required: set removeAbandoned=true
- Example: druid/activeConnectionStackTrace-1.json -
- sql.json - - SqlStat info List.
- orderBy=[ID|ExecuteCount|...|](every property without histogram in sqlstat object)
- orderType=[asc|desc] default is desc
- page=page count start with 1
- perPageCount=item count in one page,default is INTEGER.MAX_VALUE -
sql-{id}.json - SqlStat for id={id} ,id is SqlStat.ID
- Example: druid/sql-1.json -
weburi.json - -
websession.json - -
reset-all.json Reset all stat
-
+ Example: druid/activeConnectionStackTrace-1.json
sql.jsonSqlStat for id={id} ,id is SqlStat.ID
+ Example: druid/sql-1.json
basic.json
weburi.json +
websession.json +
reset-all.json Reset all stat
+
+ + + diff --git a/src/main/resources/support/http/resources/css/style.css b/src/main/resources/support/http/resources/css/style.css index d4d8449d11..819dbbbd6b 100644 --- a/src/main/resources/support/http/resources/css/style.css +++ b/src/main/resources/support/http/resources/css/style.css @@ -1,84 +1,56 @@ body{ - font-family: 'Microsoft YaHei','Microsoft JhengHei',STHeiti,Georgia,'Times New Roman',Times,serif; - font-weight:normal; font-size:12px; padding-top: 60px; padding-bottom: 40px; } -#menu { - height:50px; -} -#menu a{ - color: #0082FF; - font: 18px 'Microsoft YaHei','Microsoft JhengHei',STHeiti,Georgia,'Times New Roman',Times,serif; -} -#footer { - height: 50px; - border-top: 1px solid #A8C7CE; - margin-top: 20px; - width: 99%; - text-align: center; - line-height: 26px; - padding-top: 15px; -} -tr{ - background-color:white; -} -th{ - background-color:#D3EAEF; -} -#main h2 { - border: 0 dashed red; - color: #0082FF; - font: 24px 'Microsoft YaHei','Microsoft JhengHei',STHeiti,Georgia,'Times New Roman',Times,serif; - margin: 0 0 10px; -} -#main h2 a{ - font-size: 13px; - color: black; -} -#main h3 { - border: 0 dashed red; - color: #0082FF; - margin: 0 0 10px; -} -table{ - background-color:#A8C7CE; - line-height:18px; -} - -.td_lable{ - background-color:#D3EAEF; - font-weight:bolder; - } - - li{ - line-height:18px; - } - -.bar rect { - fill: steelblue; - shape-rendering: crispEdges; -} - -.bar text { - fill: #fff; -} - -.axis path, .axis line { - fill: none; - stroke: #000; - shape-rendering: crispEdges; -} - -.sidebar-nav { - padding: 9px 0; -} .footer { background-color: #F5F5F5; border-top: 1px solid #E5E5E5; margin-top: 10px; padding: 20px 0; +} + +.td_lable { + font-weight: bold; + width: 220px; +} + +.navbar .brand { + color: #555555; +} +.navbar .nav > li > a { + color: #555555; + float: none; + padding: 10px 15px; + text-decoration: none; + text-shadow: 0 1px 0 #FFFFFF; +} +.navbar .nav, +.navbar .nav > li { + font-size: 14px; + float:none; + display:inline-block; + *display:inline; /* ie7 fix */ + *zoom:1; /* hasLayout ie7 trigger */ + vertical-align: top; +} + +.navbar-inner { + text-align:center; + background-color: #FAFAFA; + background-image: -moz-linear-gradient(center top , #FFFFFF, #F2F2F2); +} +.navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus { + background-color: #E5E5E5; + box-shadow: 0 3px 8px rgba(0, 0, 0, 0.125) inset; + color: #555555; + text-decoration: none; +} + +.navbar .nav > li > a:focus, .navbar .nav > li > a:hover { + background-color: transparent; + color: #333333; + text-decoration: none; } \ No newline at end of file diff --git a/src/main/resources/support/http/resources/datasource.html b/src/main/resources/support/http/resources/datasource.html index 5d2c918d94..95f015bb9b 100644 --- a/src/main/resources/support/http/resources/datasource.html +++ b/src/main/resources/support/http/resources/datasource.html @@ -3,25 +3,25 @@ Druid DataSourceStat + + - - + - -
-
-

DataSourceStat List[View JSON API]

-
-
-

(*) property for user to setup

-
+ +
+
+
+
+

+ DataSourceStat List + View JSON API +

+
(*) property for user to setup
+
+
+
+
diff --git a/src/main/resources/support/http/resources/index.html b/src/main/resources/support/http/resources/index.html index 59782be7b9..8dd90040dd 100644 --- a/src/main/resources/support/http/resources/index.html +++ b/src/main/resources/support/http/resources/index.html @@ -12,13 +12,13 @@
-
+
-

+

Stat Index - [View JSON API] -

- + View JSON API + +
Version diff --git a/src/main/resources/support/http/resources/js/basicStat.js b/src/main/resources/support/http/resources/js/basicStat.js index 2ecbac1166..c820cf6efa 100644 --- a/src/main/resources/support/http/resources/js/basicStat.js +++ b/src/main/resources/support/http/resources/js/basicStat.js @@ -2,6 +2,7 @@ $.namespace("druid.index"); druid.index = function () { return { init : function() { + druid.common.buildHead(0); this.ajaxRequestForBasicInfo(); }, @@ -9,7 +10,6 @@ druid.index = function () { $.ajax({ type: 'POST', url: "basic.json", - data: $("#loginForm").serialize(), success: function(data) { $("#DruidVersion").text(data.Content.Version) var driversList = data.Content.Drivers; @@ -23,7 +23,6 @@ druid.index = function () { } $("#ResetEnable").text(data.Content.ResetEnable) $("#ResetCount").text(data.Content.ResetCount) - console.info(data.Content); }, dataType: "json" }); diff --git a/src/main/resources/support/http/resources/js/common.js b/src/main/resources/support/http/resources/js/common.js index a39b13bcb3..6e81d8e561 100644 --- a/src/main/resources/support/http/resources/js/common.js +++ b/src/main/resources/support/http/resources/js/common.js @@ -1,44 +1,41 @@ $.namespace("druid.common"); druid.common = function () { + var statViewOrderBy = ''; + var statViewOrderBy_old = ''; + var statViewOrderType = 'asc'; + + // only one page for now + var sqlViewPage = 1; + var sqlViewPerPageCount = 1000000; + return { init : function() { - this.buildHead(); - this.buildMenu(); this.buildFooter(); }, - buildHead : function() { + buildHead : function(index) { var html = ''; + ' '+ + ''; $(document.body).prepend(html); + $(".navbar .nav li").eq(index).addClass("active"); }, - buildMenu : function() { - var html = '
'+ - ' '+ - '
'; - $(".row-fluid").prepend(html); - }, - buildFooter : function() { var html = '