Artteiv commited on
Commit
a165d25
1 Parent(s): 46d747a
chat/database_manage.py CHANGED
@@ -44,6 +44,7 @@ class DataManage:
44
  try:
45
  rooms = Room.objects.filter(UserName=username)
46
  room_ids = [{'id':str(room.RoomID),'name':room.Name} for room in rooms]
 
47
  return room_ids
48
  except Room.DoesNotExist:
49
  return []
 
44
  try:
45
  rooms = Room.objects.filter(UserName=username)
46
  room_ids = [{'id':str(room.RoomID),'name':room.Name} for room in rooms]
47
+ room_ids.reverse()
48
  return room_ids
49
  except Room.DoesNotExist:
50
  return []
chat/templates/index.html CHANGED
@@ -40,6 +40,9 @@
40
  padding: 20px;
41
  overflow-y: auto;
42
  }
 
 
 
43
  </style>
44
  </head>
45
  <script>
@@ -52,7 +55,9 @@
52
  <body>
53
  <div id="app" class="container">
54
  <div class="left-column">
55
- <h2 class="text-xl font-medium mb-4">Lịch sử đoạn chat</h2>
 
 
56
  <ul class="list-none">
57
  {% for x in rooms %}
58
  <li class="p-2 bg-[#4A4A4A] mb-2 rounded flex justify-between items-center">
@@ -63,6 +68,7 @@
63
  </li>
64
  {% endfor %}
65
  </ul>
 
66
  </div>
67
 
68
  <div class="right-column flex flex-col md:mx-auto mx-0 bg-[#2E2E2E] w-full h-screen">
 
40
  padding: 20px;
41
  overflow-y: auto;
42
  }
43
+ .logout-button {
44
+ margin-left: 30px; /* Adjust this value for more space */
45
+ }
46
  </style>
47
  </head>
48
  <script>
 
55
  <body>
56
  <div id="app" class="container">
57
  <div class="left-column">
58
+ <h2 class="text-xl font-medium mb-4">Lịch sử đoạn chat<button @click="logout" class="bg-blue-500 text-white px-2 py-1 rounded mt-2 logout-button">
59
+ <a :href="`/users/logout`">Logout</a>
60
+ </button></h2>
61
  <ul class="list-none">
62
  {% for x in rooms %}
63
  <li class="p-2 bg-[#4A4A4A] mb-2 rounded flex justify-between items-center">
 
68
  </li>
69
  {% endfor %}
70
  </ul>
71
+
72
  </div>
73
 
74
  <div class="right-column flex flex-col md:mx-auto mx-0 bg-[#2E2E2E] w-full h-screen">
db.sqlite3 CHANGED
Binary files a/db.sqlite3 and b/db.sqlite3 differ