瀏覽代碼

Fix missing score and scan time Rspamd logs

Tom Udding 2 年之前
父節點
當前提交
136cc2e3ff
共有 1 個文件被更改,包括 18 次插入8 次删除
  1. 18 8
      data/web/js/site/debug.js

+ 18 - 8
data/web/js/site/debug.js

@@ -765,7 +765,14 @@ jQuery(function($){
         {
         {
           title: 'Score',
           title: 'Score',
           data: 'score',
           data: 'score',
-          defaultContent: ''
+          defaultContent: '',
+          createdCell: function(td, cellData) {
+            $(td).attr({
+              "data-order": cellData.sortBy,
+              "data-sort": cellData.sortBy
+            });
+            $(td).html(cellData.value);
+          }
         },
         },
         {
         {
           title: 'Subject',
           title: 'Subject',
@@ -786,7 +793,14 @@ jQuery(function($){
         {
         {
           title: 'Scan Time',
           title: 'Scan Time',
           data: 'scan_time',
           data: 'scan_time',
-          defaultContent: ''
+          defaultContent: '',
+          createdCell: function(td, cellData) {
+            $(td).attr({
+              "data-order": cellData.sortBy,
+              "data-sort": cellData.sortBy
+            });
+            $(td).html(cellData.value);
+          }
         },
         },
         {
         {
           title: 'ID',
           title: 'ID',
@@ -843,9 +857,7 @@ jQuery(function($){
         scan_time += ' / ' + item.time_virtual.toFixed(3);
         scan_time += ' / ' + item.time_virtual.toFixed(3);
       }
       }
       item.scan_time = {
       item.scan_time = {
-        "options": {
-          "sortValue": item.time_real
-        },
+        "sortBy": item.time_real,
         "value": scan_time
         "value": scan_time
       };
       };
       if (item.action === 'clean' || item.action === 'no action') {
       if (item.action === 'clean' || item.action === 'no action') {
@@ -864,9 +876,7 @@ jQuery(function($){
         score_content = "[ <span class='text-danger'>" + item.score.toFixed(2) + " / " + item.required_score + "</span> ]";
         score_content = "[ <span class='text-danger'>" + item.score.toFixed(2) + " / " + item.required_score + "</span> ]";
       }
       }
       item.score = {
       item.score = {
-        "options": {
-          "sortValue": item.score
-        },
+        "sortBy": item.score,
         "value": score_content
         "value": score_content
       };
       };
       if (item.user == null) {
       if (item.user == null) {