mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
@@ -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查询取回行数峰值'],
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
The username or password you entered is incorrect.
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<input type="text" placeholder="用户名" name="loginUsername" >
|
||||
<input type="text" placeholder="用户名" name="loginUsername" autofocus="autofocus">
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<input type="password" placeholder="密码" name="loginPassword">
|
||||
@@ -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);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -17,6 +17,17 @@
|
||||
<h3>
|
||||
Web URI Stat
|
||||
<a href="weburi.json" target="_blank">View JSON API</a>
|
||||
<span class="pull-right" style="font-size: 16px; margin-right: 20px;">
|
||||
<label langkey="RefreshPeriod" class="lang" style="display: inline;" for="refreshSecondsSelect">Refresh Period</label>
|
||||
<select id="refreshSecondsSelect" class="refresh-seconds-select btn" style="width:80px;" onchange="javascript:druid.weburi.refreshSeconds=parseInt(this.options[this.options.selectedIndex].value);">
|
||||
<option value="5"selected="selected">5s</option>
|
||||
<option value="10">10s</option>
|
||||
<option value="20">20s</option>
|
||||
<option value="30">30s</option>
|
||||
<option value="60">60s</option>
|
||||
</select>
|
||||
<a id="btnSuspendRefresh" langkey="SuspendRefresh" class="btn btn-primary lang" href="javascript:druid.weburi.switchSuspendRefresh();">Suspend Refresh</a>
|
||||
</span>
|
||||
</h3>
|
||||
<table id="dataTable" class="table table-bordered table-striped responsive-utilities">
|
||||
<thead>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user