Things are in a pretty good working state. Ideally the Novi page should be a little more dynamic with changing the Jitsi settings. Or maybe the controls should be moved to the idaa/video_conferences page. Wrapping up for the day/week.

This commit is contained in:
Scott Idem
2025-12-12 17:17:11 -05:00
parent fcc2811dc7
commit 1d99cc325f
2 changed files with 40 additions and 13 deletions

View File

@@ -69,7 +69,7 @@
console.log('Jitsi: url_params:', url_params);
// --- Start with fallback data from URL ---
let user_id = url_params.uuid;
let user_id = url_params.uuid; // Novi Customer GUID
let display_name = url_params.full_name ?? 'Guest';
let email = (url_params.email ?? 'guest@example.com').replace(/\s+/g, '+');
let is_moderator = false;
@@ -89,14 +89,38 @@
}
// --- Fetch dynamic data from Novi API ---
const novi_api_key = $ae_loc.site_cfg_json?.novi_idaa_api_key;
const novi_api_root_url = $ae_loc.site_cfg_json?.novi_api_root_url;
const novi_api_key = $ae_loc.site_cfg_json?.novi_idaa_api_key; // For IDAA's Novi site
const novi_api_headers = new Headers();
novi_api_headers.append('Authorization', `Basic ${novi_api_key}`);
const requestOptions = {
method: 'GET',
headers: novi_api_headers
};
console.log('Jitsi: Attempting to fetch moderator list from Novi API...');
console.log('Jitsi: Attempting to fetch IDAA member (Novi customer) details based on Novi customer GUID using Novi API...');
const full_novi_url_customers_guid = `${novi_api_root_url}/customers/${user_id}`;
await fetch(full_novi_url_customers_guid, requestOptions)
.then((response) => response.json())
.then((result) => {
let novi_current_user_obj = result;
console.log(`Jitsi: Novi's Current User Obj:`, novi_current_user_obj);
let full_name = novi_current_user_obj?.Name;
let first_name = novi_current_user_obj?.FirstName;
let last_initial = novi_current_user_obj?.LastName
? novi_current_user_obj.LastName.charAt(0).toUpperCase() + '.'
: '';
if (last_initial) {
full_name = `${first_name} ${last_initial}`;
}
console.log(`Jitsi: Novi's Current User's Full Name: ${full_name}`);
})
.catch((error) => console.log('error', error));
console.log('Jitsi: Attempting to fetch moderator (Novi group members) list based on Novi group GUID using Novi API... There may be multiple groups to check.');
try {
// Fetch the list of moderators from the Novi group
@@ -108,9 +132,11 @@
}
for (const group_guid of novi_idaa_group_guid_li) {
const mod_list_url = `https://www.idaa.org/api/groups/${group_guid}/members?pageSize=200`;
console.log(`Jitsi: Fetching moderator list from Novi API for group: ${group_guid}`);
const mods_response = await fetch(mod_list_url, requestOptions);
// const novi_url_groups_members = `/groups/members/${group_guid}/members`;
const full_novi_url_groups_members = `${novi_api_root_url}/groups/${group_guid}/members?pageSize=200`;
console.log(`Jitsi: Fetching moderator list from Novi API for group: ${group_guid} from URL: ${full_novi_url_groups_members}`);
const mods_response = await fetch(full_novi_url_groups_members, requestOptions);
if (mods_response.ok) {
const groupModeratorsRaw = await mods_response.json();

View File

@@ -18,8 +18,8 @@
// 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';
let novi_api_key_for_idaa = 'CmNdWgdPmgluBWjiTd8xsUCk5mio8F1O9DYAh0pVDcg=';
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;
@@ -40,16 +40,17 @@
let reactions_muted = true; // "Mute reaction sounds for everyone"
// 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'
// let idaa_osit_ae_api_root_url = 'https://sk-idaa.oneskyit.com/idaa/jitsi_meet';
// '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://static.oneskyit.com/c/DgrZone/jitsi_iframe_api_testing.html'; // Point to the Svelte Jitsi page
let idaa_osit_ae_site_key = '8VTOJ0X5hvT6JdiTJsGEzQ'; // 'restricted-access'
'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_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;
// 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.
var novi_api_headers = new Headers();
novi_api_headers.append('Authorization', `Basic ${novi_api_key_for_idaa}`);
@@ -60,7 +61,7 @@
};
let novi_api_get_customer_endpoint = `${novi_api_root_url}/customers/${novi_customer_uid}`;
console.log(novi_api_get_customer_endpoint);
console.log(`Novi API Get Customer Endpoint: ${novi_api_get_customer_endpoint}`);
fetch(novi_api_get_customer_endpoint, requestOptions)
// .then(response => response.text())