Update: (步骤备份)修复刷新内置标签页的问题
This commit is contained in:
@@ -22,9 +22,11 @@ def index():
|
|||||||
def login_log():
|
def login_log():
|
||||||
# orm查询
|
# orm查询
|
||||||
# 使用分页获取data需要.items
|
# 使用分页获取data需要.items
|
||||||
log = AdminLog.query.filter_by(url='/passport/login').order_by(desc(AdminLog.create_time)).layui_paginate()
|
log = AdminLog.query.filter(
|
||||||
|
AdminLog.url != '/passport/login'
|
||||||
|
).order_by(desc(AdminLog.create_time)).layui_paginate()
|
||||||
count = log.total
|
count = log.total
|
||||||
return table_api(data= model_to_dicts(schema=LogOutSchema, data=log.items), count=count)
|
return table_api(data=model_to_dicts(schema=LogOutSchema, data=log.items), count=count)
|
||||||
|
|
||||||
|
|
||||||
# 操作日志
|
# 操作日志
|
||||||
@@ -33,8 +35,9 @@ def login_log():
|
|||||||
def operate_log():
|
def operate_log():
|
||||||
# orm查询
|
# orm查询
|
||||||
# 使用分页获取data需要.items
|
# 使用分页获取data需要.items
|
||||||
log = AdminLog.query.filter(
|
log = AdminLog.query.filter_by(
|
||||||
AdminLog.url != '/passport/login').order_by(
|
url='/passport/login'
|
||||||
|
).order_by(
|
||||||
desc(AdminLog.create_time)).layui_paginate()
|
desc(AdminLog.create_time)).layui_paginate()
|
||||||
count = log.total
|
count = log.total
|
||||||
return table_api(data=model_to_dicts(schema=LogOutSchema, data=log.items), count=count)
|
return table_api(data=model_to_dicts(schema=LogOutSchema, data=log.items), count=count)
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ layui.define(['jquery', 'element', 'dropdown'], function (exports) {
|
|||||||
*/
|
*/
|
||||||
tabPage.prototype.refresh = function (time) {
|
tabPage.prototype.refresh = function (time) {
|
||||||
|
|
||||||
var $iframe = $(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-content .layui-show > div[data-frameid]");
|
var $iframe = $(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-content .layui-show > div[data-frameid], iframe[data-frameid]");
|
||||||
var $iframeLoad;
|
var $iframeLoad;
|
||||||
|
|
||||||
if (time != false && time != 0) {
|
if (time != false && time != 0) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>日志</title>
|
<title>日志</title>
|
||||||
{% include 'system/common/header.html' %}
|
{% include 'system/common/header.html' %}
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/other/console2.css') }}"/>
|
|
||||||
</head>
|
</head>
|
||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
|
|
||||||
@@ -40,74 +39,74 @@
|
|||||||
</script>
|
</script>
|
||||||
{% include 'system/common/footer.html' %}
|
{% include 'system/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
||||||
let table = layui.table
|
let table = layui.table
|
||||||
let form = layui.form
|
let form = layui.form
|
||||||
|
|
||||||
let MODULE_PATH = '/system/log/'
|
let MODULE_PATH = '/system/log/'
|
||||||
|
|
||||||
let cols = [
|
let cols = [
|
||||||
[
|
[
|
||||||
{ title: 'ID', field: 'id', align: 'center' },
|
{title: '编号', field: 'id', align: 'center', width: 80},
|
||||||
{ title: '请求方式', field: 'method', align: 'center' },
|
{title: '请求方式', field: 'method', align: 'center', width: 100},
|
||||||
{ title: '接口', field: 'url', align: 'center' },
|
{title: '接口', field: 'url', align: 'center', width: 300},
|
||||||
{ title: '浏览器', field: 'user_agent', align: 'center' },
|
{title: '浏览器', field: 'user_agent', align: 'center', width: 350},
|
||||||
{ title: '操作地址', field: 'ip', align: 'center' },
|
{title: '操作地址', field: 'ip', align: 'center', width: 100},
|
||||||
{ title: '访问时间', field: 'create_time', templet: '#log-createTime', align: 'center' },
|
{title: '访问时间', field: 'create_time', templet: '#log-createTime', align: 'center', width: 100},
|
||||||
{ title: '操作人ID', field: 'uid', align: 'center' },
|
{title: '操作人ID', field: 'uid', align: 'center', width: 100},
|
||||||
{ title: '描述', field: 'desc', align: 'center' },
|
{title: '描述', field: 'desc', align: 'center', width: 150},
|
||||||
{ title: '访问状态', templet: '#log-status', align: 'center' }
|
{title: '访问状态', templet: '#log-status', align: 'center', width: 100}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
table.render({
|
table.render({
|
||||||
elem: '#log-operate-table',
|
elem: '#log-operate-table',
|
||||||
url: MODULE_PATH + 'operateLog',
|
url: MODULE_PATH + 'operateLog',
|
||||||
page: true,
|
page: true,
|
||||||
cols: cols,
|
cols: cols,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
toolbar: false
|
toolbar: false
|
||||||
})
|
})
|
||||||
|
|
||||||
table.render({
|
table.render({
|
||||||
elem: '#log-login-table',
|
elem: '#log-login-table',
|
||||||
url: MODULE_PATH + 'loginLog',
|
url: MODULE_PATH + 'loginLog',
|
||||||
page: true,
|
page: true,
|
||||||
cols: cols,
|
cols: cols,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
toolbar: false
|
toolbar: false
|
||||||
})
|
})
|
||||||
|
|
||||||
form.on('submit(dict-type-query)', function (data) {
|
form.on('submit(dict-type-query)', function (data) {
|
||||||
table.reload('dict-type-table', { where: data.field })
|
table.reload('dict-type-table', {where: data.field})
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
table.on('tool(log-operate-table)', function (obj) {
|
table.on('tool(log-operate-table)', function (obj) {
|
||||||
if (obj.event === 'details') {
|
if (obj.event === 'details') {
|
||||||
window.info(obj)
|
window.info(obj)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
table.on('tool(log-login-table)', function (obj) {
|
table.on('tool(log-login-table)', function (obj) {
|
||||||
if (obj.event === 'details') {
|
if (obj.event === 'details') {
|
||||||
window.info(obj)
|
window.info(obj)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
window.info = function (obj) {
|
window.info = function (obj) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
title: '详细信息',
|
title: '详细信息',
|
||||||
shade: 0,
|
shade: 0,
|
||||||
area: ['400px', '400px'],
|
area: ['400px', '400px'],
|
||||||
content: MODULE_PATH + 'info',
|
content: MODULE_PATH + 'info',
|
||||||
success: function (layero) {
|
success: function (layero) {
|
||||||
let iframeWin = window[layero.find('iframe')[0]['name']]
|
let iframeWin = window[layero.find('iframe')[0]['name']]
|
||||||
iframeWin.show(obj.data)
|
iframeWin.show(obj.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user