Skip to content

Commit

Permalink
feat: 캐릭터 대시보드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kamothi committed Nov 3, 2024
1 parent 2170263 commit 31ff08d
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ spring:

eureka:
client:
enabled: false # 로컬 환경에서 Eureka 클라이언트 비활성화
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka
instance:
prefer-ip-address: true
ip-address: localhost
instance-id: ${spring.application.name}:${server.port}

server:
port: 9500
Expand Down
123 changes: 123 additions & 0 deletions src/main/resources/static/css/character-inventory.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/* 기본 스타일 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Arial, sans-serif;
display: flex;
height: 100vh;
}

.container {
display: flex;
width: 100%;
}

.sidebar {
width: 250px;
background-color: #333;
color: #fff;
padding: 20px;
}

.sidebar .logo {
font-size: 20px;
text-align: center;
margin-bottom: 30px;
}

.sidebar .menu {
list-style-type: none;
}

.sidebar .menu li {
margin: 15px 0;
}

.sidebar .menu li a {
color: #ddd;
text-decoration: none;
display: block;
padding: 10px;
border-radius: 4px;
}

.sidebar .menu li a.active,
.sidebar .menu li a:hover {
background-color: #555;
color: #fff;
}

/* 메인 콘텐츠 스타일 */
.main-content {
flex-grow: 1;
padding: 20px;
background-color: #f4f4f4;
overflow-y: auto; /* 필요시 스크롤 추가 */
}

.main-content header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20px;
border-bottom: 1px solid #ccc;
}

.main-content header h2 {
font-size: 24px;
color: #333;
}

.header-right .btn {
margin-left: 10px;
padding: 8px 12px;
background-color: #333;
color: #fff;
text-decoration: none;
border-radius: 4px;
}

.content {
margin-top: 20px;
}

/* 테이블 스타일 */
table {
width: 100%;
border-collapse: collapse;
}

table thead th {
background-color: #f8f8f8;
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}

table tbody td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}

table tbody tr:hover {
background-color: #f1f1f1;
}

/* 버튼 스타일 */
.btn {
background-color: #007bff;
color: white;
padding: 5px 10px;
border: none;
border-radius: 3px;
cursor: pointer;
}

.btn:hover {
background-color: #0056b3;
}
60 changes: 60 additions & 0 deletions src/main/resources/templates/character-inventory.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>캐릭터 및 인벤토리 관리</title>
<link rel="stylesheet" href="/css/character-inventory.css">
</head>
<body>
<div class="container">
<!-- Sidebar -->
<nav class="sidebar">
<div class="logo">
<h1>쿠 관리자 페이지</h1>
</div>
<ul class="menu">
<li><a href="/dashboard">대시보드</a></li>
<li><a href="/dashboard">유저 관리</a></li>
<li><a href="/character-inventory" class="active">캐릭터 및 인벤토리 관리</a></li>
<li><a href="/admin/chat-management">채팅 관리</a></li>
<li><a href="/admin/game-records">게임 기록 조회</a></li>
<li><a href="/admin/settings">환경 설정</a></li>
</ul>
</nav>

<!-- Main Content -->
<div class="main-content">
<header>
<h2>캐릭터 및 인벤토리 관리</h2>
<div class="header-right">
<a href="/admin/preview" class="btn">미리보기</a>
<a href="/admin/logout" class="btn">로그아웃</a>
</div>
</header>

<section class="content">
<table class="character-table">
<thead>
<tr>
<th>캐릭터 이름</th>
<th>캐릭터 타입</th>
<th>유저 아이디</th>
<th>소유 금액</th>
<th>인벤토리 리스트</th>
</tr>
</thead>
<tbody>
<tr th:each="character : ${characterList}">
<td th:text="${character.nickname}"></td>
<td th:text="${character.characterType}"></td>
<td th:text="${character.userId}"></td>
<td th:text="${character.currentMoney}"></td>
<td th:text="${character.useItemList}"></td>
</tr>
</tbody>
</table>
</section>
</div>
</div>
</body>
</html>

0 comments on commit 31ff08d

Please sign in to comment.