diff --git a/.DS_Store b/.DS_Store index 8ef31658..795b3695 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/osinaweb/.DS_Store b/osinaweb/.DS_Store index 498e1706..88fc5fb7 100644 Binary files a/osinaweb/.DS_Store and b/osinaweb/.DS_Store differ diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 68cf7fe8..bf7d2f19 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc index a6950773..a446714b 100644 Binary files a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc and b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc differ diff --git a/osinaweb/osichat/api/__pycache__/views.cpython-310.pyc b/osinaweb/osichat/api/__pycache__/views.cpython-310.pyc index aa54544f..7ca2bba6 100644 Binary files a/osinaweb/osichat/api/__pycache__/views.cpython-310.pyc and b/osinaweb/osichat/api/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osichat/api/views.py b/osinaweb/osichat/api/views.py index f75175fc..eb587aac 100644 --- a/osinaweb/osichat/api/views.py +++ b/osinaweb/osichat/api/views.py @@ -26,13 +26,13 @@ def get_visitors(request): end_date = parse_date(end_date) if start_date and end_date: # Range of time - visitors = Visitor.objects.filter(Q(visitorlog__visit_date__date__range=[start_date, end_date]) | Q(visitorlog__left_date__date__range=[start_date, end_date])).distinct() + visitors = Visitor.objects.filter(Q(visitorlog__visit_date__date__range=[start_date, end_date]) | Q(visitorlog__left_date__date__range=[start_date, end_date])).distinct().annotate(latest_visit=Max('visitorlog__visit_date')).order_by('-latest_visit') elif start_date and not end_date: # Specific date - visitors = Visitor.objects.filter(Q(visitorlog__visit_date__date=start_date) | Q(visitorlog__left_date__date=start_date)).distinct() + visitors = Visitor.objects.filter(Q(visitorlog__visit_date__date=start_date) | Q(visitorlog__left_date__date=start_date)).distinct().annotate(latest_visit=Max('visitorlog__visit_date')).order_by('-latest_visit') else: # Active visitors - visitors = Visitor.objects.filter(visitorlog__left_date__isnull=True).distinct() + visitors = Visitor.objects.filter(visitorlog__left_date__isnull=True).distinct().annotate(latest_visit=Max('visitorlog__visit_date')).order_by('-latest_visit') visitors_count = visitors.count() visitors_data = [] diff --git a/osinaweb/osichat/consumers.py b/osinaweb/osichat/consumers.py index 30c0c4ee..26e99ce0 100644 --- a/osinaweb/osichat/consumers.py +++ b/osinaweb/osichat/consumers.py @@ -326,7 +326,7 @@ class OsichatVisitor(WebsocketConsumer): class OsitcomChatRoom(WebsocketConsumer): def connect(self): - self.domain = 'https://osina.ositcom.com' + self.domain = 'http://192.168.1.111:8000' self.session_id = self.scope['url_route']['kwargs']['session_id'] self.visitor = Visitor.objects.filter(session_id=self.session_id).last() if not self.visitor: @@ -684,9 +684,17 @@ class OsitcomChatRoom(WebsocketConsumer): } if self.client_type == 'mobile_admin': chat_message_data = model_to_dict(chat_message) + member = chat_message.member + member_data = { + 'id': member.id, + 'first_name': member.first_name, + 'last_name': member.last_name, + 'image': member.staffprofile.image + } self.send(text_data=json.dumps({ 'event_type': 'send_message', 'chat_message_data': chat_message_data, + 'member_data': member_data },cls=DjangoJSONEncoder)) elif self.client_type == 'website_admin': html = render_to_string("chat_templates/partials/message.html", context=context) diff --git a/osinaweb/osinacore/.DS_Store b/osinaweb/osinacore/.DS_Store index db6bd212..99c8883a 100644 Binary files a/osinaweb/osinacore/.DS_Store and b/osinaweb/osinacore/.DS_Store differ diff --git a/osinaweb/osinacore/templates/.DS_Store b/osinaweb/osinacore/templates/.DS_Store index 024a4bcc..a62f4f7b 100644 Binary files a/osinaweb/osinacore/templates/.DS_Store and b/osinaweb/osinacore/templates/.DS_Store differ diff --git a/osinaweb/osinacore/templates/add_templates/.DS_Store b/osinaweb/osinacore/templates/add_templates/.DS_Store index c631ee62..7ddbc406 100644 Binary files a/osinaweb/osinacore/templates/add_templates/.DS_Store and b/osinaweb/osinacore/templates/add_templates/.DS_Store differ diff --git a/osinaweb/osinacore/templates/edit_templates/.DS_Store b/osinaweb/osinacore/templates/edit_templates/.DS_Store index 163380e5..5cc83c5f 100644 Binary files a/osinaweb/osinacore/templates/edit_templates/.DS_Store and b/osinaweb/osinacore/templates/edit_templates/.DS_Store differ diff --git a/osinaweb/osinacore/templates/listing_pages/.DS_Store b/osinaweb/osinacore/templates/listing_pages/.DS_Store index 98ebf4f1..b6332802 100644 Binary files a/osinaweb/osinacore/templates/listing_pages/.DS_Store and b/osinaweb/osinacore/templates/listing_pages/.DS_Store differ diff --git a/osinaweb/static/.DS_Store b/osinaweb/static/.DS_Store index bf414b15..2276b057 100644 Binary files a/osinaweb/static/.DS_Store and b/osinaweb/static/.DS_Store differ diff --git a/osinaweb/static/js/.DS_Store b/osinaweb/static/js/.DS_Store index 743eba21..0d88dfa3 100644 Binary files a/osinaweb/static/js/.DS_Store and b/osinaweb/static/js/.DS_Store differ diff --git a/osinaweb/static/js/osichat-admin/osichat.js b/osinaweb/static/js/osichat-admin/osichat.js index 246fd19c..00d48d08 100644 --- a/osinaweb/static/js/osichat-admin/osichat.js +++ b/osinaweb/static/js/osichat-admin/osichat.js @@ -1,6 +1,6 @@ let admin_chat_ws_scheme = window.location.protocol === "https:" ? "wss" : "ws"; let protocol = window.location.protocol === "https:" ? "https" : "http"; -let admin_chat_domain = "osina.ositcom.com"; +let admin_chat_domain = "192.168.1.111:8000"; let userId = document.getElementById('userId').textContent.trim(); let osichatadminroomSocket = null; let currentChatId = null; diff --git a/osinaweb/static/js/osichat/visitors.js b/osinaweb/static/js/osichat/visitors.js index 2e3fed1a..36683e1f 100644 --- a/osinaweb/static/js/osichat/visitors.js +++ b/osinaweb/static/js/osichat/visitors.js @@ -1,7 +1,7 @@ const wsScheme = window.location.protocol === "https:" ? "wss" : "ws"; const protocol = window.location.protocol === "https:" ? "https" : "http"; -const osinaDomain = "osina.ositcom.com"; -const ositcomDomain = "ositcom.com"; +const osinaDomain = "192.168.1.111:8000"; +const ositcomDomain = "192.168.1.111:3000"; async function fetchClientData() { diff --git a/osinaweb/support/.DS_Store b/osinaweb/support/.DS_Store index 9685a61a..d3ea69e6 100644 Binary files a/osinaweb/support/.DS_Store and b/osinaweb/support/.DS_Store differ diff --git a/osinaweb/support/templates/.DS_Store b/osinaweb/support/templates/.DS_Store index 98c0dbf4..638e75c6 100644 Binary files a/osinaweb/support/templates/.DS_Store and b/osinaweb/support/templates/.DS_Store differ