관리자 목록 퍼블 입히기

This commit is contained in:
주수현
2025-06-14 18:38:25 +09:00
parent d93c7dd864
commit 1a8c35c5d1
2 changed files with 117 additions and 126 deletions

View File

@@ -13,122 +13,118 @@
<input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/> <input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row p-2 mb-2 border-secondary border-top border-bottom border-1"> <section class="filter-wrap">
<div class="col-5"> <div class="form-area">
<label class="col-sm-2 col-form-label" for="searchField">검색필드</label> <div class="input-group">
<select class="form-select d-inline w-25" id="searchField" <div class="input-label">
th:field="*{searchField}"> <p class="label-txt"><label for="searchField">검색필드</label></p>
<option selected value="">선택</option> </div>
<option value="id">ID</option> <div class="d-flex">
<option value="email">Email</option> <div class="component-select">
</select> <select class="select-list" id="searchField" th:field="*{searchField}">
<label> <option selected value="">선택</option>
<input class="form-control d-inline" placeholder="검색어를 입력하세요." <option value="id">ID</option>
style="width: 250px;" <option value="email">Email</option>
th:field="*{searchValue}" type="text"> </select>
</label> </div>
<div class="component-input">
<div class="input-field">
<input type="text" placeholder="검색어를 입력하세요."
style="width: 250px;"
th:field="*{searchValue}" >
</div>
</div>
</div>
</div>
<div class="input-group">
<div class="input-label">
<p class="label-txt">권한</p>
</div>
<div class="component-select">
<select class="select-list" id="searchRole" th:field="*{searchRole}">
<option selected value="">전체</option>
<option th:each="role : ${roles}" th:text="${role.id}"
th:value="${role.id}"></option>
</select>
</div>
</div>
<div class="component-btns">
<div class="btns-row">
<button class="btn" onclick="goSearch();"
type="button">
검색
</button>
<button class="btn" onclick="goInit();"
type="button">초기화
</button>
</div>
</div>
</div> </div>
<div class="col"> </section>
<label class="col-sm-2 col-form-label" for="searchRole">권한</label>
<select class="form-select d-inline w-50" id="searchRole" th:field="*{searchRole}">
<option selected value="">전체</option>
<option th:each="role : ${roles}" th:text="${role.id}"
th:value="${role.id}"></option>
</select>
</div>
<div class="col text-end">
<button class="btn btn-outline-secondary" onclick="goSearch();"
type="button">
<i class="bi bi-search"></i>
</button>
<button class="btn btn-outline-secondary" onclick="goInit();"
type="button">초기화
</button>
</div>
</div>
<div class="row"> <div class="row">
<div class="col text-start"> <div class="col text-start">
<div class="fw-bolder text-muted">Total: <span <div class="fw-bolder text-muted">Total: <span
th:text="${listOutput.totalElements}"></span></div> th:text="${listOutput.totalElements}"></span></div>
</div> </div>
<div class="col text-end"> </div>
<i class="bi bi-list-ol"></i> <section>
<label> <table>
<select class="form-select form-select-sm" id="pageSize" name="pageSize" <thead>
onchange="goSearch()"> <tr>
<option <th >#</th>
th:each="item : ${pageRows}" <th scope="col">
th:selected="${#strings.toString(listOutput.pageable.pageSize) eq item.codeValue}" <label><input class="form-check-input" onchange="toggleCheckbox(this);"
th:text="${item.codeText}" type="checkbox"/></label>
th:value="${item.codeValue}"></option> </th>
</select> <th scope="col"><a class="order-able" data-sort-field="id" href="#">ID</a></th>
</label> <th class="text-secondary" scope="col">권한</th>
<th scope="col"><a class="order-able" data-sort-field="email" href="#">Email</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="accountDisabled"
href="#">활성화</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="accountLocked"
href="#">계정잠김</a></th>
<th scope="col"><a class="order-able" data-sort-field="createdAt" href="#">등록일</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="updatedAt" href="#">수정일</a>
</th>
</tr>
</thead>
<tbody>
<tr th:each="item, status : ${listOutput.content}">
<th th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">
게시물번호
</th>
<td><label><input class="form-check-input" name="checkedIds" th:value="${item.id}"
type="checkbox"/></label>
</td>
<td class="underline"><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a>
</td>
<td>
<span th:each="role, status : ${item.roles}"
th:text="${role.getId()} + ${!status.last ? ', ': ''}"></span>
</td>
<td th:text="${item.email}">이메일</td>
<td th:text="${item.accountDisabled == null || !item.accountDisabled ? 'Y' : 'N' }"></td>
<td th:text="${item.accountLocked == null || !item.accountLocked ? 'N' : 'Y' }"></td>
<td th:text="${#temporals.format(item.createdAt, 'yyyy-MM-dd hh:mm')}">등록일</td>
<td th:text="${#temporals.format(item.updatedAt, 'yyyy-MM-dd hh:mm')}">수정일</td>
</tr>
</tbody>
</table>
<div th:replace="common/list-components :: pagination(${listOutput})"></div>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button class="btn btn-success" onclick="goExcel();" type="button">엑셀 다운로드</button>
<button class="btn" onclick="location.href='/settings/admins/create';" type="button">등록</button>
<button class="btn" onclick="goRemove();" type="button">삭제</button>
</div>
</div> </div>
</div> </section>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">
<label><input class="form-check-input" onchange="toggleCheckbox(this);"
type="checkbox"/></label>
</th>
<th scope="col"><a class="order-able" data-sort-field="id" href="#">ID</a></th>
<th class="text-secondary" scope="col">권한</th>
<th scope="col"><a class="order-able" data-sort-field="email" href="#">Email</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="accountDisabled"
href="#">활성화</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="accountLocked"
href="#">계정잠김</a></th>
<th scope="col"><a class="order-able" data-sort-field="createdAt" href="#">등록일</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="updatedAt" href="#">수정일</a>
</th>
</tr>
</thead>
<tbody>
<tr th:each="item, status : ${listOutput.content}">
<th scope="row"
th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">
게시물번호
</th>
<td><label><input class="form-check-input" name="checkedIds" th:value="${item.id}"
type="checkbox"/></label>
</td>
<td><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a>
</td>
<td>
<span th:each="role, status : ${item.roles}"
th:text="${role.getId()} + ${!status.last ? ', ': ''}"></span>
</td>
<td th:text="${item.email}">이메일</td>
<td th:text="${item.accountDisabled == null || !item.accountDisabled ? 'Y' : 'N' }"></td>
<td th:text="${item.accountLocked == null || !item.accountLocked ? 'N' : 'Y' }"></td>
<td th:text="${#temporals.format(item.createdAt, 'yyyy-MM-dd hh:mm')}">등록일</td>
<td th:text="${#temporals.format(item.updatedAt, 'yyyy-MM-dd hh:mm')}">수정일</td>
</tr>
</tbody>
</table>
</form> </form>
<div th:replace="common/list-components :: pagination(${listOutput})"></div>
<div class="row">
<div class="col text-start">
<button class="btn btn-success" onclick="goExcel();" type="button">엑셀 다운로드</button>
</div>
<div class="col text-end mb-2">
<button class="btn btn-primary" onclick="location.href='/settings/admins/create';"
type="button">등록
</button>
<button class="btn btn-danger" onclick="goRemove();" type="button">삭제</button>
</div>
</div>
</section> </section>
<section layout:fragment="script"> <section layout:fragment="script">

