<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>WBX Admin - Login History</title><link rel="stylesheet" th:href="@{/admin/css/admin.css}"></head>
<body>
<div class="admin-layout">
    <div th:replace="~{admin/fragments :: sidebar('login-history')}"></div>
    <div class="admin-content">
        <div class="page-header"><h1>로그인 이력</h1><p>최근 50건</p></div>
        <div class="data-table">
            <table>
                <thead><tr><th>시간</th><th>이메일</th><th>액션</th><th>IP</th><th>인증방법</th><th>사유</th></tr></thead>
                <tbody>
                <tr th:each="log : ${logs}">
                    <td th:text="${#temporals.format(log.createdAt, 'yy-MM-dd HH:mm:ss')}"></td>
                    <td th:text="${log.email}"></td>
                    <td>
                        <span th:if="${log.action == 'LOGIN_SUCCESS'}" class="badge badge-success">성공</span>
                        <span th:if="${log.action == 'LOGIN_FAILURE'}" class="badge badge-danger">실패</span>
                        <span th:if="${log.action == 'LOGOUT'}" class="badge badge-info">로그아웃</span>
                    </td>
                    <td th:text="${log.ipAddress}"></td>
                    <td th:text="${log.authMethod}"></td>
                    <td th:text="${log.failureReason}"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>
