diff options
| author | 李皓宸 <[email protected]> | 2019-04-26 17:35:40 +0800 |
|---|---|---|
| committer | 李皓宸 <[email protected]> | 2019-04-26 17:35:40 +0800 |
| commit | 4107e0fb928ee3fe3f20b1506eef4261c6083d3a (patch) | |
| tree | e54a32ba4f6081594c15c79fa3b4a002a87168b6 | |
| parent | efd965f4ca3b577d76e2eadf2adaeb0e97126503 (diff) | |
修复系统日志中异常日志显示不全的问题
| -rw-r--r-- | src/main/webapp/WEB-INF/views/sys/logList.jsp | 2 | ||||
| -rw-r--r-- | src/main/webapp/static/global/scripts/common.js | 27 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/main/webapp/WEB-INF/views/sys/logList.jsp b/src/main/webapp/WEB-INF/views/sys/logList.jsp index 578ecd6ad..e7b0020b9 100644 --- a/src/main/webapp/WEB-INF/views/sys/logList.jsp +++ b/src/main/webapp/WEB-INF/views/sys/logList.jsp @@ -103,7 +103,7 @@ </tr>
<c:if test="${not empty log.exception}">
<tr>
- <td colspan="8"
+ <td colspan="8" class="SysException"
style="word-wrap: break-word; word-break: break-all;">
<%-- 用户代理: ${log.userAgent}<br/> --%> <%-- 提交参数: ${fns:escapeHtml(log.params)} <br/> --%>
<spring:message code="log_exception_info" />:<br />
diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index a3cec83fb..6efe13a93 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -61,7 +61,7 @@ $(function(){ $("form input[class~='domainCheck']").attr("maxlength","1024");
$("form input[class~='domainCheck']").attr("minlength","4");
//截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb
- $("#contentTable").find("td").not(":has(a)").each(function(i,element){
+ $("#contentTable").find("td").not(":has(a)").not(".SysException").each(function(i,element){
//获取td当前对象的文本,如果长度大于25;
if(!$(element).find(".tooltips").length>0){
var tdclass= $(this).attr("class");//no_substr 不进行截取
@@ -85,6 +85,31 @@ $(function(){ }
});
+ $("#contentTable").find("td.SysException").each(function(i,element){
+ //获取td当前对象的文本,如果长度大于25;
+ if(!$(element).find(".tooltips").length>0){
+ var tdclass= $(this).attr("class");//no_substr 不进行截取
+ if(tdclass!='no_substr'){
+ if($(this).text().trim().length>100){
+ //给td设置title属性,并且设置td的完整值.给title属性.
+ var strTitle = $(this).text().trim().replace(/[\r\n]/g,"").replace(/\s+/g, " ");;
+ $(this).attr("titleHidden","'"+strTitle+"'"); // 加一个不含换行的隐藏文本方便其它复制处理
+ //解决火狐title不能自动换行
+ var count = Math.floor(strTitle.length/62);
+ for(var i=1;i<=count;i++){
+ strTitle=strTitle.substring(0,i*62-1)+"\n"+strTitle.substring(i*62-1);
+ }
+ $(this).attr("title",strTitle);
+ //获取td的值,进行截取。赋值给text变量保存.
+ var length=$(this).html().length;
+ var text=$(this).html().substring(0,(length/2))+"...";
+ //重新为td赋值;
+ $(this).html(text);
+ }
+ }
+ }
+ });
+
$("input[name$='isCaseSenstive']").on("change",function(){
setIsHexBin(this);
});
|
