emile 9 months ago
parent 07fe5b7b74
commit c471ffdec7

BIN
osinaweb/.DS_Store vendored

Binary file not shown.

Binary file not shown.

@ -78,7 +78,11 @@ class Osichat(WebsocketConsumer):
event = {
'type': 'get_chats_handler',
}
self.get_chats_handler(event)
if data.get('whereAmI') == 'Chats':
self.get_chats_handler(event)
else:
self.get_visitors_handler(event)
if event_type == 'get_chats':
event = {

Binary file not shown.

Binary file not shown.

@ -15,9 +15,15 @@
<div class="flex flex-col">
<p class="text-secondosiblue font-poppinsBold">{{visitor.ip_address}}</p>
<p class="text-fifthosiblue text-xs">{{visitor.visitorlog_set.all.last.url}}</p>
<p class="text-fifthosiblue text-xs">
{% if not visitor.visitorlog_set.all.last.title %}
{{ visitor.visitorlog_set.all.last.url|slice:":26" }}{% if visitor.visitorlog_set.all.last.url|length > 26 %}…{% endif %}
{% else %}
{{ visitor.visitorlog_set.all.last.title|slice:":26" }}{% if visitor.visitorlog_set.all.last.title|length > 26 %}…{% endif %}
{% endif %}
</p>
</div>
</div>
<p class="duration text-gray-500 text-sm">{{visitor.total_duration}}</p>

@ -1,54 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Account Activation</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f9f9f9;
text-align: center;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2 {
color: #20336b;
}
p {
color: #374a7a;
}
.btn {
display: inline-block;
padding: 10px 20px;
background-color: #20336b;
color: #ffffff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.btn:hover {
background-color: #374a7a;
}
</style>
</head>
<body>
<div class="container">
<h2>Activate your account at Ositcom</h2>
<p>Hello {{ user.first_name }},</p>
<p>Thank you for signing up! To help us confirm your identity, please click the button below to activate your account and verify your email address:</p>
<p><a class="btn" href="{{activate_link}}">Activate Account</a></p>
<p>If you didn't request this, you can safely ignore this email.</p>
<p>Regards,<br>The Ositcom Team</p>
</div>
</body>
</html>

@ -4,6 +4,7 @@ let admin_chat_domain = "osina.ositcom.com";
let userId = document.getElementById('userId').textContent.trim();
let osichatadminroomSocket = null;
let currentChatId = null;
let whereAmI = null;
// FUNCTIONS TO SHOW & HIDE THE LOADER
function showLoader() {
@ -39,7 +40,8 @@ function initializeOsichat(){
osichatroomsSocket.send(JSON.stringify({
'event_type': 'set_client_type',
'client_type': 'website_admin',
'user_id': userId
'user_id': userId,
'whereAmI': whereAmI === 'Visitors' ? 'Visitors' : 'Chats' // Default to 'Chats' if not 'Visitors'
}));
};
@ -148,6 +150,7 @@ const chatsTab = document.getElementById('chatsTab');
const visitorsTab = document.getElementById('visitorsTab');
function switchToChats() {
whereAmI = 'Chats';
chatsTab.classList.add('bg-white', 'text-secondosiblue', 'shadow-md');
chatsTab.classList.remove('bg-gray-100', 'text-gray-400');
visitorsTab.classList.add('bg-gray-100', 'text-gray-400');
@ -159,6 +162,7 @@ function switchToChats() {
}
function switchToVisitors() {
whereAmI = 'Visitors';
visitorsTab.classList.add('bg-white', 'text-secondosiblue', 'shadow-md');
visitorsTab.classList.remove('bg-gray-100', 'text-gray-400');
chatsTab.classList.add('bg-gray-100', 'text-gray-400');
@ -172,6 +176,8 @@ function switchToVisitors() {
chatsTab.addEventListener('click', switchToChats);
visitorsTab.addEventListener('click', switchToVisitors);
let updateInterval;
function updateOnlineDurations() {
document.querySelectorAll('.visitor').forEach(visitorDiv => {

@ -115,6 +115,12 @@ async function initializeVisitorsWebSocket() {
visitorsSocket.onerror = (error) => {
console.error('WebSocket error:', error);
};
window.addEventListener('offline', () => {
if (visitorsSocket) {
visitorsSocket.close();
}
});
}

Loading…
Cancel
Save