mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 12:45:32 +08:00
- NginxAccessLog + NginxLogPosition Scheme 加 #[Component] 注解 - Scheme Table name 补 ul_ 前缀(curd 严格校验要求) - curd 生成 nginx 模块完整后台(controller/model/view/js) - Base/App 双层只读控制器(参照 TimerLogBase 范式) - AccessLogBase: add/edit/delete/modify 全部 error - LogPositionBase: 同上 - 视图改造: - access_log 裁剪到 8 列核心字段(time_local/method/uri/status/remote_addr/request_time/body_bytes_sent/http_user_agent) - status/request_time 自定义 badge 渲染 - toolbar 清空 + operat 仅保留详情(B 类只读页面) - log_position 全字段 + 只读化 - HTTP 验证:index 200 OK + add/edit/delete/modify 全部返回错误
107 lines
2.3 KiB
PHP
107 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace base\admin\controller\nginx;
|
|
|
|
use app\common\controller\AdminController;
|
|
use app\admin\service\annotation\ControllerAnnotation;
|
|
use app\admin\service\annotation\NodeAnotation;
|
|
use think\App;
|
|
|
|
/**
|
|
* @ControllerAnnotation(title="nginx 访问日志明细(解析入库)")
|
|
*/
|
|
class AccessLogBase extends AdminController
|
|
{
|
|
|
|
use \app\admin\traits\Curd;
|
|
|
|
protected $sort = [
|
|
'time_local' => 'desc',
|
|
];
|
|
|
|
public function __construct(App $app)
|
|
{
|
|
parent::__construct($app);
|
|
|
|
$this->model = new \app\admin\model\NginxAccessLog();
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* @NodeAnotation(title="详情")
|
|
*/
|
|
public function read($id)
|
|
{
|
|
$row = $this->model->find($id);
|
|
empty($row) && $this->error('数据不存在');
|
|
|
|
$this->assign('row', $row);
|
|
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* @NodeAnotation(title="添加")
|
|
*/
|
|
public function add()
|
|
{
|
|
$this->error('日志表不允许手动添加');
|
|
}
|
|
|
|
/**
|
|
* @NodeAnotation(title="编辑")
|
|
*/
|
|
public function edit($id)
|
|
{
|
|
$this->error('日志表不允许编辑');
|
|
}
|
|
|
|
/**
|
|
* @NodeAnotation(title="删除")
|
|
*/
|
|
public function delete($id)
|
|
{
|
|
$this->error('日志表不允许删除');
|
|
}
|
|
|
|
/**
|
|
* @NodeAnotation(title="属性修改")
|
|
*/
|
|
public function modify()
|
|
{
|
|
$this->error('日志表不允许修改');
|
|
}
|
|
}
|