diff --git a/src/main/resources/support/http/resources/js/lang.js b/src/main/resources/support/http/resources/js/lang.js index 3359d5b161..9954feb4e4 100644 --- a/src/main/resources/support/http/resources/js/lang.js +++ b/src/main/resources/support/http/resources/js/lang.js @@ -241,6 +241,8 @@ druid.lang = function() { 'RequestTimeMillisTotal':['RequestTimeMillisTotal', '总共请求时间'], 'RequestInterval':['RequestInterval', '请求间隔'], /**weburi-detail*/ + 'RefreshPeriod':['Refresh Period', '刷新时间'], + 'SuspendRefresh':['Suspend Refresh', '暂停刷新'], 'RequestTimeMillis':['RequestTimeMillis', '请求时间'], 'JdbcExecutePeak':['JdbcExecutePeak', 'jdbc执行峰值'], 'JdbcFetchRowPeak':['JdbcFetchRowPeak', 'jdbc查询取回行数峰值'], diff --git a/src/main/resources/support/http/resources/login.html b/src/main/resources/support/http/resources/login.html index 3031dc74e6..d4d0f614b6 100644 --- a/src/main/resources/support/http/resources/login.html +++ b/src/main/resources/support/http/resources/login.html @@ -55,7 +55,7 @@ The username or password you entered is incorrect.
- +
@@ -83,16 +83,29 @@ else { $("#alertInfo").show(); $("#loginForm")[0].reset(); + $("input[name=loginUsername]").focus(); } }, dataType: "text" }); - } + }, + unamecr : function(e) { + if(e.which == 13) { // enter key event + $("input[name=loginPassword]").focus(); + } + }, + upasscr : function(e) { + if(e.which == 13) { // enter key event + $("#loginBtn").click(); + } + } } }(); $(document).ready(function() { $("#loginBtn").click(druid.login.login); + $("input[name=loginUsername]").keypress(druid.login.unamecr); + $("input[name=loginPassword]").keypress(druid.login.upasscr); }); diff --git a/src/main/resources/support/http/resources/weburi.html b/src/main/resources/support/http/resources/weburi.html index 8de74bce8f..0bb79588c2 100644 --- a/src/main/resources/support/http/resources/weburi.html +++ b/src/main/resources/support/http/resources/weburi.html @@ -17,6 +17,17 @@

Web URI Stat View JSON API + + + + Suspend Refresh +

@@ -64,10 +75,37 @@ druid.common.ajaxuri = 'weburi.json?'; druid.common.handleCallback = druid.weburi.handleAjaxResult; druid.common.setOrderBy("URI"); - druid.common.ajaxRequestForBasicInfo(); - setInterval("druid.common.ajaxRequestForBasicInfo();",5000); + druid.weburi.controlRefresh(); }, - + controlRefresh : function() { + var FIVE = 5; + if(!druid.weburi.refreshSeconds){ + druid.weburi.refreshSeconds=FIVE; + } + if(!druid.weburi.suspendedSeconds){ + druid.weburi.suspendedSeconds=0; + } + druid.weburi.suspendedSeconds += FIVE; + if(!druid.weburi.disableAutoRefresh){ + if(druid.weburi.suspendedSeconds >= druid.weburi.refreshSeconds){ + druid.weburi.suspendedSeconds = 0; + druid.common.ajaxRequestForBasicInfo(); + } + } + setTimeout(druid.weburi.controlRefresh, FIVE * 1000); + }, + switchSuspendRefresh : function() { + druid.weburi.disableAutoRefresh = !druid.weburi.disableAutoRefresh; + if(druid.weburi.disableAutoRefresh){ + $("#btnSuspendRefresh").addClass("btn-warning").removeClass("btn-primary"); + } else { + $("#btnSuspendRefresh").addClass("btn-primary").removeClass("btn-warning"); + } + }, + disableAutoRefresh : false, + refreshSeconds : 5, + suspendedSeconds : 0, + handleAjaxResult : function(data) { var statList = data.Content; if(statList == null) return;