<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>WBX Admin - Audit Logs</title><link rel="stylesheet" th:href="@{/admin/css/admin.css}"></head>
<body>
<div class="admin-layout">
    <div th:replace="~{admin/fragments :: sidebar('audit-logs')}"></div>
    <div class="admin-content">
        <div class="page-header"><h1>감사 로그</h1><p>최근 100건</p></div>
        <div class="data-table">
            <table>
                <thead><tr><th>시간</th><th>사용자ID</th><th>액션</th><th>리소스</th><th>리소스ID</th><th>IP</th><th>상세</th></tr></thead>
                <tbody>
                <tr th:each="log : ${logs}">
                    <td th:text="${log.createdAt != null ? #temporals.format(log.createdAt, 'yy-MM-dd HH:mm:ss') : ''}"></td>
                    <td th:text="${log.userId}"></td>
                    <td><span class="badge" th:text="${log.action}"></span></td>
                    <td th:text="${log.resource}"></td>
                    <td th:text="${log.resourceId}"></td>
                    <td th:text="${log.ipAddress}"></td>
                    <td th:text="${log.detail != null ? (#strings.abbreviate(log.detail, 80)) : ''}"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>
