Browse Source

更新页面显示

hejq 7 years ago
parent
commit
0c844edb2b

+ 2 - 1
src/main/webapp/WEB-INF/views/normal/logs.html

@@ -66,6 +66,7 @@
     .boolean { color: blue; }
     .null { color: magenta; }
     .key { color: green; }
+
 </style>
 <div id="loadingDiv">
 	<div id="loadingImg">
@@ -116,7 +117,7 @@
             <th class="text-center" width="100">企业名称</th>
             <th class="text-center" width="100">访问路径</th>
 			<th class="text-center" width="100">错误原因</th>
-            <th class="text-center" width="150">详情</th>
+            <th class="text-center" width="50">详情</th>
             <th class="text-center" width="50">参数</th>
 		</thead>
         <tbody id="logList-body">

BIN
src/main/webapp/resources/images/waiting.gif


+ 22 - 5
src/main/webapp/resources/js/common/log.js

@@ -43,7 +43,12 @@ function getLogList(count, page, keyword, fromDate, endDate) {
                         getPara(logList[i].id, logList[i].enName, logList[i].url);
                         $('#loadingDiv').show();
                     });
-                })(i)
+                })(i);
+                (function(i) {
+                    $("#pa_detail_" + logList[i].id ).click(function () {
+                        getDetail(logList[i].detail, logList[i].enName);
+                    });
+                })(i);
             }
 
             // 点击搜索
@@ -101,6 +106,18 @@ function getPara(id, name, url) {
     });
 }
 
+/**
+ * 获取详情
+ */
+function getDetail(detail, name) {
+    $('#para-content').empty();
+    $('#para-title').empty();
+    $("<p style='font-size: 16px; font-weight: bold'>").text(name).appendTo("#para-title");
+    var result = JSON.stringify(JSON.parse(detail), null, 4);
+    $("<pre>").html(syntaxHighlight(result)).appendTo("#para-content");
+    $('#paraDetail').modal('show');
+}
+
 function syntaxHighlight(json) {
     if (typeof json != 'string') {
         json = JSON.stringify(json, undefined, 2);
@@ -166,11 +183,11 @@ function getDataRow(log, i) {
     row.appendChild(msgCell);
 
     var detailCell = document.createElement('td'); //detail
-    detailCell.setAttribute("class", "text-left");
+    detailCell.setAttribute("class", "text-center");
     detailCell.setAttribute("title", log.detail);
-    detailCell.setAttribute("id", "pa_detail");
-    var result = JSON.stringify(JSON.parse(log.detail), null, 4);
-    $("<pre>").html(syntaxHighlight(result)).appendTo(detailCell);
+    detailCell.setAttribute("id", "pa_detail_" + log.id);
+    detailCell.setAttribute("title", "查看详情");
+    detailCell.innerHTML = "详情"; //填充数据
     row.appendChild(detailCell);
 
     var paraCell = document.createElement('td'); //parameters