日志总量th动态替换

This commit is contained in:
wangxin
2018-08-31 20:24:43 +08:00
parent e5890dd424
commit 041d76e918
5 changed files with 42 additions and 2 deletions

View File

@@ -151,6 +151,9 @@ public class LoginController extends BaseController {
}
model.addAttribute("adminPath", adminPath);
model.addAttribute("log_time_start",Constants.LOG_TIME_START);
model.addAttribute("log_time_range",Constants.LOG_TIME_RANGE);
model.addAttribute("log_total",this.getMsgProp().getProperty("log_total"));
return "/home";
}

View File

@@ -14,6 +14,9 @@
<script type="text/javascript">
$(document).ready(function() {
sessionStorage.setItem("log_total","${log_total}");
sessionStorage.setItem("log_time_start","${log_time_start}");
sessionStorage.setItem("log_time_range","${log_time_range}");
window.frames['mainFrame'].location="${ctx}/configure/statistics/configureStateStatistics";
//国际化切换
var lang = "${cookie.Language.value }".toLowerCase();

View File

@@ -67,6 +67,8 @@
haveInvisibleChar:"The tags {0} have invisible character",
httpCheck:"Please enter a correct url(http[s]://xxx.xx)",
failed:"Failed",
go_back:"Go Back Policies"
go_back:"Go Back Policies",
log_5_minutes:"Log Five Minutes' Amount",
log_1_hour:"Log One Hour's Amount"
});
}(jQuery));

View File

@@ -67,6 +67,8 @@
haveInvisibleChar:"标签{0}包含不可见字符",
httpCheck:"请输入正确的url(http[s]://xxx.xx)",
failed:"获取失败",
go_back:"返回配置界面"
go_back:"返回配置界面",
log_5_minutes:"5分钟日志量",
log_1_hour:"1小时日志量"
});
}(jQuery));

View File

@@ -1,4 +1,5 @@
$(function(){
//扩展jquery增加全局函数
$.ipcommon=function(){
return {};
@@ -438,6 +439,35 @@ $(function(){
var val=$(this).val();
$(this).val(val.trim());
});
var log_total=sessionStorage.getItem("log_total");
var log_time_start=sessionStorage.getItem("log_time_start");
var log_time_range=sessionStorage.getItem("log_time_range");
var log_5_minutes=$.validator.messages.log_5_minutes;
var log_1_hour=$.validator.messages.log_1_hour;
$('th').each(function(){
if(log_time_start){
if($(this).text()==log_5_minutes){
$(this).text(log_total);
}else if($(this).text()==log_1_hour){
$(this).text(log_total);
}
}else if(log_time_range){
if(log_time_range==300000){
if($(this).text()==log_total){
$(this).text(log_5_minutes);
}else if($(this).text()==log_1_hour){
$(this).text(log_5_minutes);
}
}else if(log_time_range=3600000){
if($(this).text()==log_total){
$(this).text(log_1_hour);
}else if($(this).text()==log_5_minutes){
$(this).text(log_1_hour);
}
}
}
})
});
window.onload=function(){
// 配置id的搜索下拉框选择切换