@page
@model Admin.Pages.Server.CacheModel
@{
    ViewData["Title"] = "캐시 관리";
}

<div class="container">
    <h4 class="pb-2">@ViewData["Title"]</h4>

    <partial name="_StatusMessage" />

    <p class="text-muted mb-4">Redis 캐시를 삭제합니다. 삭제된 캐시는 다음 요청 시 DB에서 자동으로 재생성됩니다.</p>

    <div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-3">
        <!-- 전체 캐시 -->
        <div class="col">
            <div class="card border-danger">
                <div class="card-body">
                    <h5 class="card-title">전체 캐시</h5>
                    <p class="card-text text-muted">모든 Redis 캐시를 삭제합니다.</p>
                    <form method="post">
                        <button type="submit" class="btn btn-danger" onclick="return confirm('전체 캐시를 삭제하시겠습니까?');">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 환경설정 -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">환경설정</h5>
                    <p class="card-text text-muted">사이트 기본 설정 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="config" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 게시판 설정 -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">게시판 설정</h5>
                    <p class="card-text text-muted">게시판 메타 정보 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="board:meta:" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- FAQ -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">FAQ</h5>
                    <p class="card-text text-muted">FAQ 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="faq:" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 팝업 -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">팝업</h5>
                    <p class="card-text text-muted">팝업 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="popup:" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 배너 -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">배너</h5>
                    <p class="card-text text-muted">배너 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="banner:" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 문서 -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">문서</h5>
                    <p class="card-text text-muted">문서 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="document:" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 채팅 -->
        <div class="col">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">채팅</h5>
                    <p class="card-text text-muted">채팅 메시지/접속 캐시를 삭제합니다.</p>
                    <form method="post">
                        <input type="hidden" name="prefix" value="chat:" />
                        <button type="submit" class="btn btn-outline-secondary">삭제</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>