대시보드 구성
parent
f6ed78269b
commit
d84c7f3ea4
|
|
@ -59,7 +59,7 @@ public class SecurityConfig{
|
|||
@Bean
|
||||
protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.authorizeRequests() // 페이지 권한 설정
|
||||
.antMatchers("/file/**", "/board/**", "/info/**").hasRole(Role.USER.name()) // USER, ADMIN 접근 허용
|
||||
.antMatchers("/dashboard").hasRole(Role.USER.name()) // USER, ADMIN 접근 허용
|
||||
.antMatchers("/admin/**").hasRole(Role.ADMIN.name()) // ADMIN만 접근 허용
|
||||
.antMatchers("/login").permitAll() // 로그인 페이지는 권한 없이 접근 허용
|
||||
.and() // 로그인 설정
|
||||
|
|
|
|||
|
|
@ -23,11 +23,7 @@ public class BaseController {
|
|||
if(loginUser == null){
|
||||
mav = new ModelAndView("redirect:/login");
|
||||
}else{
|
||||
if(loginUser.getUserRole().indexOf("ADMIN")>0){
|
||||
mav = new ModelAndView("redirect:/admin/main");
|
||||
}else{
|
||||
mav = new ModelAndView("redirect:/board/main");
|
||||
}
|
||||
mav = new ModelAndView("redirect:/dashboard");
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
|
@ -56,4 +52,10 @@ public class BaseController {
|
|||
ModelAndView mav = new ModelAndView("login/denied");
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/dashboard")
|
||||
public ModelAndView dashboard() {
|
||||
ModelAndView mav = new ModelAndView("login/dashboard");
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,6 @@ public class UserInfo extends BaseModel implements UserDetails{
|
|||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return userStatus.equals("ST002");
|
||||
return userStatus.equals("ST003");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class UserInfoService implements UserDetailsService {
|
|||
return "userIdDuplication";
|
||||
}
|
||||
userInfo.setUserRole(Role.USER.getValue());
|
||||
userInfo.setUserStatus("ST001");
|
||||
userInfo.setUserStatus("ST002");
|
||||
userInfo.setPassword(convertPassword(userInfo.getPassword()));
|
||||
return userInfoRepository.save(userInfo).getUserId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,3 @@
|
|||
|
||||
.centerDiv{
|
||||
max-height: fit-content;
|
||||
}
|
||||
|
||||
/*스크롤기능 있지만 안보이게*/
|
||||
body::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*사이드바 카테고리 트리*/
|
||||
.btn-toggle:hover, .btn-toggle:focus {
|
||||
color: rgba(0, 0, 0, .85);
|
||||
background-color: #d2f4ea;
|
||||
}
|
||||
.btn-toggle::before {
|
||||
width: 1.25em;
|
||||
line-height: 0;
|
||||
content: url("/img/bootstrap-icons-1.7.1/caret-right-fill.svg");
|
||||
transition: transform .35s ease;
|
||||
transform-origin: 0.5em 50%;
|
||||
}
|
||||
.btn-toggle[aria-expanded="true"]::before {
|
||||
content: url("/img/bootstrap-icons-1.7.1/caret-down-fill.svg");
|
||||
/*왜 안돌까?*/
|
||||
/*transform: rotate(90deg);*/
|
||||
}
|
||||
|
||||
#fadeDiv{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
|
@ -42,13 +14,4 @@ body::-webkit-scrollbar {
|
|||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#list-group-line{
|
||||
padding-bottom: 52vh;
|
||||
}
|
||||
|
||||
/*@media (max-width:1199px)*/
|
||||
/* .sidebar {*/
|
||||
/* left: -300px;*/
|
||||
/* }*/
|
||||
}
|
||||
|
|
@ -1,48 +1,3 @@
|
|||
let categorySeq;
|
||||
|
||||
$(document).on('click', '#moveRightBtn', function (){
|
||||
moveCategorySelectBody(1);
|
||||
})
|
||||
$(document).on('click', '#moveLeftBtn', function (){
|
||||
moveCategorySelectBody(-1);
|
||||
})
|
||||
$(document).on('click', '.contentWriteBtn', function (){
|
||||
location.href="/board/contentWrite"+(categorySeq!==undefined?("?categorySeq="+categorySeq):"");
|
||||
})
|
||||
function sessionReload(){
|
||||
$.ajax({
|
||||
url: '/refreshSession',
|
||||
type: 'GET',
|
||||
success: function(){location.reload();},
|
||||
error:function(){}
|
||||
});
|
||||
}
|
||||
function moveCategorySelectBody(direction){
|
||||
const categorySelectBody = $("#categorySelectBody");
|
||||
const nowX = categorySelectBody.scrollLeft();
|
||||
categorySelectBody.animate({scrollLeft:(direction*200+nowX)},200);
|
||||
}
|
||||
function setMenu(){
|
||||
const categorySeq = getParam("categorySeq");
|
||||
openMenu($("[data-categoryseq='"+categorySeq+"']").attr("data-parentseq"));
|
||||
}
|
||||
|
||||
function getParam(sname) {
|
||||
const paramAry = location.search.substr(1).split("&");
|
||||
for (let i = 0; i < paramAry.length; i++) {
|
||||
const param = paramAry[i].split("=");
|
||||
if (param[0] === sname) { return param[1]; }
|
||||
}
|
||||
}
|
||||
|
||||
function openMenu(parentSeq){
|
||||
if(parentSeq){
|
||||
const target = $("[data-categoryseq='"+parentSeq+"']")
|
||||
target.click();
|
||||
openMenu(target.attr("data-parentseq"));
|
||||
}
|
||||
}
|
||||
|
||||
function contentFade(action){
|
||||
if(action === "in"){
|
||||
$("#fadeDiv").show()
|
||||
|
|
|
|||
|
|
@ -2,14 +2,33 @@
|
|||
<html lang="ko"
|
||||
xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
|
||||
<header th:fragment="headerFragment" class="d-flex flex-wrap justify-content-center py-1 px-3 border-bottom">
|
||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
|
||||
<img id="logo" th:src="@{/img/logo.png}" alt="logo" title="logo">
|
||||
<!--<span class="fs-4">해양경찰청 파일관리 시스템</span>-->
|
||||
</a>
|
||||
<ul class="nav nav-pills" sec:authorize="isAuthenticated()">
|
||||
<li class="nav-item"><a href="/info/myInfo" class="nav-link">개인정보</a></li>
|
||||
<li class="nav-item"><a href="/logout" class="nav-link">로그아웃</a></li>
|
||||
</ul>
|
||||
<header th:fragment="headerFragment" class="d-flex flex-wrap justify-content-between py-1 px-3 border-bottom">
|
||||
<div sec:authorize="isAnonymous()">
|
||||
<a href="/" class="d-flex">
|
||||
<img id="logo" th:src="@{/img/logo.png}" alt="logo" title="logo">
|
||||
<!--<span class="fs-4">해양경찰청 파일관리 시스템</span>-->
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="nav nav-pills" sec:authorize="hasRole('ROLE_ADMIN')">
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">코드관리</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">메뉴관리</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">외사경찰관리</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">권한설정</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">사용자로그</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">접속설정</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div sec:authorize="isAuthenticated()">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark"><i class="bi bi-bell-fill"></i></a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">공지사항</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">게시판</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">자료실</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">Q&A</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link p-1 link-dark">마이페이지</a></li>
|
||||
<li class="nav-item"><a href="/logout" class="nav-link p-1 link-dark">로그아웃</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
</html>
|
||||
|
|
@ -2,92 +2,24 @@
|
|||
<html lang="ko"
|
||||
xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5" xmlns="http://www.w3.org/1999/html">
|
||||
<div id="list-group-line" class="mx-3 pt-3" th:fragment="leftMenuFragment">
|
||||
<div sec:authorize="hasRole('ROLE_ADMIN')">
|
||||
<div class="list-group py-2">
|
||||
<!--<a href="/admin/categoryMgt" class="list-group-item list-group-item-action">게시판 분류 관리</a>-->
|
||||
<a href="/admin/categoryMgt2" class="list-group-item list-group-item-action">게시판 분류 관리</a>
|
||||
<a href="/admin/userMgt" class="list-group-item list-group-item-action">사용자 관리</a>
|
||||
<a href="/info/modifyRequestList" class="list-group-item list-group-item-action">수정 요청</a>
|
||||
<a href="#" class="list-group-item list-group-item-action disabled">통계</a>
|
||||
<a href="/admin/codeMgt" class="list-group-item list-group-item-action">코드관리</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-primary" href="/board/contentSearch"><i class="bi bi-search"></i> 통합 검색</a>
|
||||
</div>
|
||||
<div class="d-grid gap-2 pt-1">
|
||||
<a class="btn btn-success contentWriteBtn"><i class="bi bi-file-earmark-plus "></i> 자료 등록</a>
|
||||
</div>
|
||||
<div sec:authorize="isAuthenticated()">
|
||||
<div class="flex-shrink-0 pe-3 py-3 bg-transparent">
|
||||
<ul class="list-unstyled ps-0">
|
||||
<th:block th:each="depth1:${session.categoryList}">
|
||||
<li class="mb-1">
|
||||
<button class="btn btn-toggle align-items-center rounded collapsed"
|
||||
data-bs-toggle="collapse" aria-expanded="false"
|
||||
th:data-categoryseq="${depth1.categorySeq}"
|
||||
th:data-bs-target="'#collapse'+${depth1.categorySeq}" th:text="${depth1.categoryName}">
|
||||
</button>
|
||||
<div class="collapse ps-3" th:id="|collapse${depth1.categorySeq}|">
|
||||
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1">
|
||||
<th:block th:each="depth2:${depth1.childCategoryList}">
|
||||
<li>
|
||||
<ul class="list-unstyled ps-0">
|
||||
<li class="mb-1">
|
||||
<button class="btn btn-toggle align-items-center rounded collapsed"
|
||||
data-bs-toggle="collapse" aria-expanded="false"
|
||||
th:data-categoryseq="${depth2.categorySeq}" th:data-parentseq="${depth2.parentSeq}"
|
||||
th:data-bs-target="'#collapse'+${depth2.categorySeq}" th:text="${depth2.categoryName}">
|
||||
</button>
|
||||
<div class="collapse ps-3" th:id="|collapse${depth2.categorySeq}|">
|
||||
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1">
|
||||
<th:block th:each="depth3:${depth2.childCategoryList}">
|
||||
<li>
|
||||
<ul class="list-unstyled ps-0">
|
||||
<li class="mb-1">
|
||||
<button class="btn btn-toggle align-items-center rounded collapsed"
|
||||
data-bs-toggle="collapse" aria-expanded="false"
|
||||
th:data-categoryseq="${depth3.categorySeq}" th:data-parentseq="${depth3.parentSeq}"
|
||||
th:data-bs-target="'#collapse'+${depth3.categorySeq}" th:text="${depth3.categoryName}">
|
||||
</button>
|
||||
<div class="collapse ps-3" th:id="|collapse${depth3.categorySeq}|">
|
||||
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1">
|
||||
<th:block th:each="depth4:${depth3.childCategoryList}">
|
||||
<li><a th:href="|@{/board/contentList}?categorySeq=${depth4.categorySeq}|"
|
||||
th:data-categoryseq="${depth4.categorySeq}" th:data-parentseq="${depth4.parentSeq}"
|
||||
class="bi bi-dash link-dark rounded ps-3 text-decoration-none"
|
||||
th:text="${depth4.categoryName}"></a></li>
|
||||
</th:block>
|
||||
<th:block th:if="${depth3.childCategoryList.size==0}">
|
||||
<li>등록된 소분류가 없습니다.</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:if="${depth2.childCategoryList.size==0}">
|
||||
<li>등록된 중분류가 없습니다.</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:if="${depth1.childCategoryList.size==0}">
|
||||
<li>등록된 연도가 없습니다.</li>
|
||||
</th:block>
|
||||
<!--<li><a href="#" class="link-dark rounded">Shipped</a></li>
|
||||
<li><a href="#" class="link-dark rounded">Returned</a></li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mx-3 pt-3" th:fragment="leftMenuFragment">
|
||||
<a href="/" class="d-flex">
|
||||
<img id="logo" th:src="@{/img/logo.png}" alt="logo" title="logo">
|
||||
<!--<span class="fs-4">해양경찰청 파일관리 시스템</span>-->
|
||||
</a>
|
||||
<ul class="nav nav-pills flex-column my-3" sec:authorize="isAuthenticated()">
|
||||
<li><a href="#" class="nav-link link-dark">외사정보관리</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사수사관리</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사방첩관리</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사대상목표</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">정보예산관리</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사장비</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">첩보수집활동</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사첩보망</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사모니터링</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사통계</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">외사경찰</a></li>
|
||||
<li><a href="#" class="nav-link link-dark">민간통역인</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -35,25 +35,17 @@
|
|||
<th:block layout:fragment="script"></th:block>
|
||||
<th:block sec:authorize="isAuthenticated()">
|
||||
<script type="text/javascript">
|
||||
$(function (){
|
||||
/*세션 체크*/
|
||||
const positionList = '[[${session.positionList}]]';
|
||||
const departmentList = '[[${session.departmentList}]]';
|
||||
if(!positionList && !departmentList) {
|
||||
sessionReload()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</th:block>
|
||||
</head>
|
||||
<body class="d-flex flex-column h-100">
|
||||
<header th:replace="fragments/header :: headerFragment"></header>
|
||||
<div class="h-100" sec:authorize="isAnonymous()" layout:fragment="content"></div>
|
||||
<div sec:authorize="isAuthenticated()" class="row mx-0">
|
||||
<div class="sidebar col-2 d-lg-block d-none centerDiv border-end">
|
||||
<div sec:authorize="isAnonymous()" layout:fragment="content"></div>
|
||||
<div sec:authorize="isAuthenticated()" class="row h-100 mx-0">
|
||||
<div class="col-2 border-end">
|
||||
<div th:replace="fragments/leftMenu :: leftMenuFragment"></div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-10 centerDiv">
|
||||
<div class="col-10">
|
||||
<div layout:fragment="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/layout}">
|
||||
<th:block layout:fragment="script">
|
||||
<script type="text/javascript" th:src="@{/js/admin/userMgt.js}"></script>
|
||||
</th:block>
|
||||
<div layout:fragment="content">
|
||||
<main class="pt-3">
|
||||
<h4>대시보드</h4>
|
||||
<div class="row mx-0">
|
||||
<div class="col-12 card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
목록1
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
목록2
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
목록3
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
목록4
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
목록5
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
목록6
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/layout}">
|
||||
<div layout:fragment="content">
|
||||
<form th:action="@{/signup}" method="post">
|
||||
<input type="text" name="userId" placeholder="이메일 입력해주세요" />
|
||||
<input type="password" name="password" placeholder="비밀번호" />
|
||||
<input type="radio" name="userRole" value="ROLE_ADMIN,ROLE_USER" /> admin
|
||||
<input type="radio" name="userRole" value="ROLE_USER" checked="checked" />
|
||||
member <br />
|
||||
<button type="submit">가입하기</button>
|
||||
</form>
|
||||
</div>
|
||||
</html>
|
||||
Loading…
Reference in New Issue