Trying to get the activity logs to work... Create!

This commit is contained in:
Scott Idem
2025-12-16 12:02:18 -05:00
parent f403a3dd59
commit a7ad5ff7fa
3 changed files with 27 additions and 81 deletions

View File

@@ -156,6 +156,11 @@ export async function create_ae_obj__activity_log({
}) {
console.log(`*** create_ae_obj__activity_log() *** account_id=${account_id}`);
if (!account_id) {
console.log(`ERROR: Journals - Journal - account_id required to create`);
return false;
}
ae_promises.create__activity_log = await api
.create_ae_obj_crud({
api_cfg: api_cfg,

View File

@@ -55,12 +55,18 @@
console.log('Jitsi: Preparing to report meeting stats...');
const participants_array = Array.from(meeting_participants.values());
console.log('Jitsi: DONE! Compiled participants array for stats report:', participants_array);
const data_kv = {
source: 'idaa_jitsi_meeting',
activity: 'live_stats_update',
name: room_name,
data_json: {
external_client_id: user_id, // Novi Customer GUID in this case
name: 'live_stats_update', // Name of log entry "type"
description: room_name,
url_root: data?.url.origin,
url_full_path: data?.url.pathname,
url_params: data?.url.searchParams.toString(),
action: 'jitsi_live_stats_report',
action_with: 'timer_loop',
meta_json: {
duration: meeting_duration,
participants: participants_array,
participant_count: participants_array.length
@@ -70,12 +76,17 @@
console.log('Jitsi: Stats payload being sent:', JSON.stringify(data_kv, null, 2));
try {
console.log('Jitsi: HERE! Calling create_ae_obj__activity_log API... Lost contact....');
const result = await create_ae_obj__activity_log({
api_cfg: $ae_loc.auth.api_cfg,
account_id: $ae_loc.auth.account.account_id_random,
data_kv: data_kv
});
console.log('Jitsi: Activity log API call successful.', result);
data_kv: data_kv,
log_lvl: 2,
})
// .catch((err) => {
// console.error('Jitsi: Error in create_ae_obj__activity_log API call:', err);
// });
console.log('Jitsi: NOT SEEING THIS! Activity log API call successful.', result);
} catch (error) {
console.error('Jitsi: Error calling create_ae_obj__activity_log:', error);
}
@@ -127,7 +138,7 @@
if (is_moderator) {
console.log('Jitsi: User is a moderator. Starting stats reporting timer...');
if (reporting_timer_id) clearInterval(reporting_timer_id);
reporting_timer_id = setInterval(report_meeting_stats, 30000); // Report every 30 seconds
reporting_timer_id = setInterval(report_meeting_stats, 17000); // Report every 30 seconds
} else {
console.log('Jitsi: User is not a moderator. Stats reporting will not start.');
}

View File

@@ -29,97 +29,27 @@
let novi_customer_uid = '<%=Novi.User.CustomerUniqueId%>'; // NOTE: The Novi UUID for the current current user/customer
console.log(`Novi's Current User's ID: ${novi_customer_uid}`);
// var novi_current_user_role = '<%=Novi.User.xyz%>';
// console.log(`Novi's Current User's Role: ${novi_current_user_role}`);
let novi_api_root_url = 'https://www.idaa.org/api'; // DO NOT CHANGE THIS VALUE
let novi_api_key_for_idaa = 'CmNdWgdPmgluBWjiTd8xsUCk5mio8F1O9DYAh0pVDcg='; // DO NOT CHANGE THIS VALUE
let novi_current_user_obj = null;
let novi_current_user_email = null;
let room_name = 'IDAA-Example-Meeting'; // 'IDAA-Student-and-Resident-Meeting'; 'IDAA-Meeting';
let is_moderator = false;
// Disable Jitsi sound settings. Set to true DISABLES the sound.
let incoming_msg_sound = true;
let participant_joined_sound = false;
let participant_left_sound = false;
let reaction_sound = true;
let raise_hand_sound = true;
// Moderator settings, unchecked (false) by default.
let start_muted = false; // "Everyone starts muted"
let start_hidden = true; // "Everyone starts hidden"
let reactions_muted = true; // "Mute reaction sounds for everyone"
// let novi_category_id = ''; // Not in use yet
// Do *not* use relative paths here. They must be direct to the site I am hosting for IDAA.
// 'https://sk-idaa.oneskyit.com/idaa/video_conferences' OR 'https://dev-idaa.oneskyit.com/idaa/video_conferences' OR 'http://idaa.localhost:5173/idaa/video_conferences' OR 'https://static.oneskyit.com/c/DgrZone/jitsi_iframe_api_testing.html'
let idaa_osit_ae_api_root_url =
'https://dev-idaa.oneskyit.com/idaa/video_conferences'; // DO NOT CHANGE THIS VALUE; Point to the Svelte Jitsi page
let idaa_osit_ae_site_key = '8VTOJ0X5hvT6JdiTJsGEzQ'; // DO NOT CHANGE THIS VALUE; '8VTOJ0X5hvT6JdiTJsGEzQ' OR 'restricted-access'
let idaa_osit_ae_site_key = 'restricted-access'; // DO NOT CHANGE THIS VALUE; '8VTOJ0X5hvT6JdiTJsGEzQ' OR 'restricted-access' OR 'restricted'
let idaa_ae_params = new URLSearchParams(document.location.search);
// let idaa_ae_slct_event_id = idaa_ae_params.get('event_id');
let idaa_ae_iframe_height = null;
let idaa_ae_iframe_element = document.getElementById(
'ae_idaa_jitsi_meeting_iframe'
);
idaa_ae_iframe_element.src =
`${idaa_osit_ae_api_root_url}?uuid=${novi_customer_uid}&iframe=true&key=${idaa_osit_ae_site_key}&room=${room_name}&incoming_msg_sound=${incoming_msg_sound}&participant_joined_sound=${participant_joined_sound}&participant_left_sound=${participant_left_sound}&reaction_sound=${reaction_sound}&raise_hand_sound=${raise_hand_sound}&start_muted=${start_muted}&start_hidden=${start_hidden}&reactions_muted=${reactions_muted}`
`${idaa_osit_ae_api_root_url}?uuid=${novi_customer_uid}&iframe=true&key=${idaa_osit_ae_site_key}&room=${room_name}`
;
// IN PROGRESS: The Novi API fetch to get current user info is being moved to the Svelte page that hosts the iframe (https://domain.tld/idaa/video_conferences). Only the bare minimum info will be passed to the iframe via URL params. Pretty much just the Novi Customer GUID (UUID). The Svelte page will fetch the rest of the user info from the Novi API and then load the iframe with all the correct params. That same page also checks the Novi groups to see if the user is a moderator in one of those.
</script>
<!-- Enable or disable sounds -->
<div
class=""
style="margin-top: 1.5em; border-top: 2px dashed #ccc; padding: 1em; background-color: pink;"
>
<strong>Jitsi Sound Settings:</strong>
<label>
<input type="checkbox" id="incoming_msg_sound_checkbox" checked disabled />
Disable Incoming Message Sound
</label>
<label>
<input type="checkbox" id="participant_joined_sound_checkbox" disabled />
Disable Participant Joined Sound
</label>
<label>
<input type="checkbox" id="participant_left_sound_checkbox" disabled />
Disable Participant Left Sound
</label>
<label>
<input type="checkbox" id="reaction_sound_checkbox" checked disabled />
Disable Reaction Sound
</label>
<label>
<input type="checkbox" id="raise_hand_sound_checkbox" checked disabled />
Disable Raise Hand Sound
</label>
<button
id="reload_iframe_button"
style="background-color: orange;"
onclick="
let iframe_element = document.getElementById('ae_idaa_jitsi_meeting_iframe');
if (iframe_element) {
iframe_element.src = iframe_element.src;
}
">
Reload Iframe
</button>
</div>
<!-- STOP: Do not copy below this point -->
</body>