퍼블입혓는데 동작을 안함...
This commit is contained in:
@@ -44,10 +44,8 @@ public class AdminCreatePostController {
|
||||
bindingVO.getSeq(),
|
||||
bindingVO.getId(),
|
||||
bindingVO.getPassword(),
|
||||
bindingVO.getEmail(),
|
||||
bindingVO.getRegionMainCode(),
|
||||
bindingVO.getAccountDisabled(),
|
||||
bindingVO.getAccountLocked(),
|
||||
bindingVO.getRoleIds());
|
||||
|
||||
redirectAttributes.addFlashAttribute(
|
||||
|
||||
@@ -53,12 +53,9 @@ class AdminUpdateGetController {
|
||||
output.getSeq(),
|
||||
output.getId(),
|
||||
null,
|
||||
output.getEmail(),
|
||||
output.getRegionMainCode(),
|
||||
output.getPasswordUpdatedAt(),
|
||||
output.getAccountDisabled(),
|
||||
output.getLoginFailCnt(),
|
||||
output.getAccountLocked(),
|
||||
output.getRoles().stream().map(CoreRole::getId).collect(Collectors.toList()));
|
||||
|
||||
model.addAttribute("bindingVO", bindingVO);
|
||||
|
||||
@@ -44,10 +44,8 @@ class AdminUpdatePostController {
|
||||
bindingVO.getSeq(),
|
||||
bindingVO.getId(),
|
||||
bindingVO.getUpdatePassword(),
|
||||
bindingVO.getEmail(),
|
||||
bindingVO.getRegionMainCode(),
|
||||
bindingVO.getAccountDisabled(),
|
||||
bindingVO.getAccountLocked(),
|
||||
bindingVO.getRoleIds());
|
||||
|
||||
redirectAttributes.addFlashAttribute(
|
||||
|
||||
@@ -15,15 +15,15 @@ public class AdminCreateBindingVO {
|
||||
private String id;
|
||||
private String password;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
/* @NotBlank(message = "{valid.common.required}")
|
||||
@Pattern(
|
||||
regexp =
|
||||
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
|
||||
message = "{valid.common.email.wrong}")
|
||||
private String email;
|
||||
private String email;*/
|
||||
|
||||
private Boolean accountDisabled;
|
||||
private Boolean accountLocked;
|
||||
/* private Boolean accountLocked;*/
|
||||
private List<String> roleIds;
|
||||
private String regionMainCode;
|
||||
}
|
||||
|
||||
@@ -26,17 +26,17 @@ public class AdminUpdateBindingVO implements AuditOutput {
|
||||
private String id;
|
||||
private String updatePassword;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
/* @NotBlank(message = "{valid.common.required}")
|
||||
@Pattern(
|
||||
regexp =
|
||||
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
|
||||
message = "{valid.common.email.wrong}")
|
||||
private String email;
|
||||
private String email;*/
|
||||
private String regionMainCode;
|
||||
|
||||
private LocalDateTime passwordUpdatedAt;
|
||||
private Boolean accountDisabled;
|
||||
private Integer loginFailCnt;
|
||||
private Boolean accountLocked;
|
||||
/* private Integer loginFailCnt;
|
||||
private Boolean accountLocked;*/
|
||||
private List<String> roleIds;
|
||||
}
|
||||
|
||||
@@ -2,147 +2,160 @@
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section class="fw-bold" layout:fragment="content">
|
||||
<section layout:fragment="content">
|
||||
|
||||
<form
|
||||
method="post"
|
||||
th:action="@{/settings/admins/create}"
|
||||
th:object="${bindingVO}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="id">ID *</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="id"
|
||||
th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'"
|
||||
th:field="*{id}"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{id}"
|
||||
th:if="${#fields.hasErrors('id')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
<table class="type-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><label for="roleIds">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="d-flex">
|
||||
<div class="component-input">
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="roleIds"
|
||||
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
|
||||
th:field="*{roleIds}"
|
||||
onchange="onRoleChange(this);">
|
||||
<option value="">선택</option>
|
||||
<option th:each="role : ${roles}" th:text="${role.id}"
|
||||
th:value="${role.id}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<div class="d-flex">
|
||||
<div class="input-field">
|
||||
<input id="id"
|
||||
th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'"
|
||||
th:field="*{id}"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{id}"
|
||||
th:if="${#fields.hasErrors('id')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<th><label for="password">Password<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<div class="d-flex">
|
||||
<div class="input-field">
|
||||
<input id="password" type="password"
|
||||
th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
|
||||
th:field="*{password}"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{password}"
|
||||
th:if="${#fields.hasErrors('password')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="regionMainCodeArea"
|
||||
th:classappend="${#lists.isEmpty(bindingVO.roleIds) or #lists.contains(bindingVO.roleIds, 'ROLE_ADMIN')} ? 'd-none'">
|
||||
<th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="regionMainCode" name="regionMainCode"
|
||||
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
|
||||
th:field="*{regionMainCode}">
|
||||
<option value="">선택</option>
|
||||
<option th:each="code : ${regionMainCode}"
|
||||
th:value="${code.id}"
|
||||
th:text="${code.codeText}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
|
||||
th:if="${#fields.hasErrors('regionMainCode')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td class="radio-group">
|
||||
<div class="component-input">
|
||||
<label for="inlineRadio1" class="radio-inner">
|
||||
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">미사용</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<label for="inlineRadio2" class="radio-inner">
|
||||
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false" checked>
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">사용</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
|
||||
th:if="${#fields.hasErrors('accountDisabled')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
|
||||
<span class="btn-txt">목록으로 이동</span>
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="btn-txt">저장</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="password">Password *</label>
|
||||
<div class="col-sm-4">
|
||||
|
||||
<input class="form-control" id="password"
|
||||
th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
|
||||
th:field="*{password}"
|
||||
type="password"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{password}"
|
||||
th:if="${#fields.hasErrors('password')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="email">Email *</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="email"
|
||||
th:classappend="${#fields.hasErrors('email')} ? 'is-invalid'"
|
||||
th:field="*{email}"
|
||||
type="email"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{email}"
|
||||
th:if="${#fields.hasErrors('email')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="roleIds">권한 *</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" id="roleIds" multiple
|
||||
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
|
||||
th:field="*{roleIds}"
|
||||
onchange="onRoleChange(this);">
|
||||
<option th:each="role : ${roles}" th:text="${role.id}"
|
||||
th:value="${role.id}"></option>
|
||||
</select>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3 regionMainCodeArea" style="display: none;">
|
||||
<label class="col-sm-2 col-form-label" for="regionMainCode">실사 *</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-select" id="regionMainCode" name="regionMainCode"
|
||||
th:field="*{regionMainCode}">
|
||||
<option value="">선택</option>
|
||||
<option th:each="code : ${regionMainCode}"
|
||||
th:value="${code.id}"
|
||||
th:text="${code.codeText}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 활성화 -->
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="inlineRadio1">비활성화 여부 *</label>
|
||||
<div class="col-sm-4 pt-1">
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" id="inlineRadio1" name="accountDisabled"
|
||||
type="radio" value="true">
|
||||
<label class="form-check-label" for="inlineRadio1">비활성화</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input checked class="form-check-input" id="inlineRadio2"
|
||||
name="accountDisabled" type="radio" value="false">
|
||||
<label class="form-check-label" for="inlineRadio2">활성화</label>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 계정잠김 -->
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="accountLocked1">계정잠김 여부*</label>
|
||||
<div class="col-sm-4 pt-1">
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" id="accountLocked1" name="accountLocked"
|
||||
type="radio" value="true">
|
||||
<label class="form-check-label" for="accountLocked1">Locked</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input checked class="form-check-input" id="accountLocked2"
|
||||
name="accountLocked" type="radio" value="false">
|
||||
<label class="form-check-label" for="accountLocked2">Unlocked</label>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary float-end" type="submit">저장</button>
|
||||
<button class="btn btn-light" onclick="gotoList();return false;" type="button">목록으로 이동
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function gotoList() {
|
||||
document.prevAdminParamForm ? document.prevAdminParamForm.submit()
|
||||
: location.href = '/settings/admins';
|
||||
}
|
||||
</script>
|
||||
<th:block layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
function gotoList() {
|
||||
if (document.prevAdminParamForm) {
|
||||
const f = document.prevAdminParamForm;
|
||||
f.submit();
|
||||
} else {
|
||||
location.href = '/settings/admins';
|
||||
}
|
||||
}
|
||||
|
||||
<script>
|
||||
const onRoleChange = (el) => {
|
||||
$('.regionMainCodeArea').toggle(el.value !== "ROLE_ADMIN");
|
||||
}
|
||||
</script>
|
||||
$(document).ready(() => {
|
||||
const roleSelect = document.getElementById('roleIds');
|
||||
onRoleChange(roleSelect);
|
||||
});
|
||||
const onRoleChange = (el) => {
|
||||
const selectedValues = Array.from(el.selectedOptions).map(option => option.value);
|
||||
const isAdmin = !selectedValues.length || selectedValues.includes('ROLE_ADMIN');
|
||||
$('.regionMainCodeArea').toggle(!isAdmin);
|
||||
};
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</section>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section class="fw-bold" layout:fragment="content">
|
||||
<section layout:fragment="content">
|
||||
|
||||
<form
|
||||
method="post"
|
||||
@@ -11,171 +11,172 @@
|
||||
|
||||
<input type="hidden" name="seq" th:field="*{seq}"/>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="id">ID *</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="id" readonly="readonly"
|
||||
th:field="*{id}"/>
|
||||
<table class="type-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th> <label for="roleIds">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="d-flex">
|
||||
<div class="component-input">
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="roleIds"
|
||||
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
|
||||
th:field="*{roleIds}"
|
||||
onchange="onRoleChange(this);">
|
||||
<option value="">선택</option>
|
||||
<option th:each="role : ${roles}" th:text="${role.id}"
|
||||
th:value="${role.id}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<div class="d-flex">
|
||||
<div class="input-field">
|
||||
<input id="id" readonly="readonly" th:field="*{id}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<th><label for="password">비밀번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="d-flex">
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input id="password" placeholder="암호를 변경하고 싶다면 입력하세요"
|
||||
th:classappend="${#fields.hasErrors('updatePassword')} ? 'is-invalid'"
|
||||
th:field="*{updatePassword}"
|
||||
type="password"/>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{updatePassword}"
|
||||
th:if="${#fields.hasErrors('updatePassword')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="regionMainCodeArea"
|
||||
th:classappend="${#lists.isEmpty(bindingVO.roleIds) or #lists.contains(bindingVO.roleIds, 'ROLE_ADMIN')} ? 'd-none'">
|
||||
<th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td>
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="regionMainCode" name="regionMainCode"
|
||||
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
|
||||
th:field="*{regionMainCode}">
|
||||
<option value="">선택</option>
|
||||
<option th:each="code : ${regionMainCode}"
|
||||
th:value="${code.id}"
|
||||
th:text="${code.codeText}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
|
||||
th:if="${#fields.hasErrors('regionMainCode')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> <label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||
<td class="radio-group">
|
||||
<div class="component-input">
|
||||
<label for="inlineRadio1" class="radio-inner">
|
||||
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">미사용</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<label for="inlineRadio2" class="radio-inner">
|
||||
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">사용</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
|
||||
th:if="${#fields.hasErrors('accountDisabled')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div th:replace="common/components :: auditArea"></div>
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
|
||||
<span class="btn-txt">목록</span>
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="btn-txt">저장</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="password">Password *</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="password" placeholder="암호를 변경하고 싶다면 입력하세요"
|
||||
th:classappend="${#fields.hasErrors('updatePassword')} ? 'is-invalid'"
|
||||
th:field="*{updatePassword}"
|
||||
type="password"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{updatePassword}"
|
||||
th:if="${#fields.hasErrors('updatePassword')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="email">Email *</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="email"
|
||||
th:classappend="${#fields.hasErrors('email')} ? 'is-invalid'"
|
||||
th:field="*{email}"
|
||||
type="email"/>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{email}"
|
||||
th:if="${#fields.hasErrors('email')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="roleIds">권한 *</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" id="roleIds" multiple
|
||||
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
|
||||
th:field="*{roleIds}"
|
||||
onchange="onRoleChange(this);">
|
||||
<option th:each="role : ${roles}" th:text="${role.id}"
|
||||
th:value="${role.id}"></option>
|
||||
</select>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3 regionMainCodeArea"
|
||||
th:style="${#lists.contains(bindingVO.roleIds, 'ROLE_ADMIN')} ? 'display: none;' : 'display: flex;'">
|
||||
<label class="col-sm-2 col-form-label" for="regionMainCode">실사 *</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-select" id="regionMainCode" name="regionMainCode"
|
||||
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
|
||||
th:field="*{regionMainCode}">
|
||||
<option value="">선택</option>
|
||||
<option th:each="code : ${regionMainCode}"
|
||||
th:value="${code.id}"
|
||||
th:text="${code.codeText}">
|
||||
</option>
|
||||
</select>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
|
||||
th:if="${#fields.hasErrors('regionMainCode')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 활성화 -->
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="inlineRadio1">비활성화 여부 *</label>
|
||||
<div class="col-sm-4 pt-1">
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" id="inlineRadio1" th:field="*{accountDisabled}"
|
||||
type="radio" value="true">
|
||||
<label class="form-check-label" for="inlineRadio1">비활성화</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" id="inlineRadio2" th:field="*{accountDisabled}"
|
||||
type="radio" value="false">
|
||||
<label class="form-check-label" for="inlineRadio2">활성화</label>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 계정잠김 -->
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label" for="accountLocked1">계정잠김 여부*</label>
|
||||
<div class="col-sm-4 pt-1">
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" id="accountLocked1" th:field="*{accountLocked}"
|
||||
type="radio" value="true">
|
||||
<label class="form-check-label" for="accountLocked1">Locked</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" id="accountLocked2" th:field="*{accountLocked}"
|
||||
type="radio" value="false">
|
||||
<label class="form-check-label" for="accountLocked2">Unlocked</label>
|
||||
</div>
|
||||
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
|
||||
th:if="${#fields.hasErrors('roleIds')}">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row w-50">
|
||||
<!-- audit area -->
|
||||
<div th:replace="common/components :: auditArea"></div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary float-end" type="submit">저장</button>
|
||||
<button class="btn btn-light" onclick="gotoList();return false;" type="button">목록으로 이동
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->
|
||||
<th:block th:if="${listStatus != null}">
|
||||
<form method="get" name="prevAdminParamForm"
|
||||
th:action="@{/settings/admins}"
|
||||
th:object="${listStatus}">
|
||||
<input th:field="*{searchField}" type="hidden">
|
||||
<input th:field="*{searchValue}" type="hidden">
|
||||
<input th:field="*{searchRole}" type="hidden">
|
||||
<th:block th:if="${pageable != null}">
|
||||
<input name="page" th:value="${pageable.page}" type="hidden"/>
|
||||
<input name="sort" th:value="${pageable.sort}" type="hidden"/>
|
||||
</th:block>
|
||||
</form>
|
||||
<form method="get" name="prevAdminParamForm"
|
||||
th:action="@{/settings/admins}"
|
||||
th:object="${listStatus}">
|
||||
<input th:field="*{searchField}" type="hidden">
|
||||
<input th:field="*{searchValue}" type="hidden">
|
||||
<input th:field="*{searchRole}" type="hidden">
|
||||
<th:block th:if="${pageable != null}">
|
||||
<input name="page" th:value="${pageable.page}" type="hidden"/>
|
||||
<input name="sort" th:value="${pageable.sort}" type="hidden"/>
|
||||
</th:block>
|
||||
</form>
|
||||
</th:block>
|
||||
|
||||
<script th:inline="javascript">
|
||||
function gotoList() {
|
||||
if (document.prevAdminParamForm) {
|
||||
const f = document.prevAdminParamForm;
|
||||
f.sort.value = convertToPageableSortValue(f.sort.value);
|
||||
f.submit();
|
||||
} else {
|
||||
location.href = '/settings/admins';
|
||||
<th:block layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
function gotoList() {
|
||||
if (document.prevAdminParamForm) {
|
||||
const f = document.prevAdminParamForm;
|
||||
f.submit();
|
||||
} else {
|
||||
location.href = '/settings/admins';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
showAudit([[${bindingVO.id}]], [[${bindingVO.createdBy}]],
|
||||
[[${#temporals.format(bindingVO.createdAt, "yyyy-MM-dd'T'HH:mm:ss")}]],
|
||||
[[${bindingVO.updatedBy}]],
|
||||
[[${#temporals.format(bindingVO.updatedAt, "yyyy-MM-dd'T'HH:mm:ss")}]]);
|
||||
});
|
||||
</script>
|
||||
$(document).ready(() => {
|
||||
showAudit([[${bindingVO.id}]], [[${bindingVO.createdBy}]],
|
||||
[[${#temporals.format(bindingVO.createdAt, "yyyy-MM-dd'T'HH:mm:ss")}]],
|
||||
[[${bindingVO.updatedBy}]],
|
||||
[[${#temporals.format(bindingVO.updatedAt, "yyyy-MM-dd'T'HH:mm:ss")}]]);
|
||||
|
||||
<script>
|
||||
const onRoleChange = (el) => {
|
||||
$('.regionMainCodeArea').toggle(el.value !== "ROLE_ADMIN");
|
||||
}
|
||||
</script>
|
||||
// 초기 로드 시 roleIds에 따라 regionMainCodeArea 표시/숨김
|
||||
const roleSelect = document.getElementById('roleIds');
|
||||
if (roleSelect) {
|
||||
onRoleChange(roleSelect);
|
||||
}
|
||||
});
|
||||
|
||||
const onRoleChange = (el) => {
|
||||
const isAdmin = el.value === 'ROLE_ADMIN' || !el.value;
|
||||
$('.regionMainCodeArea').toggle(!isAdmin);
|
||||
};
|
||||
</script>
|
||||
</th:block>
|
||||
|
||||
</section>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -47,10 +47,8 @@ class AdminAuthFailHandlerTest {
|
||||
1L,
|
||||
testUsername,
|
||||
"test.1@#$",
|
||||
"xx4@test.com",
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,8 @@ class AdminDetailsServiceTest {
|
||||
1L,
|
||||
username,
|
||||
password,
|
||||
"xx1@test.com",
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
||||
|
||||
|
||||
|
||||
@@ -38,10 +38,8 @@ class AdminCreateUpdateDaoTest {
|
||||
1L,
|
||||
"admin_for_createDao_test",
|
||||
"test.1@#$",
|
||||
"admin_for_createDao_test@test.com",
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
||||
|
||||
adminViewPortIn
|
||||
@@ -56,10 +54,8 @@ class AdminCreateUpdateDaoTest {
|
||||
2L,
|
||||
"admin_for_createDao_test",
|
||||
"test.1@#$",
|
||||
"admin_for_createDao_test@test.com",
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
List.of("ROLE_STAFF"));
|
||||
assertEquals(
|
||||
1,
|
||||
|
||||
@@ -32,10 +32,8 @@ public class InitAdminData implements ApplicationRunner {
|
||||
null,
|
||||
"test-admin",
|
||||
"admin1@#$",
|
||||
"admin@framework.org",
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
List.of("ROLE_ADMIN"));
|
||||
|
||||
// 지방실사
|
||||
@@ -43,10 +41,8 @@ public class InitAdminData implements ApplicationRunner {
|
||||
null,
|
||||
"test-local-inspection",
|
||||
"local1@#$",
|
||||
"local@framework.org",
|
||||
"code.region.main.1",
|
||||
false,
|
||||
false,
|
||||
List.of("ROLE_LOCAL_INSPECTION"));
|
||||
|
||||
// 조사원
|
||||
@@ -54,10 +50,8 @@ public class InitAdminData implements ApplicationRunner {
|
||||
null,
|
||||
"test-researcher",
|
||||
"researcher1@#$",
|
||||
"researcher@framework.org",
|
||||
"code.region.main.1",
|
||||
false,
|
||||
false,
|
||||
List.of("ROLE_RESEARCHER"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ public interface SaveAdminPortIn {
|
||||
Long seq,
|
||||
String id,
|
||||
String password,
|
||||
String email,
|
||||
String regionMainCode,
|
||||
Boolean accountDisabled,
|
||||
Boolean accountLocked,
|
||||
List<String> roleIds);
|
||||
}
|
||||
|
||||
@@ -25,10 +25,8 @@ public class SaveAdminService implements SaveAdminPortIn {
|
||||
Long seq,
|
||||
String id,
|
||||
String password,
|
||||
String email,
|
||||
String regionMainCode,
|
||||
Boolean accountDisabled,
|
||||
Boolean accountLocked,
|
||||
List<String> roleIds) {
|
||||
|
||||
LocalDateTime passwordUpdatedAt;
|
||||
@@ -58,11 +56,8 @@ public class SaveAdminService implements SaveAdminPortIn {
|
||||
id,
|
||||
password,
|
||||
passwordUpdatedAt,
|
||||
email,
|
||||
regionMainCode,
|
||||
accountDisabled,
|
||||
loginFailCnt,
|
||||
accountLocked,
|
||||
roleIds
|
||||
));
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ public class SaveAdminCmd extends AuditCommand {
|
||||
private String id;
|
||||
private String encodedPassword;
|
||||
private LocalDateTime passwordUpdatedAt;
|
||||
private String email;
|
||||
/* private String email;*/
|
||||
private String regionMainCode;
|
||||
private Boolean accountDisabled;
|
||||
private Integer loginFailCnt;
|
||||
private Boolean accountLocked;
|
||||
/* private Integer loginFailCnt;
|
||||
private Boolean accountLocked;*/
|
||||
private List<String> roleIds;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user