From c32d41348c939e98cb3053cbebbf7d512e11ea86 Mon Sep 17 00:00:00 2001 From: augushong Date: Tue, 19 Apr 2022 22:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/debug/log/index.html | 16 +++++++++++++--- public/static/admin/js/debug/log.js | 22 +++++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/app/admin/view/debug/log/index.html b/app/admin/view/debug/log/index.html index 6f778da..6a1594f 100644 --- a/app/admin/view/debug/log/index.html +++ b/app/admin/view/debug/log/index.html @@ -6,10 +6,20 @@ \ No newline at end of file diff --git a/public/static/admin/js/debug/log.js b/public/static/admin/js/debug/log.js index 9f11979..52a1a3a 100644 --- a/public/static/admin/js/debug/log.js +++ b/public/static/admin/js/debug/log.js @@ -14,6 +14,7 @@ define(["jquery", "easy-admin"], function ($, ea) { var Controller = { index: function () { + var uidList = []; ea.table.render({ init: init, size: 'sm', @@ -21,9 +22,24 @@ define(["jquery", "easy-admin"], function ($, ea) { cols: [[ { type: 'checkbox' }, { field: 'id', title: 'id' }, - { field: 'uid', title: 'uid', minWidth: 140 }, - { field: 'level', title: 'level' }, - { field: 'content', title: '日志内容', minWidth: 400, align: 'left', style: 'background-color:#eee' }, + { + field: 'uid', title: 'uid', minWidth: 120, + }, + { field: 'level', title: 'level', minWidth: 70 }, + { + field: 'content', title: '日志内容', minWidth: 450, align: 'left', templet: function (data) { + + if (uidList.indexOf(data.uid) < 0) { + uidList.push(data.uid); + } + var currentUidIndex = uidList.indexOf(data.uid); + + var className = 'log-group log-group-' + (currentUidIndex % 2) + return '
' + data.content + '
' + + + } + }, { field: 'create_time', title: 'create_time', minWidth: 160 }, { field: 'app_name', title: 'app_name' }, { field: 'controller_name', title: 'controller_name', },