mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
完成新的安装流程,开始优化日志管理;
This commit is contained in:
29
app/admin/controller/debug/Log.php
Normal file
29
app/admin/controller/debug/Log.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\debug;
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use EasyAdmin\annotation\ControllerAnnotation;
|
||||
use EasyAdmin\annotation\NodeAnotation;
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="debug_log")
|
||||
*/
|
||||
class Log extends AdminController
|
||||
{
|
||||
|
||||
protected $sort = [
|
||||
'uid' => 'desc',
|
||||
'id' => 'asc',
|
||||
];
|
||||
|
||||
use \app\admin\traits\Curd;
|
||||
|
||||
public function __construct(App $app)
|
||||
{
|
||||
parent::__construct($app);
|
||||
|
||||
$this->model = new \app\admin\model\DebugLog();
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\system;
|
||||
|
||||
|
||||
use app\admin\model\SystemLog;
|
||||
use app\common\controller\AdminController;
|
||||
use EasyAdmin\annotation\ControllerAnnotation;
|
||||
use EasyAdmin\annotation\NodeAnotation;
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="操作日志管理")
|
||||
* Class Auth
|
||||
* @package app\admin\controller\system
|
||||
*/
|
||||
class Log extends AdminController
|
||||
{
|
||||
|
||||
public function __construct(App $app)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->model = new SystemLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
if (input('selectFields')) {
|
||||
return $this->selectList();
|
||||
}
|
||||
[$page, $limit, $where, $excludeFields] = $this->buildTableParames(['month']);
|
||||
|
||||
$month = (isset($excludeFields['month']) && !empty($excludeFields['month']))
|
||||
? date('Ym',strtotime($excludeFields['month']))
|
||||
: date('Ym');
|
||||
|
||||
// todo TP6框架有一个BUG,非模型名与表名不对应时(name属性自定义),withJoin生成的sql有问题
|
||||
|
||||
$count = $this->model
|
||||
->setMonth($month)
|
||||
->with('admin')
|
||||
->where($where)
|
||||
->select();
|
||||
$list = $this->model
|
||||
->setMonth($month)
|
||||
->with('admin')
|
||||
->where($where)
|
||||
->page($page, $limit)
|
||||
->order($this->sort)
|
||||
->select();
|
||||
|
||||
$data = [
|
||||
'code' => 0,
|
||||
'msg' => '',
|
||||
'count' => $count,
|
||||
'data' => $list,
|
||||
];
|
||||
return json($data);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
17
app/admin/model/DebugLog.php
Normal file
17
app/admin/model/DebugLog.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\TimeModel;
|
||||
|
||||
class DebugLog extends TimeModel
|
||||
{
|
||||
|
||||
protected $name = "debug_log";
|
||||
|
||||
protected $deleteTime = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\service;
|
||||
namespace app\admin\service;
|
||||
|
||||
use app\admin\model\MallCate;
|
||||
use app\admin\model\MallGoods;
|
||||
5
app/admin/service/initAdminData/SystemAuthNode.php
Normal file
5
app/admin/service/initAdminData/SystemAuthNode.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$ul_system_auth_node = array(
|
||||
|
||||
);
|
||||
return $ul_system_auth_node;
|
||||
@@ -1,122 +1,149 @@
|
||||
<?php
|
||||
$ul_system_menu = array(
|
||||
array(
|
||||
"id" => 227,
|
||||
"pid" => 99999999,
|
||||
"title" => "后台首页",
|
||||
"icon" => "fa fa-home",
|
||||
"href" => "index/welcome",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 228,
|
||||
"pid" => 0,
|
||||
"title" => "系统管理",
|
||||
"icon" => "fa fa-cog",
|
||||
"href" => "",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 234,
|
||||
"pid" => 228,
|
||||
"title" => "菜单管理",
|
||||
"icon" => "fa fa-tree",
|
||||
"href" => "system.menu/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 10,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 244,
|
||||
"pid" => 228,
|
||||
"title" => "管理员管理",
|
||||
"icon" => "fa fa-user",
|
||||
"href" => "system.admin/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 12,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 245,
|
||||
"pid" => 228,
|
||||
"title" => "角色管理",
|
||||
"icon" => "fa fa-bitbucket-square",
|
||||
"href" => "system.auth/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 11,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 246,
|
||||
"pid" => 228,
|
||||
"title" => "节点管理",
|
||||
"icon" => "fa fa-list",
|
||||
"href" => "system.node/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 9,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 247,
|
||||
"pid" => 228,
|
||||
"title" => "配置管理",
|
||||
"icon" => "fa fa-asterisk",
|
||||
"href" => "system.config/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 8,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 248,
|
||||
"pid" => 228,
|
||||
"title" => "上传管理",
|
||||
"icon" => "fa fa-arrow-up",
|
||||
"href" => "system.uploadfile/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 249,
|
||||
"pid" => 0,
|
||||
"title" => "商城管理",
|
||||
"icon" => "fa fa-list",
|
||||
"href" => "",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 250,
|
||||
"pid" => 249,
|
||||
"title" => "商品分类",
|
||||
"icon" => "fa fa-calendar-check-o",
|
||||
"href" => "mall.cate/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 251,
|
||||
"pid" => 249,
|
||||
"title" => "商品管理",
|
||||
"icon" => "fa fa-list",
|
||||
"href" => "mall.goods/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 252,
|
||||
"pid" => 228,
|
||||
"title" => "快捷入口",
|
||||
"icon" => "fa fa-list",
|
||||
"href" => "system.quick/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 253,
|
||||
"pid" => 228,
|
||||
"title" => "日志管理",
|
||||
"icon" => "fa fa-connectdevelop",
|
||||
"href" => "system.log/index",
|
||||
"href" => "debug.log/index",
|
||||
"params" => "",
|
||||
"target" => "_self",
|
||||
"sort" => 0,
|
||||
"status" => 1,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
return $ul_system_menu;
|
||||
@@ -463,18 +463,54 @@ $ul_system_node = array(
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 67,
|
||||
"node" => "system.log",
|
||||
"title" => "操作日志管理",
|
||||
"id" => 69,
|
||||
"node" => "debug.log",
|
||||
"title" => "debug_log",
|
||||
"type" => 1,
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 68,
|
||||
"node" => "system.log/index",
|
||||
"id" => 70,
|
||||
"node" => "debug.log/index",
|
||||
"title" => "列表",
|
||||
"type" => 2,
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 71,
|
||||
"node" => "debug.log/add",
|
||||
"title" => "添加",
|
||||
"type" => 2,
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 72,
|
||||
"node" => "debug.log/edit",
|
||||
"title" => "编辑",
|
||||
"type" => 2,
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 73,
|
||||
"node" => "debug.log/delete",
|
||||
"title" => "删除",
|
||||
"type" => 2,
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 74,
|
||||
"node" => "debug.log/export",
|
||||
"title" => "导出",
|
||||
"type" => 2,
|
||||
"is_auth" => 1,
|
||||
),
|
||||
array(
|
||||
"id" => 75,
|
||||
"node" => "debug.log/modify",
|
||||
"title" => "属性修改",
|
||||
"type" => 2,
|
||||
"is_auth" => 1,
|
||||
)
|
||||
);
|
||||
|
||||
return $ul_system_node;
|
||||
53
app/admin/view/debug/log/add.html
Normal file
53
app/admin/view/debug/log/add.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<div class="layuimini-container">
|
||||
<form id="app-form" class="layui-form layuimini-form">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">uid</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="uid" class="layui-input" lay-verify="required" placeholder="请输入uid" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">level</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="level" class="layui-input" lay-verify="required" placeholder="请输入level" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">日志内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" class="layui-textarea" lay-verify="required" placeholder="请输入日志内容"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">create_time_title</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="create_time_title" class="layui-input" lay-verify="required" placeholder="请输入create_time_title" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">app_name</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="app_name" class="layui-input" lay-verify="required" placeholder="请输入app_name" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">controller_name</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="controller_name" class="layui-input" lay-verify="required" placeholder="请输入controller_name" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">action_name</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="action_name" class="layui-input" lay-verify="required" placeholder="请输入action_name" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
53
app/admin/view/debug/log/edit.html
Normal file
53
app/admin/view/debug/log/edit.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<div class="layuimini-container">
|
||||
<form id="app-form" class="layui-form layuimini-form">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">uid</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="uid" class="layui-input" lay-verify="required" placeholder="请输入uid" value="{$row.uid|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">level</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="level" class="layui-input" lay-verify="required" placeholder="请输入level" value="{$row.level|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">日志内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" class="layui-textarea" lay-verify="required" placeholder="请输入日志内容">{$row.content|raw|default=''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">create_time_title</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="create_time_title" class="layui-input" lay-verify="required" placeholder="请输入create_time_title" value="{$row.create_time_title|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">app_name</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="app_name" class="layui-input" lay-verify="required" placeholder="请输入app_name" value="{$row.app_name|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">controller_name</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="controller_name" class="layui-input" lay-verify="required" placeholder="请输入controller_name" value="{$row.controller_name|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">action_name</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="action_name" class="layui-input" lay-verify="required" placeholder="请输入action_name" value="{$row.action_name|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
15
app/admin/view/debug/log/index.html
Normal file
15
app/admin/view/debug/log/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<table id="currentTable" class="layui-table layui-hide" data-auth-add="{:auth('debug.log/add')}" data-auth-edit="{:auth('debug.log/edit')}" data-auth-delete="{:auth('debug.log/delete')}" lay-filter="currentTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
[data-field="content"] .layui-table-cell {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.layui-table-view .layui-table[lay-size="sm"] [data-field="content"] .layui-table-cell {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +0,0 @@
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<table id="currentTable" class="layui-table layui-hide"
|
||||
lay-filter="currentTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,7 +48,7 @@ class TimeModel extends Model
|
||||
*/
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = true;
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class MenuService
|
||||
{
|
||||
$data = Db::name('system_menu')
|
||||
->field('title,icon,href')
|
||||
->where("delete_time is null")
|
||||
->where("delete_time", 0)
|
||||
->where('pid', MenuConstant::HOME_PID)
|
||||
->find();
|
||||
!empty($data) && $data['href'] = __url($data['href']);
|
||||
@@ -59,7 +59,7 @@ class MenuService
|
||||
{
|
||||
/** @var AuthService $authService */
|
||||
$authServer = app(AuthService::class, ['adminId' => $this->adminId]);
|
||||
return $this->buildMenuChild(0, $this->getMenuData(),$authServer);
|
||||
return $this->buildMenuChild(0, $this->getMenuData(), $authServer);
|
||||
}
|
||||
|
||||
private function buildMenuChild($pid, $menuList, AuthService $authServer)
|
||||
@@ -93,7 +93,7 @@ class MenuService
|
||||
{
|
||||
$menuData = Db::name('system_menu')
|
||||
->field('id,pid,title,icon,href,target')
|
||||
->where("delete_time is null")
|
||||
->where("delete_time", 0)
|
||||
->where([
|
||||
['status', '=', '1'],
|
||||
['pid', '<>', MenuConstant::HOME_PID],
|
||||
@@ -105,5 +105,4 @@ class MenuService
|
||||
->select();
|
||||
return $menuData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?php
|
||||
$ul_system_auth_node = array(
|
||||
array(
|
||||
"id" => 1,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 1
|
||||
),
|
||||
array(
|
||||
"id" => 2,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 2
|
||||
),
|
||||
array(
|
||||
"id" => 3,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 9
|
||||
),
|
||||
array(
|
||||
"id" => 4,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 12
|
||||
),
|
||||
array(
|
||||
"id" => 5,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 18
|
||||
),
|
||||
array(
|
||||
"id" => 6,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 19
|
||||
),
|
||||
array(
|
||||
"id" => 7,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 21
|
||||
),
|
||||
array(
|
||||
"id" => 8,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 22
|
||||
),
|
||||
array(
|
||||
"id" => 9,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 29
|
||||
),
|
||||
array(
|
||||
"id" => 10,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 30
|
||||
),
|
||||
array(
|
||||
"id" => 11,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 38
|
||||
),
|
||||
array(
|
||||
"id" => 12,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 39
|
||||
),
|
||||
array(
|
||||
"id" => 13,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 45
|
||||
),
|
||||
array(
|
||||
"id" => 14,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 46
|
||||
),
|
||||
array(
|
||||
"id" => 15,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 52
|
||||
),
|
||||
array(
|
||||
"id" => 16,
|
||||
"auth_id" => 6,
|
||||
"node_id" => 53
|
||||
)
|
||||
);
|
||||
return $ul_system_auth_node;
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use app\admin\model\SystemConfig;
|
||||
use app\admin\service\TriggerService;
|
||||
use app\common\service\InitAdminService;
|
||||
use app\admin\service\InitAdminService;
|
||||
use think\migration\Seeder;
|
||||
|
||||
class InitBaseAdminData extends Seeder
|
||||
|
||||
48
public/static/admin/js/debug/log.js
Normal file
48
public/static/admin/js/debug/log.js
Normal file
@@ -0,0 +1,48 @@
|
||||
define(["jquery", "easy-admin"], function ($, ea) {
|
||||
|
||||
var init = {
|
||||
table_elem: '#currentTable',
|
||||
table_render_id: 'currentTableRenderId',
|
||||
index_url: 'debug.log/index',
|
||||
add_url: 'debug.log/add',
|
||||
edit_url: 'debug.log/edit',
|
||||
delete_url: 'debug.log/delete',
|
||||
export_url: 'debug.log/export',
|
||||
modify_url: 'debug.log/modify',
|
||||
};
|
||||
|
||||
var Controller = {
|
||||
|
||||
index: function () {
|
||||
ea.table.render({
|
||||
init: init,
|
||||
size: 'sm',
|
||||
limit: 50,
|
||||
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: 'create_time', title: 'create_time', minWidth: 160 },
|
||||
{ field: 'app_name', title: 'app_name' },
|
||||
{ field: 'controller_name', title: 'controller_name', },
|
||||
{ field: 'action_name', title: 'action_name' },
|
||||
]],
|
||||
toolbar: [
|
||||
'refresh',
|
||||
'export'
|
||||
]
|
||||
});
|
||||
|
||||
ea.listen();
|
||||
},
|
||||
add: function () {
|
||||
ea.listen();
|
||||
},
|
||||
edit: function () {
|
||||
ea.listen();
|
||||
},
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -1,35 +0,0 @@
|
||||
define(["jquery", "easy-admin"], function ($, ea) {
|
||||
|
||||
|
||||
var init = {
|
||||
table_elem: '#currentTable',
|
||||
table_render_id: 'currentTableRenderId',
|
||||
index_url: 'system.log/index',
|
||||
};
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
var util = layui.util;
|
||||
ea.table.render({
|
||||
init: init,
|
||||
toolbar: ['refresh'],
|
||||
cols: [[
|
||||
{field: 'id', width: 80, title: 'ID', search: false},
|
||||
{field: 'month', title: '日志月份', hide: true, search: 'time', timeType: 'month', searchValue: util.toDateString(new Date(), 'yyyy-MM')},
|
||||
{field: 'admin.username', minWidth: 80, title: '后台用户', search: false},
|
||||
{field: 'method', minWidth: 80, title: '请求方法'},
|
||||
{field: 'url', minWidth: 80, title: '路由地址'},
|
||||
{field: 'title', minWidth: 80, title: '日志标题'},
|
||||
{field: 'content', minWidth: 80, title: '操作内容'},
|
||||
{field: 'ip', minWidth: 80, title: 'IP地址'},
|
||||
{field: 'useragent', minWidth: 80, title: 'useragent'},
|
||||
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
|
||||
]],
|
||||
});
|
||||
|
||||
ea.listen();
|
||||
},
|
||||
};
|
||||
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user