diff --git a/extend/base/admin/controller/debug/LogBase.php b/extend/base/admin/controller/debug/LogBase.php
index 71ad073..96bb7ee 100644
--- a/extend/base/admin/controller/debug/LogBase.php
+++ b/extend/base/admin/controller/debug/LogBase.php
@@ -24,4 +24,44 @@ class LogBase extends AdminController
$this->model = new \app\admin\model\DebugLog();
}
+
+ /**
+ * @\app\admin\service\annotation\NodeAnotation(title="列表")
+ */
+ public function index()
+ {
+ if ($this->request->isAjax()) {
+ if (input('selectFields')) {
+ return $this->selectList();
+ }
+ list($page, $limit, $where, $excludes, $request_options, $group) = $this->buildTableParames();
+ $count = $this->model
+ ->where($where)
+ ->group($group)
+ ->count();
+ $list = $this->model
+ ->where($where)
+ ->page($page, $limit)
+ ->order($this->sort)
+ ->group($group)
+ ->select();
+ $data = [
+ 'code' => 0,
+ 'msg' => '',
+ 'count' => $count,
+ 'data' => $list,
+ ];
+
+ return json($data);
+ }
+
+ $distinctData = $this->model->field('app_name, controller_name, action_name')->distinct(true)->select();
+ $this->assign([
+ 'apps' => array_unique($distinctData->column('app_name')),
+ 'controllers' => array_unique($distinctData->column('controller_name')),
+ 'actions' => array_unique($distinctData->column('action_name')),
+ ]);
+
+ return $this->fetch();
+ }
}
diff --git a/extend/base/admin/view/debug/log/index.html b/extend/base/admin/view/debug/log/index.html
index 9be0f2b..6ddf56a 100644
--- a/extend/base/admin/view/debug/log/index.html
+++ b/extend/base/admin/view/debug/log/index.html
@@ -20,6 +20,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extend/base/admin/view/debug/log/index.js b/extend/base/admin/view/debug/log/index.js
index 8aed879..ba006cb 100644
--- a/extend/base/admin/view/debug/log/index.js
+++ b/extend/base/admin/view/debug/log/index.js
@@ -22,16 +22,44 @@ $(function () {
var sort = {};
sort[sortField] = order;
if (sortField === 'uid') {
- sort['id'] = 'asc'
+ sort['id'] = 'asc';
+ }
+
+ var requestData = {
+ page: page,
+ limit: limit,
+ sort: sort,
+ };
+
+ var filter = {};
+ var op = {};
+
+ var appName = $('#app-select').val();
+ if (appName) {
+ filter.app_name = appName;
+ op.app_name = '=';
+ }
+
+ var controllerName = $('#controller-select').val();
+ if (controllerName) {
+ filter.controller_name = controllerName;
+ op.controller_name = '=';
+ }
+
+ var actionName = $('#action-select').val();
+ if (actionName) {
+ filter.action_name = actionName;
+ op.action_name = '=';
+ }
+
+ if (Object.keys(filter).length > 0) {
+ requestData.filter = JSON.stringify(filter);
+ requestData.op = JSON.stringify(op);
}
ua.request.get({
url: ua.url(init.indexUrl),
- data: {
- page: page,
- limit: limit,
- sort: sort
- }
+ data: requestData
}, function (res) {
if (res.data && res.data.length > 0) {
var html = '';
@@ -131,8 +159,13 @@ $(function () {
reloadLogs();
});
+ // 监听筛选条件选择
+ layui.form.on('select(filter-select)', function (data) {
+ reloadLogs();
+ });
+
// 监听刷新按钮点击
- $('#refresh-btn').on('click', function() {
+ $('#refresh-btn').on('click', function () {
reloadLogs();
});
});
\ No newline at end of file
diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js
index 88e4d87..6621379 100644
--- a/public/static/plugs/ulthon-admin/ulthon-admin.js
+++ b/public/static/plugs/ulthon-admin/ulthon-admin.js
@@ -193,9 +193,6 @@
data: option.data,
timeout: 60000,
success: function (res) {
- console.log(res);
- console.log(option.statusName);
-
loading.hide();
if (eval('res.' + option.statusName) == option.statusCode) {
return ok(res);