@page "{id:int}"
@model Admin.Pages.Member.Log.Login.InfoModel
@{
    ViewData["Title"] = "로그인 상세 정보";
}

<div class="container">
    <h3>@ViewData["Title"]</h3>
    <hr />

    <partial name="_StatusMessage" />

    @if (Model.Data == null)
    {
        <div class="alert alert-warning">데이터를 찾을 수 없습니다.</div>
    }
    else
    {
        <div class="row mb-3">
            <label class="col-sm-2">PK</label>
            <div class="col-sm-10">@Model.Data.ID</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">회원</label>
            <div class="col-sm-10">
                @if (Model.Data.MemberID != null)
                {
                    <span>@Model.Data.MemberID</span>
                }
                else
                {
                    <text>비회원</text>
                }
                @if (Model.Data.MemberName is not null)
                {
                    <small>, @Model.Data.MemberName</small>
                }
            </div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">시도 계정</label>
            <div class="col-sm-10">@Model.Data.Account</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">성공 여부</label>
            <div class="col-sm-10">@(Model.Data.Success ? "성공" : "실패")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">사유</label>
            <div class="col-sm-10">@(Model.Data.Reason ?? "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">Referer</label>
            <div class="col-sm-10">@(!string.IsNullOrEmpty(Model.Data.Referer) ? Model.Data.Referer : "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">URL</label>
            <div class="col-sm-10">@(Model.Data.Url ?? "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">IP</label>
            <div class="col-sm-10">@(Model.Data.IpAddress ?? "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">User Agent</label>
            <div class="col-sm-10">@(Model.Data.UserAgent ?? "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">등록 일시</label>
            <div class="col-sm-10">@Model.Data.CreatedAt</div>
        </div>
        <hr />
        <div class="row mb-3">
            <label class="col-sm-2">Browser</label>
            <div class="col-sm-10">@(Model.Data.Browser ?? "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">OS</label>
            <div class="col-sm-10">@(Model.Data.OS ?? "-")</div>
        </div>
        <div class="row mb-3">
            <label class="col-sm-2">Device</label>
            <div class="col-sm-10">@(Model.Data.Device ?? "-")</div>
        </div>
    }
    <hr />
    <div class="d-grid gap-2 text-center d-md-block">
        <a asp-page="Index" class="btn btn-sm btn-secondary">목록</a>
    </div>
    <br />
</div>
