|
@@ -1,9 +1,7 @@
|
|
|
{% extends "base/layout.html" %}
|
|
|
-
|
|
|
{% block title %}日志查询{% endblock %}
|
|
|
-
|
|
|
{% block page_content %}
|
|
|
- <div class="app-body-header h-50px">
|
|
|
+<div class="app-body-header h-50px">
|
|
|
<h3>日志查询</h3>
|
|
|
<ol class="breadcrumb breadcrumb-dot text-muted fs-6 fw-semibold ms-5">
|
|
|
<li class="breadcrumb-item text-muted">日志查询</li>
|
|
@@ -16,25 +14,27 @@
|
|
|
</div>
|
|
|
<form class="search-box d-flex">
|
|
|
<div class="d-flex">
|
|
|
- <input type="text" class="form-control form-control-sm w-200px me-5" placeholder="请输入用户名" name="username" />
|
|
|
- <select class="form-select form-select-sm w-100 me-5" name="operationType" >
|
|
|
+ <input type="text" class="form-control form-control-sm w-200px me-5" placeholder="请输入用户名"
|
|
|
+ name="username" />
|
|
|
+ <select class="form-select form-select-sm w-100 me-5" name="operationType">
|
|
|
<option value="">全部类型</option>
|
|
|
{% for op in operation_type_list %}
|
|
|
- <option value="{{ op }}">{{ op }}</option>
|
|
|
+ <option value="{{ op }}">{{ op }}</option>
|
|
|
{% endfor %}
|
|
|
</select>
|
|
|
- <select class="form-select form-select-sm w-100 me-5" name="operationModule" >
|
|
|
+ <select class="form-select form-select-sm w-100 me-5" name="operationModule">
|
|
|
<option value="">全部模块</option>
|
|
|
- {% for op in operation_module_list %}
|
|
|
- <option value="{{ op }}">{{ op }}</option>
|
|
|
+ {% for op in operation_module_list %}
|
|
|
+ <option value="{{ op }}">{{ op }}</option>
|
|
|
{% endfor %}
|
|
|
</select>
|
|
|
- <select class="form-select form-select-sm w-100 me-5" name="operationResult" >
|
|
|
+ <select class="form-select form-select-sm w-100 me-5" name="operationResult">
|
|
|
<option value="">全部结果</option>
|
|
|
<option value="0">成功</option>
|
|
|
<option value="1">失败</option>
|
|
|
</select>
|
|
|
- <input type="text" class="form-control form-control-sm w-200px me-5" placeholder="请输入起始日期" name="date" id="date"/>
|
|
|
+ <input type="text" class="form-control form-control-sm w-200px me-5" placeholder="请输入起始日期"
|
|
|
+ name="date" id="date" />
|
|
|
</div>
|
|
|
<div class="btn-group ms-5">
|
|
|
<button type="button" class="btn btn-primary btn-sm" onclick="IwbTableSearch(this)">查询</button>
|
|
@@ -47,8 +47,6 @@
|
|
|
<div class="pagination-row"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
<div class="modal fade" id="modal" tabindex="-1" aria-hidden="true">
|
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
|
<div class="modal-content rounded">
|
|
@@ -67,16 +65,18 @@
|
|
|
<input type="hidden" id="project_id" />
|
|
|
<div class="fv-row form-group mb-3">
|
|
|
<label for="project_name" class="form-label required">项目名称</label>
|
|
|
- <input type="text" class="form-control" name="project_name" id="project_name" placeholder="请输入" required />
|
|
|
+ <input type="text" class="form-control" name="project_name" id="project_name"
|
|
|
+ placeholder="请输入" required />
|
|
|
</div>
|
|
|
<div class="fv-row form-group mb-3">
|
|
|
<label for="project_desc" class="form-label">项目名称</label>
|
|
|
- <textarea type="text" class="form-control" name="project_desc" id="project_desc" placeholder="请输入" ></textarea>
|
|
|
+ <textarea type="text" class="form-control" name="project_desc" id="project_desc"
|
|
|
+ placeholder="请输入"></textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
- <div class="modal-footer">
|
|
|
+ <div class="modal-footer">
|
|
|
<button type="button" class="btn btn-light" data-bs-dismiss="modal">取消</button>
|
|
|
<button type="button" class="btn btn-primary" onclick="SaveProject()">保存</button>
|
|
|
</div>
|
|
@@ -85,87 +85,86 @@
|
|
|
</div>
|
|
|
{% endblock %}
|
|
|
{% block page_scripts %}
|
|
|
- <script>
|
|
|
- const table = '#table',
|
|
|
+<script>
|
|
|
+ const table = '#table',
|
|
|
$modal = $("#modal");
|
|
|
- ChangeHeadMenu("#{{page_active}}_menu")
|
|
|
- $(function () {
|
|
|
- InitRangeDate($('#date'))
|
|
|
- IwbTable(table,{
|
|
|
- url:'/api/log/list',
|
|
|
- columns: [
|
|
|
- {
|
|
|
- title: 'ID',
|
|
|
- data: 'id',
|
|
|
- width: '80px'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '用户名',
|
|
|
- data: 'username',
|
|
|
- width: '150px'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作类型',
|
|
|
- data: 'operation_type',
|
|
|
- width: '120px',
|
|
|
- render: function (row) {
|
|
|
- let style = 'primary';
|
|
|
- if (row.operation_type === '新增'|| row.operation_type === '修改') {
|
|
|
- style = 'primary';
|
|
|
- } else if (row.operation_type === '删除') {
|
|
|
- style = 'danger';
|
|
|
- } else if (row.operation_type === '登录') {
|
|
|
- style = 'info';
|
|
|
- }else {
|
|
|
- style = 'success';
|
|
|
- }
|
|
|
- return `<span class="badge badge-${style}" title="${row.operation_type}">${row.operation_type}</span>`;
|
|
|
+ ChangeHeadMenu("#{{page_active}}_menu")
|
|
|
+ $(function () {
|
|
|
+ InitRangeDate($('#date'))
|
|
|
+ IwbTable(table, {
|
|
|
+ url: '/api/log/list',
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: 'ID',
|
|
|
+ data: 'id',
|
|
|
+ width: '80px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '用户名',
|
|
|
+ data: 'username',
|
|
|
+ width: '150px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作类型',
|
|
|
+ data: 'operation_type',
|
|
|
+ width: '120px',
|
|
|
+ render: function (row) {
|
|
|
+ let style = 'primary';
|
|
|
+ if (row.operation_type === '新增' || row.operation_type === '修改') {
|
|
|
+ style = 'primary';
|
|
|
+ } else if (row.operation_type === '删除') {
|
|
|
+ style = 'danger';
|
|
|
+ } else if (row.operation_type === '登录') {
|
|
|
+ style = 'info';
|
|
|
+ } else {
|
|
|
+ style = 'success';
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作模块',
|
|
|
- data: 'operation_model',
|
|
|
- width: '120px',
|
|
|
- render: function (row) {
|
|
|
- return `<span class="badge badge-primary" title="${row.operation_module}">${row.operation_module}</span>`;
|
|
|
+ return `<span class="badge badge-${style}" title="${row.operation_type}">${row.operation_type}</span>`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作模块',
|
|
|
+ data: 'operation_model',
|
|
|
+ width: '120px',
|
|
|
+ render: function (row) {
|
|
|
+ return `<span class="badge badge-primary" title="${row.operation_module}">${row.operation_module}</span>`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作详情',
|
|
|
+ data: 'description',
|
|
|
+ width: 'auto',
|
|
|
+ render: function (row) {
|
|
|
+ const operation_data = row.operation_data ? row.operation_data : "";
|
|
|
+ const data_changes = row.data_changes ? (operation_data ? '\n' : '') + row.data_changes : "";
|
|
|
+ return `<span class="w-100" data-bs-toggle="tooltip" data-bs-placement="top" title='${operation_data ? operation_data : ""}${data_changes ? data_changes : ""}'>${row.operation_desc}</span>`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作IP',
|
|
|
+ data: 'operation_ip',
|
|
|
+ width: '180px'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作结果',
|
|
|
+ data: 'operation_result',
|
|
|
+ width: '120px',
|
|
|
+ render: function (row) {
|
|
|
+ if (row.operation_result === 0) {
|
|
|
+ return '<span class="badge badge-success">成功</span>';
|
|
|
+ } else {
|
|
|
+ return '<span class="badge badge-danger">失败</span>';
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作详情',
|
|
|
- data: 'description',
|
|
|
- width: 'auto',
|
|
|
- render: function (row) {
|
|
|
- const operation_data = row.operation_data ? row.operation_data : "";
|
|
|
- const data_changes = row.data_changes ? (operation_data? '\n': '')+ row.data_changes : "";
|
|
|
- return `<span class="w-100" data-bs-toggle="tooltip" data-bs-placement="top" title='${operation_data ? operation_data:""}${data_changes ? data_changes:""}'>${row.operation_desc}</span>`;
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作IP',
|
|
|
- data: 'operation_ip',
|
|
|
- width: '180px'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作结果',
|
|
|
- data: 'operation_result',
|
|
|
- width: '120px',
|
|
|
- render: function (row) {
|
|
|
- if (row.operation_result === 0) {
|
|
|
- return '<span class="badge badge-success">成功</span>';
|
|
|
- } else {
|
|
|
- return '<span class="badge badge-danger">失败</span>';
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作时间',
|
|
|
- data: 'created_at',
|
|
|
- width: '180px'
|
|
|
- },
|
|
|
- ]
|
|
|
- })
|
|
|
- });
|
|
|
-
|
|
|
- </script>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作时间',
|
|
|
+ data: 'created_at',
|
|
|
+ width: '180px'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ });
|
|
|
|
|
|
+</script>
|
|
|
{% endblock %}
|