Skip to content

Commit

Permalink
#10
Browse files Browse the repository at this point in the history
[fix] 접속중인 user 테이블 추가
  • Loading branch information
daehwan2yo committed Jun 2, 2021
1 parent fa01787 commit 86681e1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public void message_in(WebSocketSession webSocketSession, ChatMessage chatMessag

// inetSocketAddress 형태의 주소를 String형태로 캐스팅
// inetSocketAddress -> inetAddress : get String ip
account.insertSession(webSocketSession.getId(),
webSocketSession.getRemoteAddress().getAddress().getHostAddress());
account.insertSession(webSocketSession.getId(),webSocketSession.getRemoteAddress().getAddress().getHostAddress());
account.enterRoom(chatRoom);

chatRoomRepository.flush();
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/static/table.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
table {
width: 100%;
border: 1px solid #444444;
border-collapse: collapse;
}
th, td {
border: 1px solid #444444;
padding: 10px;
}
27 changes: 16 additions & 11 deletions src/main/resources/templates/connecting.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,33 @@
<body>

<section class="content">
<div class="row">
<div class="box">

<div class="box">
<div class="container">
<div class="box-header">
<h3 class="box-title">접속중인 유저</h3>
</div>

<div class="box-body" th:if="${accountList} != null">
<div class="row" th:if="${accountList} != null">
<p>현재 접속중인 유저 수 : </p>
<p th:text="${count}"></p>
<table id="table">
<thead>
<table class="table">
<thead class="thead-dark">
<tr>
<th>닉네임</th>
<th>연결된 시각</th>
<th>ip 주소</th>
<th>접속중인 채팅방</th>
<th scope="col">닉네임</th>
<th scope="col">연결된 시각</th>
<th scope="col">ip 주소</th>
<th scope="col">접속중인 채팅방</th>
</tr>
</thead>
<tbody>
<tr th:each="account : ${accountList}">
<th scope="row"></th>
<td th:text="${account.nickname}">닉네임</td>
<td th:text="${account.created}">연결된 시각</td>

<td th:if="${account.sessionIp}==null" th:text="${account.sessionIp}">ip</td>
<td th:unless="${account.sessionIp}==null" th:text="null">ip</td>
<td th:if="${account.sessionIp}!=null" th:text="${account.sessionIp}">ip</td>
<td th:unless="${account.sessionIp}!=null" th:text="null">ip</td>


<td th:if="${account.chatRoom} != null" th:text="${account.chatRoom.type}">채팅방</td>
Expand All @@ -44,10 +45,14 @@ <h3 class="box-title">접속중인 유저</h3>
<div class="box-body" th:unless="${accountList} != null" th:text="${isNull}">

</div>
<a class="btn" href="/"> 돌아가기</a>
</div>


</div>

</section>


</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">

<link href="/static/table.css" rel="stylesheet">
<title>현재 연결된 유저 리스트</title>
</head>
9 changes: 8 additions & 1 deletion src/main/resources/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@

<head th:replace="fragments/home_header::home_header"/>

<style>
.container-main{
display: table;
margin-left: auto;
margin-right: auto ;
}
</style>
<body>

<div class="container">
<div class="container container-main">

<div class="mainmenu">
<h1>통큰 경매 관리자 페이지</h1>
Expand Down

0 comments on commit 86681e1

Please sign in to comment.