퍼블입혓는데 동작을 안함...
This commit is contained in:
@@ -44,10 +44,8 @@ public class AdminCreatePostController {
|
|||||||
bindingVO.getSeq(),
|
bindingVO.getSeq(),
|
||||||
bindingVO.getId(),
|
bindingVO.getId(),
|
||||||
bindingVO.getPassword(),
|
bindingVO.getPassword(),
|
||||||
bindingVO.getEmail(),
|
|
||||||
bindingVO.getRegionMainCode(),
|
bindingVO.getRegionMainCode(),
|
||||||
bindingVO.getAccountDisabled(),
|
bindingVO.getAccountDisabled(),
|
||||||
bindingVO.getAccountLocked(),
|
|
||||||
bindingVO.getRoleIds());
|
bindingVO.getRoleIds());
|
||||||
|
|
||||||
redirectAttributes.addFlashAttribute(
|
redirectAttributes.addFlashAttribute(
|
||||||
|
|||||||
@@ -53,12 +53,9 @@ class AdminUpdateGetController {
|
|||||||
output.getSeq(),
|
output.getSeq(),
|
||||||
output.getId(),
|
output.getId(),
|
||||||
null,
|
null,
|
||||||
output.getEmail(),
|
|
||||||
output.getRegionMainCode(),
|
output.getRegionMainCode(),
|
||||||
output.getPasswordUpdatedAt(),
|
output.getPasswordUpdatedAt(),
|
||||||
output.getAccountDisabled(),
|
output.getAccountDisabled(),
|
||||||
output.getLoginFailCnt(),
|
|
||||||
output.getAccountLocked(),
|
|
||||||
output.getRoles().stream().map(CoreRole::getId).collect(Collectors.toList()));
|
output.getRoles().stream().map(CoreRole::getId).collect(Collectors.toList()));
|
||||||
|
|
||||||
model.addAttribute("bindingVO", bindingVO);
|
model.addAttribute("bindingVO", bindingVO);
|
||||||
|
|||||||
@@ -44,10 +44,8 @@ class AdminUpdatePostController {
|
|||||||
bindingVO.getSeq(),
|
bindingVO.getSeq(),
|
||||||
bindingVO.getId(),
|
bindingVO.getId(),
|
||||||
bindingVO.getUpdatePassword(),
|
bindingVO.getUpdatePassword(),
|
||||||
bindingVO.getEmail(),
|
|
||||||
bindingVO.getRegionMainCode(),
|
bindingVO.getRegionMainCode(),
|
||||||
bindingVO.getAccountDisabled(),
|
bindingVO.getAccountDisabled(),
|
||||||
bindingVO.getAccountLocked(),
|
|
||||||
bindingVO.getRoleIds());
|
bindingVO.getRoleIds());
|
||||||
|
|
||||||
redirectAttributes.addFlashAttribute(
|
redirectAttributes.addFlashAttribute(
|
||||||
|
|||||||
@@ -15,15 +15,15 @@ public class AdminCreateBindingVO {
|
|||||||
private String id;
|
private String id;
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@NotBlank(message = "{valid.common.required}")
|
/* @NotBlank(message = "{valid.common.required}")
|
||||||
@Pattern(
|
@Pattern(
|
||||||
regexp =
|
regexp =
|
||||||
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
|
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
|
||||||
message = "{valid.common.email.wrong}")
|
message = "{valid.common.email.wrong}")
|
||||||
private String email;
|
private String email;*/
|
||||||
|
|
||||||
private Boolean accountDisabled;
|
private Boolean accountDisabled;
|
||||||
private Boolean accountLocked;
|
/* private Boolean accountLocked;*/
|
||||||
private List<String> roleIds;
|
private List<String> roleIds;
|
||||||
private String regionMainCode;
|
private String regionMainCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,17 +26,17 @@ public class AdminUpdateBindingVO implements AuditOutput {
|
|||||||
private String id;
|
private String id;
|
||||||
private String updatePassword;
|
private String updatePassword;
|
||||||
|
|
||||||
@NotBlank(message = "{valid.common.required}")
|
/* @NotBlank(message = "{valid.common.required}")
|
||||||
@Pattern(
|
@Pattern(
|
||||||
regexp =
|
regexp =
|
||||||
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
|
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
|
||||||
message = "{valid.common.email.wrong}")
|
message = "{valid.common.email.wrong}")
|
||||||
private String email;
|
private String email;*/
|
||||||
private String regionMainCode;
|
private String regionMainCode;
|
||||||
|
|
||||||
private LocalDateTime passwordUpdatedAt;
|
private LocalDateTime passwordUpdatedAt;
|
||||||
private Boolean accountDisabled;
|
private Boolean accountDisabled;
|
||||||
private Integer loginFailCnt;
|
/* private Integer loginFailCnt;
|
||||||
private Boolean accountLocked;
|
private Boolean accountLocked;*/
|
||||||
private List<String> roleIds;
|
private List<String> roleIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,147 +2,160 @@
|
|||||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
xmlns:th="http://www.thymeleaf.org">
|
xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<section class="fw-bold" layout:fragment="content">
|
<section layout:fragment="content">
|
||||||
|
|
||||||
<form
|
<form
|
||||||
method="post"
|
method="post"
|
||||||
th:action="@{/settings/admins/create}"
|
th:action="@{/settings/admins/create}"
|
||||||
th:object="${bindingVO}">
|
th:object="${bindingVO}">
|
||||||
|
|
||||||
<div class="row mb-3">
|
<table class="type-form">
|
||||||
<label class="col-sm-2 col-form-label" for="id">ID *</label>
|
<tbody>
|
||||||
<div class="col-sm-4">
|
<tr>
|
||||||
<input class="form-control" id="id"
|
<th><label for="roleIds">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||||
th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'"
|
<td>
|
||||||
th:field="*{id}"/>
|
<div class="d-flex">
|
||||||
<div class="invalid-feedback fw-bold" th:errors="*{id}"
|
<div class="component-input">
|
||||||
th:if="${#fields.hasErrors('id')}">
|
<div class="d-flex">
|
||||||
에러 메세지
|
<div class="component-select">
|
||||||
</div>
|
<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>
|
</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>
|
</form>
|
||||||
|
|
||||||
<script>
|
<th:block layout:fragment="script">
|
||||||
function gotoList() {
|
<script th:inline="javascript">
|
||||||
document.prevAdminParamForm ? document.prevAdminParamForm.submit()
|
function gotoList() {
|
||||||
: location.href = '/settings/admins';
|
if (document.prevAdminParamForm) {
|
||||||
}
|
const f = document.prevAdminParamForm;
|
||||||
</script>
|
f.submit();
|
||||||
|
} else {
|
||||||
|
location.href = '/settings/admins';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<script>
|
$(document).ready(() => {
|
||||||
const onRoleChange = (el) => {
|
const roleSelect = document.getElementById('roleIds');
|
||||||
$('.regionMainCodeArea').toggle(el.value !== "ROLE_ADMIN");
|
onRoleChange(roleSelect);
|
||||||
}
|
});
|
||||||
</script>
|
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>
|
</section>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
xmlns:th="http://www.thymeleaf.org">
|
xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<section class="fw-bold" layout:fragment="content">
|
<section layout:fragment="content">
|
||||||
|
|
||||||
<form
|
<form
|
||||||
method="post"
|
method="post"
|
||||||
@@ -11,171 +11,172 @@
|
|||||||
|
|
||||||
<input type="hidden" name="seq" th:field="*{seq}"/>
|
<input type="hidden" name="seq" th:field="*{seq}"/>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<table class="type-form">
|
||||||
<label class="col-sm-2 col-form-label" for="id">ID *</label>
|
<tbody>
|
||||||
<div class="col-sm-4">
|
<tr>
|
||||||
<input class="form-control" id="id" readonly="readonly"
|
<th> <label for="roleIds">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
|
||||||
th:field="*{id}"/>
|
<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>
|
</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>
|
</form>
|
||||||
|
|
||||||
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->
|
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->
|
||||||
<th:block th:if="${listStatus != null}">
|
<th:block th:if="${listStatus != null}">
|
||||||
<form method="get" name="prevAdminParamForm"
|
<form method="get" name="prevAdminParamForm"
|
||||||
th:action="@{/settings/admins}"
|
th:action="@{/settings/admins}"
|
||||||
th:object="${listStatus}">
|
th:object="${listStatus}">
|
||||||
<input th:field="*{searchField}" type="hidden">
|
<input th:field="*{searchField}" type="hidden">
|
||||||
<input th:field="*{searchValue}" type="hidden">
|
<input th:field="*{searchValue}" type="hidden">
|
||||||
<input th:field="*{searchRole}" type="hidden">
|
<input th:field="*{searchRole}" type="hidden">
|
||||||
<th:block th:if="${pageable != null}">
|
<th:block th:if="${pageable != null}">
|
||||||
<input name="page" th:value="${pageable.page}" type="hidden"/>
|
<input name="page" th:value="${pageable.page}" type="hidden"/>
|
||||||
<input name="sort" th:value="${pageable.sort}" type="hidden"/>
|
<input name="sort" th:value="${pageable.sort}" type="hidden"/>
|
||||||
</th:block>
|
</th:block>
|
||||||
</form>
|
</form>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<script th:inline="javascript">
|
<th:block layout:fragment="script">
|
||||||
function gotoList() {
|
<script th:inline="javascript">
|
||||||
if (document.prevAdminParamForm) {
|
function gotoList() {
|
||||||
const f = document.prevAdminParamForm;
|
if (document.prevAdminParamForm) {
|
||||||
f.sort.value = convertToPageableSortValue(f.sort.value);
|
const f = document.prevAdminParamForm;
|
||||||
f.submit();
|
f.submit();
|
||||||
} else {
|
} else {
|
||||||
location.href = '/settings/admins';
|
location.href = '/settings/admins';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
showAudit([[${bindingVO.id}]], [[${bindingVO.createdBy}]],
|
showAudit([[${bindingVO.id}]], [[${bindingVO.createdBy}]],
|
||||||
[[${#temporals.format(bindingVO.createdAt, "yyyy-MM-dd'T'HH:mm:ss")}]],
|
[[${#temporals.format(bindingVO.createdAt, "yyyy-MM-dd'T'HH:mm:ss")}]],
|
||||||
[[${bindingVO.updatedBy}]],
|
[[${bindingVO.updatedBy}]],
|
||||||
[[${#temporals.format(bindingVO.updatedAt, "yyyy-MM-dd'T'HH:mm:ss")}]]);
|
[[${#temporals.format(bindingVO.updatedAt, "yyyy-MM-dd'T'HH:mm:ss")}]]);
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
// 초기 로드 시 roleIds에 따라 regionMainCodeArea 표시/숨김
|
||||||
const onRoleChange = (el) => {
|
const roleSelect = document.getElementById('roleIds');
|
||||||
$('.regionMainCodeArea').toggle(el.value !== "ROLE_ADMIN");
|
if (roleSelect) {
|
||||||
}
|
onRoleChange(roleSelect);
|
||||||
</script>
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const onRoleChange = (el) => {
|
||||||
|
const isAdmin = el.value === 'ROLE_ADMIN' || !el.value;
|
||||||
|
$('.regionMainCodeArea').toggle(!isAdmin);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</th:block>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -47,10 +47,8 @@ class AdminAuthFailHandlerTest {
|
|||||||
1L,
|
1L,
|
||||||
testUsername,
|
testUsername,
|
||||||
"test.1@#$",
|
"test.1@#$",
|
||||||
"xx4@test.com",
|
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,8 @@ class AdminDetailsServiceTest {
|
|||||||
1L,
|
1L,
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
"xx1@test.com",
|
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,8 @@ class AdminCreateUpdateDaoTest {
|
|||||||
1L,
|
1L,
|
||||||
"admin_for_createDao_test",
|
"admin_for_createDao_test",
|
||||||
"test.1@#$",
|
"test.1@#$",
|
||||||
"admin_for_createDao_test@test.com",
|
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
|
||||||
|
|
||||||
adminViewPortIn
|
adminViewPortIn
|
||||||
@@ -56,10 +54,8 @@ class AdminCreateUpdateDaoTest {
|
|||||||
2L,
|
2L,
|
||||||
"admin_for_createDao_test",
|
"admin_for_createDao_test",
|
||||||
"test.1@#$",
|
"test.1@#$",
|
||||||
"admin_for_createDao_test@test.com",
|
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
List.of("ROLE_STAFF"));
|
List.of("ROLE_STAFF"));
|
||||||
assertEquals(
|
assertEquals(
|
||||||
1,
|
1,
|
||||||
|
|||||||
@@ -32,10 +32,8 @@ public class InitAdminData implements ApplicationRunner {
|
|||||||
null,
|
null,
|
||||||
"test-admin",
|
"test-admin",
|
||||||
"admin1@#$",
|
"admin1@#$",
|
||||||
"admin@framework.org",
|
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
List.of("ROLE_ADMIN"));
|
List.of("ROLE_ADMIN"));
|
||||||
|
|
||||||
// 지방실사
|
// 지방실사
|
||||||
@@ -43,10 +41,8 @@ public class InitAdminData implements ApplicationRunner {
|
|||||||
null,
|
null,
|
||||||
"test-local-inspection",
|
"test-local-inspection",
|
||||||
"local1@#$",
|
"local1@#$",
|
||||||
"local@framework.org",
|
|
||||||
"code.region.main.1",
|
"code.region.main.1",
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
List.of("ROLE_LOCAL_INSPECTION"));
|
List.of("ROLE_LOCAL_INSPECTION"));
|
||||||
|
|
||||||
// 조사원
|
// 조사원
|
||||||
@@ -54,10 +50,8 @@ public class InitAdminData implements ApplicationRunner {
|
|||||||
null,
|
null,
|
||||||
"test-researcher",
|
"test-researcher",
|
||||||
"researcher1@#$",
|
"researcher1@#$",
|
||||||
"researcher@framework.org",
|
|
||||||
"code.region.main.1",
|
"code.region.main.1",
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
List.of("ROLE_RESEARCHER"));
|
List.of("ROLE_RESEARCHER"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ public interface SaveAdminPortIn {
|
|||||||
Long seq,
|
Long seq,
|
||||||
String id,
|
String id,
|
||||||
String password,
|
String password,
|
||||||
String email,
|
|
||||||
String regionMainCode,
|
String regionMainCode,
|
||||||
Boolean accountDisabled,
|
Boolean accountDisabled,
|
||||||
Boolean accountLocked,
|
|
||||||
List<String> roleIds);
|
List<String> roleIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,8 @@ public class SaveAdminService implements SaveAdminPortIn {
|
|||||||
Long seq,
|
Long seq,
|
||||||
String id,
|
String id,
|
||||||
String password,
|
String password,
|
||||||
String email,
|
|
||||||
String regionMainCode,
|
String regionMainCode,
|
||||||
Boolean accountDisabled,
|
Boolean accountDisabled,
|
||||||
Boolean accountLocked,
|
|
||||||
List<String> roleIds) {
|
List<String> roleIds) {
|
||||||
|
|
||||||
LocalDateTime passwordUpdatedAt;
|
LocalDateTime passwordUpdatedAt;
|
||||||
@@ -58,11 +56,8 @@ public class SaveAdminService implements SaveAdminPortIn {
|
|||||||
id,
|
id,
|
||||||
password,
|
password,
|
||||||
passwordUpdatedAt,
|
passwordUpdatedAt,
|
||||||
email,
|
|
||||||
regionMainCode,
|
regionMainCode,
|
||||||
accountDisabled,
|
accountDisabled,
|
||||||
loginFailCnt,
|
|
||||||
accountLocked,
|
|
||||||
roleIds
|
roleIds
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ public class SaveAdminCmd extends AuditCommand {
|
|||||||
private String id;
|
private String id;
|
||||||
private String encodedPassword;
|
private String encodedPassword;
|
||||||
private LocalDateTime passwordUpdatedAt;
|
private LocalDateTime passwordUpdatedAt;
|
||||||
private String email;
|
/* private String email;*/
|
||||||
private String regionMainCode;
|
private String regionMainCode;
|
||||||
private Boolean accountDisabled;
|
private Boolean accountDisabled;
|
||||||
private Integer loginFailCnt;
|
/* private Integer loginFailCnt;
|
||||||
private Boolean accountLocked;
|
private Boolean accountLocked;*/
|
||||||
private List<String> roleIds;
|
private List<String> roleIds;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user