View File

@@ -11,25 +11,20 @@
--> -->
<div th:fragment="pagination(items)"> <div th:fragment="pagination(items)">
<div class="row"> <div class="row">
<nav aria-label="Page navigation example"> <nav class="component-pagination" aria-label="페이지네이션">
<ul class="pagination justify-content-center"> <a class="pagination-item prev"
<li class="page-item" th:classappend="${!items.pageable.hasPrevious} ? 'disabled'"> th:classappend="${!items.pageable.hasPrevious} ? 'disabled'"
<a class="page-link" th:href="${items.pageable.hasPrevious} ? 'javascript:goPageable(' + ${items.pageable.pageNumber - 1} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"></a>
th:href="|javascript:goPageable(${items.pageable.pageNumber - 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|">이전</a>
</li> <a class="pagination-item"
<li class="page-item" th:classappend="${idx == items.pageable.pageNumber} ? 'disabled'"
th:classappend="${idx == items.pageable.pageNumber} ? 'disabled'" th:each="idx : ${#numbers.sequence(0, items.totalPages == 0 ? 0 : items.totalPages - 1)}"
th:each="idx : ${#numbers.sequence(0, items.totalPages == 0 ? 0 : items.totalPages - 1)}"> th:href="${idx != items.pageable.pageNumber} ? 'javascript:goPageable(' + ${idx} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"
<a class="page-link" th:text="${idx + 1}">페이지넘버</a>
th:href="|javascript:goPageable(${idx}, ${items.pageable.pageSize}, '${items.pageable.sort}')|"
th:text="${idx+1}">페이지넘버</a> <a class="pagination-item next"
</li> th:classappend="${items.pageable.pageNumber >= items.totalPages - 1 or items.totalPages == 0} ? 'disabled'"
<li class="page-item" th:href="${items.pageable.pageNumber < items.totalPages - 1 and items.totalPages > 0} ? 'javascript:goPageable(' + ${items.pageable.pageNumber + 1} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"></a>
th:classappend="${items.pageable.pageNumber == items.totalPages - 1 or items.totalPages == 0} ? 'disabled'">
<a class="page-link"
th:href="|javascript:goPageable(${items.pageable.pageNumber + 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|">다음</a>
</li>
</ul>
</nav> </nav>
</div> </div>
</div> </div>