完善日志管理列表功能,完善查看详情,删除日志功能

pull/65/head
TSQ 4 years ago
parent 08d6bfb0bf
commit 329afc5f45

@ -27,4 +27,15 @@ public class LogViewController {
return "/modular/system/log/log.html";
}
/**
*
*
* @author TSQ
* @date 2021/1/5 15:18
*/
@GetResource(name = "日志详情页", path = "/view/logDetail")
public String detailView() {
return "/modular/system/log/log_detail.html";
}
}

@ -18,14 +18,14 @@ layui.use(['HttpRequest', 'treeTable', 'laydate', 'func' ,'form'], function () {
*/
Log.initColumn = function () {
return [[
{type: 'checkbox'},
{type: 'numbers'},
{field: 'logId', hide: true, sort: true, title: 'id'},
/*{field: 'logType', align: "center", sort: true, title: '日志类型'},*/
{field: 'logName', align: "center", sort: true, title: '日志名称'},
{field: 'createUser', align: "center", sort: true, title: '用户名称'},
{field: 'appName', align: "center", sort: true, title: '服务器名'},
{field: 'requestUrl', align: "center", sort: true, title: '方法名'},
{field: 'createTime', align: "center", sort: true, title: '时间'},
{field: 'clientIp', align: "center", sort: true, title: 'IP'},
{field: 'requestUrl', align: "center", sort: true, title: '请求地址'},
{field: 'createTime', align: "center", sort: true, title: '创建时间'},
{field: 'logContent', align: "center", sort: true, title: '具体消息'},
{align: 'center', toolbar: '#tableBar', title: '操作', minWidth: 100}
]];
@ -60,40 +60,40 @@ layui.use(['HttpRequest', 'treeTable', 'laydate', 'func' ,'form'], function () {
/**
* 日志详情
*/
// Log.logDetail = function (param) {
// var ajax = new $ax(Feng.ctxPath + "/log/detail/" + param.operationLogId, function (data) {
// Feng.infoDetail("日志详情", data.regularMessage);
// }, function (data) {
// Feng.error("获取详情失败!");
// });
// ajax.start();
// };
Log.logDetail = function (data) {
func.open({
height: 800,
title: '查看日志详情',
content: Feng.ctxPath + '/view/logDetail?logId='+ data.logId,
tableId: Log.tableId
});
};
/**
* 清空日志
*/
// Log.cleanLog = function () {
// Feng.confirm("是否清空所有日志?", function () {
// var ajax = new $ax(Feng.ctxPath + "/log/delLog", function (data) {
// Feng.success("清空日志成功!");
// Log.search();
// }, function (data) {
// Feng.error("清空日志失败!");
// });
// ajax.start();
// });
// };
Log.cleanLog = function (data) {
var deleteLog = function () {
var dataList = layui.table.cache["logTable"];
var httpRequest = new HttpRequest(Feng.ctxPath + "/logManager/delete", 'post', function () {
Feng.success("清空日志成功!");
table.reload(Log.tableId);
}, function (data) {
Feng.error("清空日志失败!" + data.responseJSON.message + "!");
});
httpRequest.set("appName",dataList[0].appName);
httpRequest.set("beginDateTime",dataList[dataList.length-1].createTime);
httpRequest.set("endDateTime",dataList[0].createTime);
httpRequest.start(true);
};
Feng.confirm("是否删除?", deleteLog);
};
// 渲染时间选择框
laydate.render({
elem: '#createTime'
});
// 渲染时间选择框
// laydate.render({
// elem: '#createTime'
// });
// 渲染表格
var tableResult = table.render({
elem: '#' + Log.tableId,
@ -111,18 +111,18 @@ layui.use(['HttpRequest', 'treeTable', 'laydate', 'func' ,'form'], function () {
Log.search();
});
// 搜索按钮点击事件
// $('#btnClean').click(function () {
// Log.cleanLog();
// });
//点击清空日志事件
$('#btnClean').click(function () {
Log.cleanLog();
});
// 工具条点击事件
// table.on('tool(' + Log.tableId + ')', function (obj) {
// var data = obj.data;
// var layEvent = obj.event;
//
// if (layEvent === 'detail') {
// Log.logDetail(data);
// }
// });
table.on('tool(' + Log.tableId + ')', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'detail') {
Log.logDetail(data);
}
});
});

@ -0,0 +1,19 @@
/**
* 详情对话框
*/
var SysLogInfoDlg = {
data: {
logId: "",
}
};
layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'iconPicker'], function () {
var $ = layui.jquery;
var HttpRequest = layui.HttpRequest;
var form = layui.form;
//获取菜单信息
var request = new HttpRequest(Feng.ctxPath + "/logManager/detail?logId=" + Feng.getUrlParam("logId"), 'get');
var sysLogResult = request.start();
form.val('sysLogForm', sysLogResult.data);
});

@ -0,0 +1,125 @@
@layout("/layout/_container.html",{js:["/assets/modular/system/log/log_deatil.js"]}){
<div class="layui-body-header">
<span class="layui-body-header-title">日志详情</span>
</div>
<form class="layui-form" id="sysLogForm" lay-filter="sysLogForm">
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-form-item layui-row">
<input name="logId" type="hidden" disabled readonly class="layui-input layui-disabled"/>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">日志名称</label>
<div class="layui-input-block">
<input name="logName" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">具体内容</label>
<div class="layui-input-block">
<input name="logContent" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">服务器名称</label>
<div class="layui-input-block">
<input name="appName" placeholder="资源名称" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">请求地址</label>
<div class="layui-input-block">
<input name="requestUrl" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">请求参数</label>
<div class="layui-input-block">
<input name="requestParams" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">返回参数</label>
<div class="layui-input-block">
<input name="requestResult" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">当前服务IP</label>
<div class="layui-input-block">
<input name="serverIp" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">请求服务器IP</label>
<div class="layui-input-block">
<input name="clientIp" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-block">
<input name="userId" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">请求Http方式</label>
<div class="layui-input-block">
<input name="httpMethod" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">浏览器标识</label>
<div class="layui-input-block">
<input name="clientBrowser" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">客户操作系统</label>
<div class="layui-input-block">
<input name="clientOs" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-block">
<input name="createTime" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">创建人</label>
<div class="layui-input-block">
<input name="createUser" type="text" disabled readonly class="layui-input layui-disabled"/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="form-group-bottom text-center" style="z-index: 200">
<button type="reset" class="layui-btn layui-btn-primary" ew-event="closeDialog">&emsp;关闭&emsp;</button>
</div>
@}
Loading…
Cancel
Save