mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge pull request #2004 from renfufei/feature/session-principal
Session监控页面-通过开关过滤无Principal的数据
This commit is contained in:
@@ -235,6 +235,7 @@ druid.lang = function() {
|
||||
'SQLStatWhiteList':['SQL Stat - White List', 'SQL防御统计 - 白名单'],
|
||||
'SQLStatBlackList':['SQL Stat - Black List', 'SQL防御统计 - 黑名单'],
|
||||
/**session-detail*/
|
||||
'PrincipalOnly':['Principal Only', 'Principal过滤'],
|
||||
'SESSIONID':['SESSIONID', 'SESSIONID'],
|
||||
'UserAgent':['UserAgent', 'UserAgent'],
|
||||
'Principal':['Principal', 'Principal'],
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
Web Session Stat
|
||||
<a href="websession.json" target="_blank">View JSON API</a>
|
||||
<span class="pull-right" style="font-size: 16px; margin-right: 20px;">
|
||||
<label class="lang" style="display: inline; cursor: pointer;">
|
||||
<input type="checkbox" id="principalOnlyCheck" style="margin-top: 0px;">
|
||||
<span langkey="PrincipalOnly" class="lang">Principal Only</span>
|
||||
<span> | </span>
|
||||
</label>
|
||||
<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.websession.refreshSeconds=parseInt(this.options[this.options.selectedIndex].value);">
|
||||
<option value="5"selected="selected">5s</option>
|
||||
@@ -63,6 +68,9 @@
|
||||
$("#dataTable th a").click(function(obj) {
|
||||
druid.common.setOrderBy(obj.target.id.substring(3))
|
||||
})
|
||||
$("#principalOnlyCheck").change(function(obj) {
|
||||
druid.common.ajaxRequestForBasicInfo();
|
||||
});
|
||||
druid.common.buildHead(6);
|
||||
druid.common.ajaxuri = 'websession.json?';
|
||||
druid.common.handleCallback = druid.websession.handleAjaxResult;
|
||||
@@ -107,8 +115,12 @@
|
||||
}
|
||||
|
||||
var html = "";
|
||||
var principalOnlyChecked = document.getElementById("principalOnlyCheck").checked;
|
||||
for ( var i = 0; i < statList.length; i++) {
|
||||
var stat = statList[i];
|
||||
if(principalOnlyChecked && !stat.Principal) {
|
||||
continue;
|
||||
}
|
||||
var newRow = sqlStatTable.insertRow(-1);
|
||||
html += "<tr>";
|
||||
html += "<td>" + (i + 1) + "</td>";
|
||||
|
||||
Reference in New Issue
Block a user