Files
drl_2/xuexiao/templates/log_list.html

55 lines
2.4 KiB
HTML
Raw Normal View History

2026-05-29 10:28:07 +08:00
{% extends "base.html" %}
{% block title %}操作日志 - 学生课程管理系统{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-3">
<h4><i class="bi bi-journal-text"></i> 操作日志</h4>
{% if current_user.has_permission('log_export') %}<a href="{{ url_for('log_export') }}" class="btn btn-success"><i class="bi bi-file-earmark-excel"></i> 导出</a>{% endif %}
</div>
<div class="card shadow-sm mb-3">
<div class="card-body">
<form method="GET" class="row g-2">
<div class="col-md-4">
<input type="text" class="form-control" name="keyword" placeholder="搜索关键词" value="{{ keyword or '' }}">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary w-100"><i class="bi bi-search"></i> 查询</button>
</div>
</form>
</div>
</div>
<div class="card shadow-sm">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover table-bordered table-sm">
<thead class="table-light">
<tr><th>ID</th><th>操作人</th><th>操作类型</th><th>操作详情</th><th>IP地址</th><th>操作时间</th></tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td>{{ log.id }}</td>
<td>{{ log.user.real_name if log.user else '-' }}</td>
<td><span class="badge bg-secondary">{{ log.operation_type }}</span></td>
<td>{{ log.operation_detail or '-' }}</td>
<td>{{ log.ip_address or '-' }}</td>
<td>{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') if log.created_at else '-' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if total > per_page %}
<nav>
<ul class="pagination justify-content-center">
{% for p in range(1, ((total + per_page - 1) // per_page) + 1) %}
<li class="page-item {% if p == page %}active{% endif %}">
<a class="page-link" href="?page={{ p }}&keyword={{ keyword or '' }}">{{ p }}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
</div>
</div>
{% endblock %}