Lots of code clean up. Finally working on the Launcher piece again.
This commit is contained in:
@@ -127,21 +127,6 @@ async function handle_submit_form_files(event) {
|
|||||||
} else if (log_lvl > 1) {
|
} else if (log_lvl > 1) {
|
||||||
console.log('hosted_file_results:', hosted_file_results);
|
console.log('hosted_file_results:', hosted_file_results);
|
||||||
}
|
}
|
||||||
|
|
||||||
// db_events.files.clear();
|
|
||||||
|
|
||||||
// let params = {
|
|
||||||
// qry__enabled: 'all',
|
|
||||||
// qry__hidden: 'all',
|
|
||||||
// }
|
|
||||||
|
|
||||||
// events_func.load_ae_obj_li__event_file({
|
|
||||||
// api_cfg: $ae_api,
|
|
||||||
// for_obj_type: link_to_type,
|
|
||||||
// for_obj_id: link_to_id,
|
|
||||||
// params: params,
|
|
||||||
// try_cache: true
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ae_sess.files.disable_submit__hosted_file_obj = false;
|
$ae_sess.files.disable_submit__hosted_file_obj = false;
|
||||||
|
|||||||
@@ -133,8 +133,8 @@ export async function load_ae_obj_id__event(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event',
|
for_obj_type: 'event',
|
||||||
for_obj_id: event_id,
|
for_obj_id: event_id,
|
||||||
params: {qry__enabled: 'enabled', qry__limit: 19},
|
enabled: 'enabled',
|
||||||
try_cache: try_cache,
|
limit: 19,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
}).then((event_location_obj_li) => {
|
}).then((event_location_obj_li) => {
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
@@ -158,7 +158,8 @@ export async function load_ae_obj_id__event(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event',
|
for_obj_type: 'event',
|
||||||
for_obj_id: event_id,
|
for_obj_id: event_id,
|
||||||
params: {qry__enabled: 'enabled', qry__limit: 249},
|
enabled: 'enabled',
|
||||||
|
limit: 249,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
}).then((event_session_obj_li) => {
|
}).then((event_session_obj_li) => {
|
||||||
@@ -367,7 +368,8 @@ export async function load_ae_obj_li__event(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event',
|
for_obj_type: 'event',
|
||||||
for_obj_id: event_id,
|
for_obj_id: event_id,
|
||||||
params: {qry__enabled: 'enabled', qry__limit: 19},
|
enabled: 'enabled',
|
||||||
|
limit: 19,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ export async function load_ae_obj_li__event_device(
|
|||||||
for_obj_type,
|
for_obj_type,
|
||||||
for_obj_id,
|
for_obj_id,
|
||||||
inc_location_id = false,
|
inc_location_id = false,
|
||||||
|
enabled = 'enabled',
|
||||||
|
hidden = 'not_hidden',
|
||||||
|
limit = 49,
|
||||||
|
offset = 0,
|
||||||
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'code': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'code': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||||
params = {},
|
params = {},
|
||||||
try_cache = true,
|
try_cache = true,
|
||||||
@@ -120,6 +124,10 @@ export async function load_ae_obj_li__event_device(
|
|||||||
for_obj_type: string,
|
for_obj_type: string,
|
||||||
for_obj_id: string,
|
for_obj_id: string,
|
||||||
inc_location_id?: boolean,
|
inc_location_id?: boolean,
|
||||||
|
enabled?: string, // all, disabled, enabled
|
||||||
|
hidden?: string, // all, hidden, not_hidden
|
||||||
|
limit?: number, // 99
|
||||||
|
offset?: number, // 0
|
||||||
order_by_li?: key_val,
|
order_by_li?: key_val,
|
||||||
params?: key_val,
|
params?: key_val,
|
||||||
try_cache?: boolean,
|
try_cache?: boolean,
|
||||||
@@ -130,10 +138,10 @@ export async function load_ae_obj_li__event_device(
|
|||||||
console.log(`*** load_ae_obj_li__event_device() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
console.log(`*** load_ae_obj_li__event_device() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
// let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||||
let hidden: string = (params.qry__hidden ?? 'all'); // all, hidden, not_hidden
|
// let hidden: string = (params.qry__hidden ?? 'all'); // all, hidden, not_hidden
|
||||||
let limit: number = (params.qry__limit ?? 99); // 99
|
// let limit: number = (params.qry__limit ?? 99); // 99
|
||||||
let offset: number = (params.qry__offset ?? 0); // 0
|
// let offset: number = (params.qry__offset ?? 0); // 0
|
||||||
|
|
||||||
let params_json: key_val = {};
|
let params_json: key_val = {};
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ export async function load_ae_obj_li__event_file(
|
|||||||
api_cfg,
|
api_cfg,
|
||||||
for_obj_type,
|
for_obj_type,
|
||||||
for_obj_id,
|
for_obj_id,
|
||||||
|
enabled = 'enabled',
|
||||||
|
hidden = 'not_hidden',
|
||||||
|
limit = 99,
|
||||||
|
offset = 0,
|
||||||
|
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||||
params = {},
|
params = {},
|
||||||
try_cache = true,
|
try_cache = true,
|
||||||
log_lvl = 0
|
log_lvl = 0
|
||||||
@@ -67,6 +72,11 @@ export async function load_ae_obj_li__event_file(
|
|||||||
api_cfg: any,
|
api_cfg: any,
|
||||||
for_obj_type: string,
|
for_obj_type: string,
|
||||||
for_obj_id: string,
|
for_obj_id: string,
|
||||||
|
enabled?: string, // all, disabled, enabled
|
||||||
|
hidden?: string, // all, hidden, not_hidden
|
||||||
|
limit?: number, // 99
|
||||||
|
offset?: number, // 0
|
||||||
|
order_by_li?: key_val,
|
||||||
params?: key_val,
|
params?: key_val,
|
||||||
try_cache?: boolean,
|
try_cache?: boolean,
|
||||||
log_lvl?: number
|
log_lvl?: number
|
||||||
@@ -81,10 +91,10 @@ export async function load_ae_obj_li__event_file(
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
// let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||||
let hidden: string = (params.qry__hidden ?? 'all'); // all, hidden, not_hidden
|
// let hidden: string = (params.qry__hidden ?? 'all'); // all, hidden, not_hidden
|
||||||
let limit: number = (params.qry__limit ?? 99); // 99
|
// let limit: number = (params.qry__limit ?? 99); // 99
|
||||||
let offset: number = (params.qry__offset ?? 0); // 0
|
// let offset: number = (params.qry__offset ?? 0); // 0
|
||||||
|
|
||||||
let params_json: key_val = {};
|
let params_json: key_val = {};
|
||||||
|
|
||||||
@@ -99,7 +109,7 @@ export async function load_ae_obj_li__event_file(
|
|||||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||||
enabled: enabled,
|
enabled: enabled,
|
||||||
hidden: hidden,
|
hidden: hidden,
|
||||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
order_by_li: order_by_li,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
params_json: params_json,
|
params_json: params_json,
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ export async function load_ae_obj_id__event_location(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_location',
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: event_location_id,
|
for_obj_id: event_location_id,
|
||||||
params: {qry__enabled: 'all', qry__limit: 15},
|
enabled: 'all',
|
||||||
|
limit: 15,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
@@ -126,7 +127,8 @@ export async function load_ae_obj_id__event_location(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_location',
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: event_location_id,
|
for_obj_id: event_location_id,
|
||||||
params: {qry__enabled: 'all', qry__limit: 15},
|
enabled: 'all',
|
||||||
|
limit: 15,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
});
|
});
|
||||||
@@ -150,6 +152,10 @@ export async function load_ae_obj_li__event_location(
|
|||||||
inc_device_li = false,
|
inc_device_li = false,
|
||||||
inc_file_li = false,
|
inc_file_li = false,
|
||||||
inc_session_li = false,
|
inc_session_li = false,
|
||||||
|
enabled = 'enabled',
|
||||||
|
hidden = 'not_hidden',
|
||||||
|
limit = 29,
|
||||||
|
offset = 0,
|
||||||
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'code': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'code': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||||
params = {},
|
params = {},
|
||||||
try_cache = true,
|
try_cache = true,
|
||||||
@@ -161,6 +167,10 @@ export async function load_ae_obj_li__event_location(
|
|||||||
inc_device_li?: boolean,
|
inc_device_li?: boolean,
|
||||||
inc_file_li?: boolean,
|
inc_file_li?: boolean,
|
||||||
inc_session_li?: boolean,
|
inc_session_li?: boolean,
|
||||||
|
enabled?: string, // all, disabled, enabled
|
||||||
|
hidden?: string, // all, hidden, not_hidden
|
||||||
|
limit?: number, // 99
|
||||||
|
offset?: number, // 0
|
||||||
order_by_li?: key_val,
|
order_by_li?: key_val,
|
||||||
params?: key_val,
|
params?: key_val,
|
||||||
try_cache?: boolean,
|
try_cache?: boolean,
|
||||||
@@ -171,11 +181,6 @@ export async function load_ae_obj_li__event_location(
|
|||||||
console.log(`*** load_ae_obj_li__event_location() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
console.log(`*** load_ae_obj_li__event_location() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
|
||||||
let hidden: string = (params.qry__hidden ?? 'all'); // all, hidden, not_hidden
|
|
||||||
let limit: number = (params.qry__limit ?? 99); // 99
|
|
||||||
let offset: number = (params.qry__offset ?? 0); // 0
|
|
||||||
|
|
||||||
let params_json: key_val = {};
|
let params_json: key_val = {};
|
||||||
|
|
||||||
// console.log('params_json:', params_json);
|
// console.log('params_json:', params_json);
|
||||||
@@ -284,7 +289,8 @@ export async function load_ae_obj_li__event_location(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_location',
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: event_location_id,
|
for_obj_id: event_location_id,
|
||||||
params: {qry__enabled: enabled, qry__limit: limit},
|
enabled: enabled,
|
||||||
|
limit: limit,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
@@ -314,7 +320,8 @@ export async function load_ae_obj_li__event_location(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_location',
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: event_location_id,
|
for_obj_id: event_location_id,
|
||||||
params: {qry__enabled: enabled, qry__limit: limit},
|
enabled: enabled,
|
||||||
|
limit: limit,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ export async function load_ae_obj_id__event_presentation(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_presentation',
|
for_obj_type: 'event_presentation',
|
||||||
for_obj_id: event_presentation_id,
|
for_obj_id: event_presentation_id,
|
||||||
params: {qry__enabled: 'all', qry__limit: 25},
|
enabled: 'all',
|
||||||
|
limit: 25,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
@@ -283,7 +284,8 @@ export async function load_ae_obj_li__event_presentation(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_presentation',
|
for_obj_type: 'event_presentation',
|
||||||
for_obj_id: event_presentation_id,
|
for_obj_id: event_presentation_id,
|
||||||
params: {qry__enabled: enabled, qry__limit: limit},
|
enabled: enabled,
|
||||||
|
limit: limit,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -99,7 +99,8 @@ export async function load_ae_obj_id__event_presenter(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_presenter',
|
for_obj_type: 'event_presenter',
|
||||||
for_obj_id: event_presenter_id,
|
for_obj_id: event_presenter_id,
|
||||||
params: {qry__enabled: enabled, qry__limit: limit},
|
enabled: enabled,
|
||||||
|
limit: limit,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
@@ -237,7 +238,8 @@ export async function load_ae_obj_li__event_presenter(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_presenter',
|
for_obj_type: 'event_presenter',
|
||||||
for_obj_id: event_presenter_id,
|
for_obj_id: event_presenter_id,
|
||||||
params: {qry__enabled: enabled, qry__limit: limit},
|
enabled: enabled,
|
||||||
|
limit: limit,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ export async function load_ae_obj_id__event_session(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_session',
|
for_obj_type: 'event_session',
|
||||||
for_obj_id: event_session_id,
|
for_obj_id: event_session_id,
|
||||||
params: {qry__enabled: 'all', qry__limit: 15},
|
enabled: enabled,
|
||||||
|
limit: 15,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
@@ -288,7 +289,8 @@ export async function load_ae_obj_li__event_session(
|
|||||||
api_cfg: api_cfg,
|
api_cfg: api_cfg,
|
||||||
for_obj_type: 'event_session',
|
for_obj_type: 'event_session',
|
||||||
for_obj_id: event_session_id,
|
for_obj_id: event_session_id,
|
||||||
params: {qry__enabled: enabled, qry__limit: limit},
|
enabled: enabled,
|
||||||
|
limit: limit,
|
||||||
try_cache: try_cache,
|
try_cache: try_cache,
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -67,16 +67,18 @@ let clipboard_success = $state(false);
|
|||||||
|
|
||||||
db_events.files.clear();
|
db_events.files.clear();
|
||||||
|
|
||||||
let params = {
|
// let params = {
|
||||||
qry__enabled: 'all',
|
// qry__enabled: 'all',
|
||||||
qry__hidden: 'all',
|
// qry__hidden: 'all',
|
||||||
}
|
// }
|
||||||
|
|
||||||
events_func.load_ae_obj_li__event_file({
|
events_func.load_ae_obj_li__event_file({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
for_obj_type: link_to_type,
|
for_obj_type: link_to_type,
|
||||||
for_obj_id: link_to_id,
|
for_obj_id: link_to_id,
|
||||||
params: params,
|
enabled: 'all',
|
||||||
|
hidden: 'all',
|
||||||
|
// params: params,
|
||||||
try_cache: true
|
try_cache: true
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -429,16 +431,18 @@ let clipboard_success = $state(false);
|
|||||||
.then (function (update_results) {
|
.then (function (update_results) {
|
||||||
console.log(`Update results:`, update_results);
|
console.log(`Update results:`, update_results);
|
||||||
|
|
||||||
let params = {
|
// let params = {
|
||||||
qry__enabled: 'all',
|
// qry__enabled: 'all',
|
||||||
qry__hidden: 'all',
|
// qry__hidden: 'all',
|
||||||
}
|
// }
|
||||||
|
|
||||||
events_func.load_ae_obj_li__event_file({
|
events_func.load_ae_obj_li__event_file({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
for_obj_type: link_to_type,
|
for_obj_type: link_to_type,
|
||||||
for_obj_id: link_to_id,
|
for_obj_id: link_to_id,
|
||||||
params: params,
|
enabled: 'all',
|
||||||
|
hidden: 'all',
|
||||||
|
// params: params,
|
||||||
try_cache: true
|
try_cache: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
/** @type {import('./$types').LayoutLoad} */
|
|
||||||
console.log(`Events - [event_id] launcher +layout.ts start`);
|
|
||||||
|
|
||||||
import { error } from '@sveltejs/kit';
|
|
||||||
import { browser } from '$app/environment';
|
|
||||||
import { events_func } from '$lib/ae_events_functions';
|
|
||||||
|
|
||||||
export async function load({ params, parent, url }) { // route
|
|
||||||
let log_lvl: number = 0;
|
|
||||||
|
|
||||||
let data = await parent();
|
|
||||||
// console.log(`ae events_pres_mgmt event [event_id] +page.ts data:`, data);
|
|
||||||
data.log_lvl = log_lvl;
|
|
||||||
|
|
||||||
let account_id = data.account_id;
|
|
||||||
let ae_acct = data[account_id];
|
|
||||||
// console.log(`ae_acct = `, ae_acct);
|
|
||||||
|
|
||||||
// if (!account_id) {
|
|
||||||
// console.log(`events_pres_mgmt_event [event_id] +page.ts: The account_id was not found in the data!!!`);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// data.ae_events_pres_mgmt_event_event_id_page_ts = true;
|
|
||||||
|
|
||||||
let event_id = params.event_id;
|
|
||||||
if (!event_id) {
|
|
||||||
console.log(`ae Events - [event_id] +page.ts: The event_id was not found in the params.event_id!!!`);
|
|
||||||
error(404, {
|
|
||||||
message: 'Event ID not found'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ae_acct.slct.event_id = event_id;
|
|
||||||
|
|
||||||
// let load_event_obj = events_func.handle_load_ae_obj_id__event({
|
|
||||||
// api_cfg: ae_acct.api, event_id: event_id, try_cache: true
|
|
||||||
// });
|
|
||||||
|
|
||||||
// ae_acct.slct.event_obj = await load_event_obj;
|
|
||||||
|
|
||||||
if (browser) {
|
|
||||||
console.log(`BROWSER Events - [event_id] launcher +layout.ts start`);
|
|
||||||
|
|
||||||
let load_event_obj = events_func.load_ae_obj_id__event({
|
|
||||||
api_cfg: ae_acct.api, event_id: event_id, try_cache: true
|
|
||||||
});
|
|
||||||
console.log(`load_event_obj = `, load_event_obj);
|
|
||||||
ae_acct.slct.event_obj = load_event_obj;
|
|
||||||
|
|
||||||
// let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({
|
|
||||||
// api_cfg: ae_acct.api,
|
|
||||||
// for_obj_type: 'event',
|
|
||||||
// for_obj_id: event_id,
|
|
||||||
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
|
||||||
// try_cache: true,
|
|
||||||
// log_lvl: 1
|
|
||||||
// });
|
|
||||||
// console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
|
||||||
// ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
|
|
||||||
|
|
||||||
let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({
|
|
||||||
api_cfg: ae_acct.api,
|
|
||||||
for_obj_type: 'event',
|
|
||||||
for_obj_id: event_id,
|
|
||||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
|
||||||
try_cache: true,
|
|
||||||
log_lvl: log_lvl
|
|
||||||
});
|
|
||||||
console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
|
||||||
ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
|
||||||
|
|
||||||
|
|
||||||
let event_session_id = url.searchParams.get('session_id');
|
|
||||||
if (event_session_id) {
|
|
||||||
let load_event_session_obj = events_func.load_ae_obj_id__event_session({
|
|
||||||
api_cfg: ae_acct.api,
|
|
||||||
event_session_id: event_session_id,
|
|
||||||
inc_file_li: true,
|
|
||||||
inc_presentation_li: true,
|
|
||||||
inc_presenter_li: true,
|
|
||||||
try_cache: true,
|
|
||||||
log_lvl: log_lvl
|
|
||||||
});
|
|
||||||
ae_acct.slct.event_session_id = event_session_id;
|
|
||||||
console.log(`load_event_session_obj = `, load_event_session_obj);
|
|
||||||
ae_acct.slct.event_session_obj = load_event_session_obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// WARNING: Precaution against shared data between sites and sessions.
|
|
||||||
data[account_id] = ae_acct;
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
/** @type {import('./$types').LayoutData} */
|
let log_lvl: number = $state(1);
|
||||||
export let data: any;
|
|
||||||
let log_lvl: number = 0;
|
|
||||||
|
|
||||||
|
// *** Import Svelte specific
|
||||||
|
import { run } from 'svelte/legacy';
|
||||||
import { onMount, tick } from 'svelte';
|
import { onMount, tick } from 'svelte';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { sineIn } from 'svelte/easing';
|
import { sineIn } from 'svelte/easing';
|
||||||
@@ -10,6 +10,16 @@ import { liveQuery } from "dexie";
|
|||||||
import { Drawer, Footer, Modal } from 'flowbite-svelte';
|
import { Drawer, Footer, Modal } from 'flowbite-svelte';
|
||||||
import { listen, idle, onIdle } from 'svelte-idle'
|
import { listen, idle, onIdle } from 'svelte-idle'
|
||||||
|
|
||||||
|
// *** Import Aether specific variables and functions
|
||||||
|
interface Props {
|
||||||
|
/** @type {import('./$types').LayoutData} */
|
||||||
|
data: any;
|
||||||
|
children?: import('svelte').Snippet;
|
||||||
|
}
|
||||||
|
|
||||||
|
let { data, children }: Props = $props();
|
||||||
|
|
||||||
|
|
||||||
import type { key_val } from '$lib/ae_stores';
|
import type { key_val } from '$lib/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
@@ -18,12 +28,12 @@ import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger, time } f
|
|||||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig } from '$lib/ae_events_stores';
|
import { events_loc, events_sess, events_slct, events_trigger, events_trig } from '$lib/ae_events_stores';
|
||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import Launcher_cfg from './launcher_cfg.svelte';
|
import Launcher_cfg from '../launcher_cfg.svelte';
|
||||||
import Launcher_menu from './launcher_menu.svelte';
|
import Launcher_menu from '../launcher_menu.svelte';
|
||||||
import Launcher_session_view from './launcher_session_view.svelte';
|
import Launcher_session_view from '../launcher_session_view.svelte';
|
||||||
import Element_websocket_v2 from '$lib/element_websocket_v2.svelte';
|
import Element_websocket_v2 from '$lib/element_websocket_v2.svelte';
|
||||||
|
|
||||||
// Variables
|
// *** Set initial variables
|
||||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||||
$slct.account_id = data.account_id;
|
$slct.account_id = data.account_id;
|
||||||
// console.log(`$slct.account_id = `, $slct.account_id);
|
// console.log(`$slct.account_id = `, $slct.account_id);
|
||||||
@@ -45,10 +55,12 @@ if (!$events_loc?.launcher) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// svelte-ignore state_referenced_locally
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`$events_loc.launcher:`, $events_loc.launcher);
|
console.log(`$events_loc.launcher:`, $events_loc.launcher);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// svelte-ignore state_referenced_locally
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`event_id: ${data.params.event_id}`);
|
console.log(`event_id: ${data.params.event_id}`);
|
||||||
console.log(`event_location_id: ${data.params.event_location_id}`);
|
console.log(`event_location_id: ${data.params.event_location_id}`);
|
||||||
@@ -63,23 +75,24 @@ $events_slct.event_session_id = data.url.searchParams.get('session_id');
|
|||||||
// $events_slct.event_obj = ae_acct.slct.event_obj;
|
// $events_slct.event_obj = ae_acct.slct.event_obj;
|
||||||
$events_slct.event_location_obj_li = ae_acct.slct.event_location_obj_li ?? [''];
|
$events_slct.event_location_obj_li = ae_acct.slct.event_location_obj_li ?? [''];
|
||||||
$events_slct.id_li__event_location = ae_acct.slct.id_li__event_location ?? [''];
|
$events_slct.id_li__event_location = ae_acct.slct.id_li__event_location ?? [''];
|
||||||
|
// svelte-ignore state_referenced_locally
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`$events_slct.event_location_obj_li:`, $events_slct.event_location_obj_li);
|
console.log(`$events_slct.event_location_obj_li:`, $events_slct.event_location_obj_li);
|
||||||
console.log(`$events_slct.id_li__event_location:`, $events_slct.id_li__event_location);
|
console.log(`$events_slct.id_li__event_location:`, $events_slct.id_li__event_location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Functions and Logic
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
$: lq__event_obj = liveQuery(async () => {
|
let lq__event_obj = $derived(liveQuery(async () => {
|
||||||
let results = await db_events.events
|
let results = await db_events.events
|
||||||
.get($events_slct.event_id);
|
.get($events_slct.event_id);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
});
|
}));
|
||||||
|
|
||||||
// Event File - For Location
|
// Event File - For Location
|
||||||
$: lq__location_event_file_obj_li = liveQuery(async () => {
|
let lq__location_event_file_obj_li = $derived(liveQuery(async () => {
|
||||||
let results = await db_events.files
|
let results = await db_events.files
|
||||||
// .where('event_session_id_random')
|
// .where('event_session_id_random')
|
||||||
.where('for_id_random')
|
.where('for_id_random')
|
||||||
@@ -87,42 +100,64 @@ $: lq__location_event_file_obj_li = liveQuery(async () => {
|
|||||||
.sortBy('filename');
|
.sortBy('filename');
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
});
|
}));
|
||||||
|
|
||||||
// Event Location
|
// Event Location
|
||||||
$: lq__event_location_obj = liveQuery(async () => {
|
let lq__event_location_obj = $derived(liveQuery(async () => {
|
||||||
let results = await db_events.locations
|
let results = await db_events.locations
|
||||||
.get($events_slct.event_location_id);
|
.get($events_slct.event_location_id);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
});
|
}));
|
||||||
|
|
||||||
$: lq__event_location_obj_li = liveQuery(async () => {
|
let lq__event_location_obj_li = $derived(liveQuery(async () => {
|
||||||
let results = await db_events.locations
|
let results = await db_events.locations
|
||||||
.where('event_id')
|
.where('event_id')
|
||||||
.equals($events_slct.event_id)
|
.equals($events_slct.event_id)
|
||||||
.sortBy('name');
|
.sortBy('name');
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
});
|
}));
|
||||||
|
|
||||||
// Event Session
|
// Event Session
|
||||||
$: lq__event_session_obj = liveQuery(async () => {
|
let lq__event_session_obj = $derived(liveQuery(async () => {
|
||||||
let results = await db_events.sessions
|
let results = await db_events.sessions
|
||||||
.get($events_slct.event_session_id);
|
.get($events_slct.event_session_id);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
});
|
}));
|
||||||
|
|
||||||
$: lq__event_session_obj_li = liveQuery(async () => {
|
// let lq__event_session_obj_li = $derived(liveQuery(async () => {
|
||||||
|
// let results = await db_events.sessions
|
||||||
|
// // .bulkGet(event_session_id_random_li);
|
||||||
|
// .where('event_location_id')
|
||||||
|
// .equals($events_slct.event_location_id)
|
||||||
|
// .sortBy('name');
|
||||||
|
|
||||||
|
// return results;
|
||||||
|
// }));
|
||||||
|
|
||||||
|
let lq__event_session_obj_li = $derived(liveQuery(async () => {
|
||||||
let results = await db_events.sessions
|
let results = await db_events.sessions
|
||||||
// .bulkGet(event_session_id_random_li);
|
|
||||||
.where('event_location_id')
|
.where('event_location_id')
|
||||||
.equals($events_slct.event_location_id)
|
.equals($events_slct.event_location_id)
|
||||||
|
// .and((x) => (x.archive_on === null || x.archive_on > (new Date()).toISOString()))
|
||||||
|
// .and((x) => (x.archive_on === null || x.archive_on > (new Date()).toISOString())) // null or future events only
|
||||||
|
// .and((x) => (x.archive_on < (new Date()).toISOString())) // past events only
|
||||||
|
// .and((x) => (x.archive_on > (new Date()).toISOString())) // future events only
|
||||||
|
// .orderBy('updated_on')
|
||||||
|
// .toArray()
|
||||||
|
.reverse()
|
||||||
|
// .limit($idaa_loc.bb.qry__limit)
|
||||||
.sortBy('name');
|
.sortBy('name');
|
||||||
|
// .sortBy('tmp_sort_1');
|
||||||
|
// .sortBy('updated_on');
|
||||||
|
// .sortBy('updated_on, created_on');
|
||||||
|
// .sortBy('[updated_on+created_on]');
|
||||||
|
// .sortBy('[created_on+updated_on]');
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
});
|
}));
|
||||||
|
|
||||||
// $: if (!$events_sess.launcher.modal__open) {
|
// $: if (!$events_sess.launcher.modal__open) {
|
||||||
// if ($events_loc.launcher.controller == 'local_push' && $events_sess.launcher.ws_connect_status == 'connected') {
|
// if ($events_loc.launcher.controller == 'local_push' && $events_sess.launcher.ws_connect_status == 'connected') {
|
||||||
@@ -349,16 +384,20 @@ function handle_ws_sent(event) {
|
|||||||
/* *** END *** Handle WebSocket events */
|
/* *** END *** Handle WebSocket events */
|
||||||
|
|
||||||
|
|
||||||
$: if ($slct_trigger == 'event_file' && $events_slct.event_file_id && $events_sess.launcher?.event_file_open.open_status == 'open') {
|
$effect(() => {
|
||||||
$slct_trigger = null;
|
if ($slct_trigger == 'event_file' && $events_slct.event_file_id && $events_sess.launcher?.event_file_open.open_status == 'open') {
|
||||||
// handle_event_file_open();
|
$slct_trigger = null;
|
||||||
}
|
// handle_event_file_open();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$: if ($slct_trigger == 'event_file' && $events_sess.launcher?.event_file_open.open_status == 'close') {
|
$effect(() => {
|
||||||
$slct_trigger = null;
|
if ($slct_trigger == 'event_file' && $events_sess.launcher?.event_file_open.open_status == 'close') {
|
||||||
// Assuming just event file modal for now
|
$slct_trigger = null;
|
||||||
// handle_event_file_close();
|
// Assuming just event file modal for now
|
||||||
}
|
// handle_event_file_close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function handle_event_file_open () {
|
async function handle_event_file_open () {
|
||||||
let event_file_obj;
|
let event_file_obj;
|
||||||
@@ -422,16 +461,24 @@ async function handle_event_file_close () {
|
|||||||
// return launcher_modal_values;
|
// return launcher_modal_values;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Updated 2023-3-31
|
|
||||||
export let close_event_file_as_modal = function close_event_file_as_modal({}) {
|
|
||||||
console.log('*** close_event_file_as_modal() ***');
|
|
||||||
|
|
||||||
// NOTE: I can not set the ae_event_launcher values directly. Passing them back to the component and setting them there. Not ideal. This might be improved/fixed in the future?
|
// interface Props {
|
||||||
let launcher_modal_values = {'show_modal_file': false, 'event_file_open': {}};
|
// /** @type {import('./$types').LayoutData} */
|
||||||
|
// data: any;
|
||||||
|
// // Updated 2023-3-31
|
||||||
|
// close_event_file_as_modal?: any;
|
||||||
|
// children?: import('svelte').Snippet;
|
||||||
|
// }
|
||||||
|
|
||||||
// NOTE: Be sure to set these values in the actual ae_event_launcher object!
|
// let { data = $bindable(), close_event_file_as_modal = function close_event_file_as_modal({}) {
|
||||||
return launcher_modal_values;
|
// console.log('*** close_event_file_as_modal() ***');
|
||||||
}
|
|
||||||
|
// // NOTE: I can not set the ae_event_launcher values directly. Passing them back to the component and setting them there. Not ideal. This might be improved/fixed in the future?
|
||||||
|
// let launcher_modal_values = {'show_modal_file': false, 'event_file_open': {}};
|
||||||
|
|
||||||
|
// // NOTE: Be sure to set these values in the actual ae_event_launcher object!
|
||||||
|
// return launcher_modal_values;
|
||||||
|
// }, children }: Props = $props();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -453,7 +500,7 @@ listen({
|
|||||||
cycle: $events_loc.launcher.idle_cycle ?? 5 * 1000, // How frequently the idle status is checked
|
cycle: $events_loc.launcher.idle_cycle ?? 5 * 1000, // How frequently the idle status is checked
|
||||||
});
|
});
|
||||||
|
|
||||||
let idle_timer_interval: any;
|
let idle_timer_interval: any = $state();
|
||||||
clearInterval(idle_timer_interval);
|
clearInterval(idle_timer_interval);
|
||||||
|
|
||||||
function handle_idle_client() {
|
function handle_idle_client() {
|
||||||
@@ -505,7 +552,7 @@ function handle_idle_client() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: {
|
run(() => {
|
||||||
if ($idle) {
|
if ($idle) {
|
||||||
log_lvl = 1;
|
log_lvl = 1;
|
||||||
console.log(`User is idle after ${$events_loc.launcher?.idle_timer} milliseconds.`);
|
console.log(`User is idle after ${$events_loc.launcher?.idle_timer} milliseconds.`);
|
||||||
@@ -515,7 +562,7 @@ $: {
|
|||||||
log_lvl = 0;
|
log_lvl = 0;
|
||||||
clearInterval(idle_timer_interval);
|
clearInterval(idle_timer_interval);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@@ -659,7 +706,7 @@ $: {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<slot />
|
{@render children?.()}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -739,7 +786,7 @@ $: {
|
|||||||
<div class="absolute top-0 left-0 z-20 text-center">
|
<div class="absolute top-0 left-0 z-20 text-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => ($events_loc.launcher.hide_drawer__cfg = false)}
|
onclick={() => ($events_loc.launcher.hide_drawer__cfg = false)}
|
||||||
class="btn btn-sm p-2.5 preset-tonal-error hover:preset-filled-error-500 transition-all duration-1000"
|
class="btn btn-sm p-2.5 preset-tonal-error hover:preset-filled-error-500 transition-all duration-1000"
|
||||||
class:opacity-25={!$ae_loc.trusted_access}
|
class:opacity-25={!$ae_loc.trusted_access}
|
||||||
class:hover:opacity-75={!$ae_loc.trusted_access}
|
class:hover:opacity-75={!$ae_loc.trusted_access}
|
||||||
@@ -826,7 +873,7 @@ $: {
|
|||||||
Debug
|
Debug
|
||||||
</h2>
|
</h2>
|
||||||
<button
|
<button
|
||||||
on:click={() => ($events_loc.launcher.hide_drawer__debug = true)}
|
onclick={() => ($events_loc.launcher.hide_drawer__debug = true)}
|
||||||
class="mb-4 dark:text-white"
|
class="mb-4 dark:text-white"
|
||||||
>
|
>
|
||||||
<span class="fas fa-times"></span>
|
<span class="fas fa-times"></span>
|
||||||
@@ -885,7 +932,7 @@ $: {
|
|||||||
</div>
|
</div>
|
||||||
</svelte:fragment> -->
|
</svelte:fragment> -->
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
console.log(`TEST - THIS WORKS... Local Push Controller Command: ae_close:event_file_modal`);
|
console.log(`TEST - THIS WORKS... Local Push Controller Command: ae_close:event_file_modal`);
|
||||||
// This is not terrible if we set autoclose to true.
|
// This is not terrible if we set autoclose to true.
|
||||||
$events_sess.launcher.controller_cmd = `ae_close:event_file_modal`;
|
$events_sess.launcher.controller_cmd = `ae_close:event_file_modal`;
|
||||||
@@ -908,7 +955,7 @@ $: {
|
|||||||
<!-- </span> -->
|
<!-- </span> -->
|
||||||
|
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
console.log(`TEST - THIS WORKS... Local Push Controller Command: ae_close:event_file_modal`);
|
console.log(`TEST - THIS WORKS... Local Push Controller Command: ae_close:event_file_modal`);
|
||||||
// This is not terrible if we set autoclose to true.
|
// This is not terrible if we set autoclose to true.
|
||||||
$events_sess.launcher.controller_cmd = `ae_close:event_file_modal`;
|
$events_sess.launcher.controller_cmd = `ae_close:event_file_modal`;
|
||||||
@@ -925,7 +972,7 @@ $: {
|
|||||||
<!-- Need to add a re-open button... -->
|
<!-- Need to add a re-open button... -->
|
||||||
|
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
$events_sess.launcher.modal__open = false;
|
$events_sess.launcher.modal__open = false;
|
||||||
}}
|
}}
|
||||||
class="absolute bottom-0 right-20 m-1 p-1 btn btn-sm preset-tonal-warning hover:preset-tonal-warning border border-warning-500"
|
class="absolute bottom-0 right-20 m-1 p-1 btn btn-sm preset-tonal-warning hover:preset-tonal-warning border border-warning-500"
|
||||||
120
src/routes/events/[event_id]/(launcher)/launcher/+layout.ts
Normal file
120
src/routes/events/[event_id]/(launcher)/launcher/+layout.ts
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
/** @type {import('./$types').LayoutLoad} */
|
||||||
|
console.log(`Events - [event_id] launcher +layout.ts start`);
|
||||||
|
|
||||||
|
import { error } from '@sveltejs/kit';
|
||||||
|
import { browser } from '$app/environment';
|
||||||
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
|
export async function load({ params, parent, url }) { // route
|
||||||
|
let log_lvl: number = 0;
|
||||||
|
|
||||||
|
let data = await parent();
|
||||||
|
// console.log(`ae events_pres_mgmt event [event_id] +page.ts data:`, data);
|
||||||
|
data.log_lvl = log_lvl;
|
||||||
|
|
||||||
|
let account_id = data.account_id;
|
||||||
|
let ae_acct = data[account_id];
|
||||||
|
// console.log(`ae_acct = `, ae_acct);
|
||||||
|
|
||||||
|
let event_id = params.event_id;
|
||||||
|
// if (!event_id) {
|
||||||
|
// console.log(`ae Events - [event_id] +page.ts: The event_id was not found in the params.event_id!!!`);
|
||||||
|
// error(404, {
|
||||||
|
// message: 'Event ID not found'
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ae_acct.slct.event_id = event_id;
|
||||||
|
|
||||||
|
// let load_event_obj = events_func.handle_load_ae_obj_id__event({
|
||||||
|
// api_cfg: ae_acct.api, event_id: event_id, try_cache: true
|
||||||
|
// });
|
||||||
|
|
||||||
|
// ae_acct.slct.event_obj = await load_event_obj;
|
||||||
|
|
||||||
|
if (browser) {
|
||||||
|
console.log(`ae_events Launcher - [event_id] launcher +layout.ts start`);
|
||||||
|
|
||||||
|
// Load event object again, but with the event file list
|
||||||
|
// let load_event_obj = events_func.load_ae_obj_id__event({
|
||||||
|
// api_cfg: ae_acct.api,
|
||||||
|
// event_id: event_id,
|
||||||
|
// inc_file_li: true,
|
||||||
|
// log_lvl: log_lvl
|
||||||
|
// })
|
||||||
|
// .then((results) => {
|
||||||
|
// if (!results) {
|
||||||
|
// error(404, {
|
||||||
|
// message: 'Events Launcher - Event not found'
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// // ae_acct.slct.event_obj = results;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
let load_event_device_obj_li = events_func.load_ae_obj_li__event_device({
|
||||||
|
api_cfg: ae_acct.api,
|
||||||
|
for_obj_type: 'event',
|
||||||
|
for_obj_id: event_id,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
});
|
||||||
|
|
||||||
|
let load_event_file_obj_li = events_func.load_ae_obj_li__event_file({
|
||||||
|
api_cfg: ae_acct.api,
|
||||||
|
for_obj_type: 'event',
|
||||||
|
for_obj_id: event_id,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
});
|
||||||
|
|
||||||
|
// let load_event_obj = events_func.load_ae_obj_id__event({
|
||||||
|
// api_cfg: ae_acct.api, event_id: event_id, try_cache: true, log_lvl: 1
|
||||||
|
// });
|
||||||
|
// console.log(`load_event_obj = `, load_event_obj);
|
||||||
|
// ae_acct.slct.event_obj = load_event_obj;
|
||||||
|
|
||||||
|
// let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({
|
||||||
|
// api_cfg: ae_acct.api,
|
||||||
|
// for_obj_type: 'event',
|
||||||
|
// for_obj_id: event_id,
|
||||||
|
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||||
|
// try_cache: true,
|
||||||
|
// log_lvl: 1
|
||||||
|
// });
|
||||||
|
// console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
||||||
|
// ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
|
||||||
|
|
||||||
|
// let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({
|
||||||
|
// api_cfg: ae_acct.api,
|
||||||
|
// for_obj_type: 'event',
|
||||||
|
// for_obj_id: event_id,
|
||||||
|
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
|
||||||
|
// try_cache: true,
|
||||||
|
// log_lvl: log_lvl
|
||||||
|
// });
|
||||||
|
// console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
||||||
|
// ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
||||||
|
|
||||||
|
|
||||||
|
// let event_session_id = url.searchParams.get('session_id');
|
||||||
|
// if (event_session_id) {
|
||||||
|
// let load_event_session_obj = events_func.load_ae_obj_id__event_session({
|
||||||
|
// api_cfg: ae_acct.api,
|
||||||
|
// event_session_id: event_session_id,
|
||||||
|
// inc_file_li: true,
|
||||||
|
// inc_presentation_li: true,
|
||||||
|
// inc_presenter_li: true,
|
||||||
|
// try_cache: true,
|
||||||
|
// log_lvl: log_lvl
|
||||||
|
// });
|
||||||
|
// ae_acct.slct.event_session_id = event_session_id;
|
||||||
|
// console.log(`load_event_session_obj = `, load_event_session_obj);
|
||||||
|
// ae_acct.slct.event_session_obj = load_event_session_obj;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// WARNING: Precaution against shared data between sites and sessions.
|
||||||
|
// data[account_id] = ae_acct;
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
@@ -246,4 +246,3 @@ async function handle_get_device_info(event_device_id) {
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -16,37 +16,6 @@ export async function load({ params, parent, url }) { // route
|
|||||||
let ae_acct = data[account_id];
|
let ae_acct = data[account_id];
|
||||||
console.log(`ae_acct = `, ae_acct);
|
console.log(`ae_acct = `, ae_acct);
|
||||||
|
|
||||||
// if (!account_id) {
|
|
||||||
// console.log(`ae pres_mgmt launcher [event_location_id] +page.ts: The account_id was not found in the data!!!`);
|
|
||||||
// error(404, {
|
|
||||||
// message: 'Account ID not found'
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
let event_id = params.event_id;
|
|
||||||
if (!event_id) {
|
|
||||||
console.log(`ae Events - [event_id] launcher [event_location_id] +page.ts: The event_id was not found in the params.event_id!!!`);
|
|
||||||
error(404, {
|
|
||||||
message: 'Event ID not found'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
console.log(`event_id = `, event_id);
|
|
||||||
|
|
||||||
// ae_acct.trig = {};
|
|
||||||
|
|
||||||
// if (ae_acct.slct.event_id !== event_id) {
|
|
||||||
// ae_acct.slct.event_id = event_id;
|
|
||||||
// ae_acct.trig.event_id = true;
|
|
||||||
|
|
||||||
// // let load_event_obj = events_func.handle_load_ae_obj_id__event({
|
|
||||||
// // api_cfg: ae_acct.api,
|
|
||||||
// // event_id: event_id,
|
|
||||||
// // try_cache: false
|
|
||||||
// // });
|
|
||||||
|
|
||||||
// // ae_acct.slct.event_obj = await load_event_obj;
|
|
||||||
// }
|
|
||||||
|
|
||||||
let event_location_id = params.event_location_id;
|
let event_location_id = params.event_location_id;
|
||||||
if (!event_location_id) {
|
if (!event_location_id) {
|
||||||
console.log(`ae Events - [event_id] launcher [event_location_id] +page.ts: The event_location_id was not found in the params.event_location_id!!!`);
|
console.log(`ae Events - [event_id] launcher [event_location_id] +page.ts: The event_location_id was not found in the params.event_location_id!!!`);
|
||||||
@@ -54,64 +23,26 @@ export async function load({ params, parent, url }) { // route
|
|||||||
message: 'Event Location ID not found'
|
message: 'Event Location ID not found'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(`event_location_id = `, event_location_id);
|
if (log_lvl) {
|
||||||
|
console.log(`ae_events launcher [event_location_id] +page.ts: event_location_id = `, event_location_id);
|
||||||
// if (browser) {
|
}
|
||||||
// ae_acct.trig.event_location_obj_li = false;
|
|
||||||
// let load_event_location_obj_li = await events_func.load_ae_obj_li__event_location({
|
|
||||||
// api_cfg: ae_acct.api,
|
|
||||||
// event_id: event_id,
|
|
||||||
// inc_file_li: true,
|
|
||||||
// params: {qry__enabled: 'enabled', qry__limit: 550},
|
|
||||||
// try_cache: true
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// // console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
|
|
||||||
// ae_acct.trig.event_location_obj_li = true;
|
|
||||||
// });
|
|
||||||
// ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
|
|
||||||
// // console.log(`ae_acct.slct.event_location_obj_li = `, ae_acct.slct.event_location_obj_li);
|
|
||||||
|
|
||||||
// let id_li__event_location = [];
|
|
||||||
|
|
||||||
// let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
|
|
||||||
|
|
||||||
// for (let i = 0; i < load_event_location_obj_li.length; i++) {
|
|
||||||
// let event_location_obj = load_event_location_obj_li[i];
|
|
||||||
// let event_location_id_random = event_location_obj.event_location_id_random;
|
|
||||||
// tmp_li.push(event_location_id_random);
|
|
||||||
// }
|
|
||||||
// id_li__event_location = tmp_li;
|
|
||||||
// console.log(`id_li__event_location:`, id_li__event_location);
|
|
||||||
// ae_acct.slct.id_li__event_location = id_li__event_location;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// let for_obj_type = 'event';
|
|
||||||
// let for_obj_id = event_id;
|
|
||||||
|
|
||||||
// ae_acct.trig.event_session_obj_li = true;
|
|
||||||
|
|
||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
console.log('HERE!!!');
|
if (log_lvl) {
|
||||||
// if (url.searchParams.get('location_id')) {
|
console.log(`ae_events launcher [event_location_id] +page.ts: event_location_id = `, event_location_id);
|
||||||
// console.log(`url.searchParams.get('location_id') = `, url.searchParams.get('location_id'));
|
}
|
||||||
// for_obj_type = 'event_location';
|
// Load event_session object
|
||||||
// for_obj_id = url.searchParams.get('location_id');
|
|
||||||
// }
|
|
||||||
|
|
||||||
let for_obj_type = 'event_location';
|
|
||||||
let for_obj_id = event_location_id;
|
|
||||||
|
|
||||||
// ae_acct.trig.event_session_obj_li = false;
|
|
||||||
let load_event_session_obj_li = await events_func.load_ae_obj_li__event_session({
|
let load_event_session_obj_li = await events_func.load_ae_obj_li__event_session({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
for_obj_type: for_obj_type,
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: for_obj_id,
|
for_obj_id: event_location_id,
|
||||||
// inc_file_li: false,
|
inc_file_li: true,
|
||||||
// inc_presentation_li: false,
|
inc_presentation_li: true,
|
||||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 150},
|
inc_presenter_li: true,
|
||||||
try_cache: true
|
enabled: 'enabled',
|
||||||
|
hidden: 'all',
|
||||||
|
limit: 150,
|
||||||
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
// console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
// console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
|
||||||
@@ -132,6 +63,23 @@ export async function load({ params, parent, url }) { // route
|
|||||||
id_li__event_session = tmp_li;
|
id_li__event_session = tmp_li;
|
||||||
console.log(`id_li__event_session:`, id_li__event_session);
|
console.log(`id_li__event_session:`, id_li__event_session);
|
||||||
ae_acct.slct.id_li__event_session = id_li__event_session;
|
ae_acct.slct.id_li__event_session = id_li__event_session;
|
||||||
|
|
||||||
|
// This should only be needed if the session ID passed is not part of the location sessions.
|
||||||
|
// let event_session_id = url.searchParams.get('session_id');
|
||||||
|
// if (event_session_id) {
|
||||||
|
// let load_event_session_obj = await events_func.load_ae_obj_id__event_session({
|
||||||
|
// api_cfg: ae_acct.api,
|
||||||
|
// event_session_id: event_session_id,
|
||||||
|
// inc_file_li: true,
|
||||||
|
// inc_presentation_li: true,
|
||||||
|
// inc_presenter_li: true,
|
||||||
|
// log_lvl: log_lvl
|
||||||
|
// });
|
||||||
|
// ae_acct.slct.event_session_id = event_session_id;
|
||||||
|
// console.log(`load_event_session_obj = `, load_event_session_obj);
|
||||||
|
// ae_acct.slct.event_session_obj = load_event_session_obj;
|
||||||
|
// }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`ae pres_mgmt launcher [slug] +page.ts: browser = false`);
|
console.log(`ae pres_mgmt launcher [slug] +page.ts: browser = false`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,52 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
interface Props {
|
||||||
|
data_url: any;
|
||||||
|
lq__event_obj: any;
|
||||||
|
lq__location_event_file_obj_li: any;
|
||||||
|
// lq__event_location_obj: any;
|
||||||
|
// export let lq__event_location_obj_li: any;
|
||||||
|
lq__event_location_obj_li: any;
|
||||||
|
// lq__event_session_obj: any;
|
||||||
|
// export let lq__event_session_obj_li: any;
|
||||||
|
lq__event_session_obj_li: any;
|
||||||
|
log_lvl?: number;
|
||||||
|
}
|
||||||
|
|
||||||
// import { tick } from 'svelte';
|
let {
|
||||||
|
data_url,
|
||||||
|
lq__event_obj,
|
||||||
|
lq__location_event_file_obj_li,
|
||||||
|
// lq__event_location_obj,
|
||||||
|
lq__event_location_obj_li,
|
||||||
|
// lq__event_session_obj,
|
||||||
|
lq__event_session_obj_li,
|
||||||
|
log_lvl = $bindable(0),
|
||||||
|
}: Props = $props();
|
||||||
|
|
||||||
|
// *** Import Svelte specific
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
import type { key_val } from '$lib/ae_stores';
|
import type { key_val } from '$lib/ae_stores';
|
||||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||||
import { api } from '$lib/api';
|
import { api } from '$lib/api';
|
||||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||||
import Element_data_store from '$lib/element_data_store_v2.svelte';
|
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||||
|
|
||||||
import { liveQuery } from "dexie";
|
// import { liveQuery } from "dexie";
|
||||||
// import { core_func } from '$lib/ae_core_functions';
|
// import { core_func } from '$lib/ae_core_functions';
|
||||||
// import { db_core } from "$lib/db_core";
|
// import { db_core } from "$lib/db_core";
|
||||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||||
import { db_events } from "$lib/ae_events/db_events";
|
// import { db_events } from "$lib/ae_events/db_events";
|
||||||
import { events_loc, events_sess, events_slct, events_trigger } from '$lib/ae_events_stores';
|
import { events_loc, events_sess, events_slct, events_trigger } from '$lib/ae_events_stores';
|
||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
import Menu_session_list_menu from './menu_session_list.svelte';
|
import Menu_session_list_menu from './menu_session_list.svelte';
|
||||||
|
|
||||||
export let data_url: any;
|
|
||||||
|
|
||||||
let slct_event_location_id: string = $events_slct.event_location_id;
|
let slct_event_location_id: string = $state($events_slct.event_location_id);
|
||||||
|
|
||||||
$events_trigger = null;
|
$events_trigger = null;
|
||||||
|
|
||||||
export let lq__event_obj: any;
|
|
||||||
export let lq__location_event_file_obj_li: any;
|
|
||||||
export let lq__event_location_obj: any;
|
|
||||||
// export let lq__event_location_obj_li: any;
|
|
||||||
export let lq__event_location_obj_li: any;
|
|
||||||
export let lq__event_session_obj: any;
|
|
||||||
// export let lq__event_session_obj_li: any;
|
|
||||||
export let lq__event_session_obj_li: any;
|
|
||||||
|
|
||||||
|
|
||||||
let qry__enabled = 'enabled';
|
let qry__enabled = 'enabled';
|
||||||
let qry__hidden = 'not_hidden';
|
let qry__hidden = 'not_hidden';
|
||||||
@@ -48,9 +61,9 @@ if ($ae_loc.administrator_access) {
|
|||||||
qry__hidden = 'not_hidden';
|
qry__hidden = 'not_hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
let ae_promises: key_val = {
|
let ae_promises: key_val = $state({
|
||||||
get_li__event_file: null,
|
get_li__event_file: null,
|
||||||
};
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -60,7 +73,7 @@ let ae_promises: key_val = {
|
|||||||
<h2 class="">{$lq__event_obj?.cfg_json.short_name ?? 'loading...'}</h2>
|
<h2 class="">{$lq__event_obj?.cfg_json.short_name ?? 'loading...'}</h2>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
$events_loc.launcher.show_content__hidden_files = !$events_loc.launcher.show_content__hidden_files;
|
$events_loc.launcher.show_content__hidden_files = !$events_loc.launcher.show_content__hidden_files;
|
||||||
}}
|
}}
|
||||||
class="btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-primary-500 text-xs py-1 px-2"
|
class="btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-primary-500 text-xs py-1 px-2"
|
||||||
@@ -75,7 +88,7 @@ let ae_promises: key_val = {
|
|||||||
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
$events_loc.launcher.show_content__hidden_sessions = !$events_loc.launcher.show_content__hidden_sessions;
|
$events_loc.launcher.show_content__hidden_sessions = !$events_loc.launcher.show_content__hidden_sessions;
|
||||||
}}
|
}}
|
||||||
class="btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-primary-500 text-xs py-1 px-2"
|
class="btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-primary-500 text-xs py-1 px-2"
|
||||||
@@ -105,7 +118,7 @@ let ae_promises: key_val = {
|
|||||||
<select
|
<select
|
||||||
class="select text-xs p-1"
|
class="select text-xs p-1"
|
||||||
bind:value={slct_event_location_id}
|
bind:value={slct_event_location_id}
|
||||||
on:change={async () => {
|
onchange={async () => {
|
||||||
// console.log(`slct_event_location_id:`, slct_event_location_id);
|
// console.log(`slct_event_location_id:`, slct_event_location_id);
|
||||||
|
|
||||||
console.log('Remove fields from the URL.');
|
console.log('Remove fields from the URL.');
|
||||||
@@ -150,7 +163,9 @@ let ae_promises: key_val = {
|
|||||||
for_obj_id: $events_slct.event_location_id,
|
for_obj_id: $events_slct.event_location_id,
|
||||||
inc_file_li: false,
|
inc_file_li: false,
|
||||||
inc_presentation_li: false,
|
inc_presentation_li: false,
|
||||||
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 100},
|
enabled: 'enabled',
|
||||||
|
hidden: 'all',
|
||||||
|
limit: 49,
|
||||||
try_cache: true,
|
try_cache: true,
|
||||||
log_lvl: 1,
|
log_lvl: 1,
|
||||||
})
|
})
|
||||||
@@ -245,7 +260,7 @@ let ae_promises: key_val = {
|
|||||||
{#each $lq__location_event_file_obj_li as event_file_obj, index}
|
{#each $lq__location_event_file_obj_li as event_file_obj, index}
|
||||||
<button
|
<button
|
||||||
disabled={!$ae_loc.trusted_access}
|
disabled={!$ae_loc.trusted_access}
|
||||||
on:click={() => {
|
onclick={() => {
|
||||||
// ae_promises[event_file_obj.event_file_id_random]
|
// ae_promises[event_file_obj.event_file_id_random]
|
||||||
ae_promises[event_file_obj?.event_file_id_random] = api.download_hosted_file({
|
ae_promises[event_file_obj?.event_file_id_random] = api.download_hosted_file({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ let hover_timer: any = null;
|
|||||||
hover_timer = setTimeout(async () => {
|
hover_timer = setTimeout(async () => {
|
||||||
$events_slct.event_session_id = null;
|
$events_slct.event_session_id = null;
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
// $events_slct.event_session_id = event_session_obj?.id;
|
// $events_slct.event_session_id = event_session_obj?.id;
|
||||||
$events_slct.event_session_id = event_session_obj?.id;
|
$events_slct.event_session_id = event_session_obj?.id;
|
||||||
data_url.searchParams.set('session_id', event_session_obj?.id);
|
data_url.searchParams.set('session_id', event_session_obj?.id);
|
||||||
@@ -160,7 +160,8 @@ let hover_timer: any = null;
|
|||||||
}}
|
}}
|
||||||
class="btn btn-sm hover:preset-filled-primary-500 overflow-hidden text-sm w-full max-w-full text-left transition-all rounded-md flex flex-row justify-between items-center"
|
class="btn btn-sm hover:preset-filled-primary-500 overflow-hidden text-sm w-full max-w-full text-left transition-all rounded-md flex flex-row justify-between items-center"
|
||||||
class:preset-filled-primary-500={$events_slct.event_session_id === event_session_obj?.id}
|
class:preset-filled-primary-500={$events_slct.event_session_id === event_session_obj?.id}
|
||||||
class:preset-tonal-secondary border border-secondary-500={$events_slct.event_session_id != event_session_obj?.id}
|
class:preset-tonal-secondary={$events_slct.event_session_id != event_session_obj?.id}
|
||||||
|
class:border-secondary-500={$events_slct.event_session_id != event_session_obj?.id}
|
||||||
class:font-bold={$events_slct.event_session_id === event_session_obj?.id}
|
class:font-bold={$events_slct.event_session_id === event_session_obj?.id}
|
||||||
|
|
||||||
class:hidden={!$events_loc.launcher.show_content__hidden_sessions && event_session_obj?.hide}
|
class:hidden={!$events_loc.launcher.show_content__hidden_sessions && event_session_obj?.hide}
|
||||||
|
|||||||
@@ -44,12 +44,26 @@ export async function load({ params, parent }) { // route
|
|||||||
let load_event_obj = await events_func.load_ae_obj_id__event({
|
let load_event_obj = await events_func.load_ae_obj_id__event({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
event_id: event_id,
|
event_id: event_id,
|
||||||
inc_device_li: true,
|
// inc_file_li: true,
|
||||||
|
// inc_device_li: true,
|
||||||
inc_location_li: true,
|
inc_location_li: true,
|
||||||
inc_session_li: true,
|
inc_session_li: true,
|
||||||
try_cache: true,
|
|
||||||
log_lvl: log_lvl
|
log_lvl: log_lvl
|
||||||
|
// })
|
||||||
|
// .then((results) => {
|
||||||
|
// if (!results) {
|
||||||
|
// error(404, {
|
||||||
|
// message: 'Events - Event not found'
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// // ae_acct.slct.event_obj = results;
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
if (!load_event_obj) {
|
||||||
|
error(404, {
|
||||||
|
message: 'Events - Event not found'
|
||||||
|
});
|
||||||
|
}
|
||||||
console.log(`load_event_obj = `, load_event_obj);
|
console.log(`load_event_obj = `, load_event_obj);
|
||||||
ae_acct.slct.event_obj = load_event_obj;
|
ae_acct.slct.event_obj = load_event_obj;
|
||||||
ae_acct.slct.event_device_obj_li = load_event_obj.event_device_obj_li;
|
ae_acct.slct.event_device_obj_li = load_event_obj.event_device_obj_li;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/** @type {import('./$types').PageLoad} */
|
/** @type {import('./$types').PageLoad} */
|
||||||
|
|
||||||
import { error } from '@sveltejs/kit';
|
import { error } from '@sveltejs/kit';
|
||||||
console.log(`ae_events_pres_mgmt_event [event_location_id] +page.ts start`);
|
console.log(`ae_events_pres_mgmt_event [event_location_id] +page.ts start`);
|
||||||
|
|
||||||
@@ -15,13 +16,6 @@ export async function load({ params, parent }) { // route
|
|||||||
let ae_acct = data[account_id];
|
let ae_acct = data[account_id];
|
||||||
// console.log(`ae_acct = `, ae_acct);
|
// console.log(`ae_acct = `, ae_acct);
|
||||||
|
|
||||||
// if (!account_id) {
|
|
||||||
// console.log(`ae events_pres_mgmt location [event_location_id] +page.ts: The account_id was not found in the data!!!`);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
data.ae_events_pres_mgmt_event_slug_page_ts = true;
|
|
||||||
|
|
||||||
let event_location_id = params.event_location_id;
|
let event_location_id = params.event_location_id;
|
||||||
if (!event_location_id) {
|
if (!event_location_id) {
|
||||||
console.log(`ae events_pres_mgmt location [event_location_id] +page.ts: The event_location_id was not found in the params!!!`);
|
console.log(`ae events_pres_mgmt location [event_location_id] +page.ts: The event_location_id was not found in the params!!!`);
|
||||||
@@ -46,9 +40,9 @@ export async function load({ params, parent }) { // route
|
|||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
for_obj_type: 'event_location',
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: event_location_id,
|
for_obj_id: event_location_id,
|
||||||
params: {qry__enabled: 'all', qry__limit: 50},
|
enabled: 'all',
|
||||||
try_cache: true,
|
limit: 50,
|
||||||
log_lvl: 1
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
.then((event_session_obj_li) => {
|
.then((event_session_obj_li) => {
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
@@ -62,8 +56,9 @@ export async function load({ params, parent }) { // route
|
|||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
for_obj_type: 'event_session',
|
for_obj_type: 'event_session',
|
||||||
for_obj_id: event_session_id,
|
for_obj_id: event_session_id,
|
||||||
params: {qry__enabled: 'all', qry__limit: 25},
|
enabled: 'all',
|
||||||
try_cache: true
|
limit: 25,
|
||||||
|
log_lvl: log_lvl
|
||||||
});
|
});
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`load_event_presentation_obj_li = `, load_event_presentation_obj_li);
|
console.log(`load_event_presentation_obj_li = `, load_event_presentation_obj_li);
|
||||||
@@ -78,19 +73,14 @@ export async function load({ params, parent }) { // route
|
|||||||
}
|
}
|
||||||
ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
|
ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
|
||||||
|
|
||||||
// Load event files for the location
|
|
||||||
let ae_params = {
|
|
||||||
qry__enabled: 'all',
|
|
||||||
qry__hidden: 'all',
|
|
||||||
qry__limit: 50
|
|
||||||
}
|
|
||||||
|
|
||||||
let load_event_file_obj_li = await events_func.load_ae_obj_li__event_file({
|
let load_event_file_obj_li = await events_func.load_ae_obj_li__event_file({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
for_obj_type: 'event_location',
|
for_obj_type: 'event_location',
|
||||||
for_obj_id: event_location_id,
|
for_obj_id: event_location_id,
|
||||||
params: ae_params,
|
enabled: 'all',
|
||||||
try_cache: true
|
hidden: 'all',
|
||||||
|
limit: 50,
|
||||||
|
log_lvl: log_lvl
|
||||||
})
|
})
|
||||||
.then((event_file_obj_li) => {
|
.then((event_file_obj_li) => {
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
@@ -102,6 +92,14 @@ export async function load({ params, parent }) { // route
|
|||||||
console.log(`load_event_file_obj_li = `, load_event_file_obj_li);
|
console.log(`load_event_file_obj_li = `, load_event_file_obj_li);
|
||||||
}
|
}
|
||||||
ae_acct.slct.event_file_obj_li = load_event_file_obj_li;
|
ae_acct.slct.event_file_obj_li = load_event_file_obj_li;
|
||||||
|
|
||||||
|
let load_event_device_obj_li = events_func.load_ae_obj_li__event_device({
|
||||||
|
api_cfg: ae_acct.api,
|
||||||
|
for_obj_type: 'event_location',
|
||||||
|
for_obj_id: event_location_id,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
});
|
||||||
|
ae_acct.slct.event_device_obj_li = load_event_device_obj_li;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WARNING: Precaution against shared data between sites and sessions.
|
// WARNING: Precaution against shared data between sites and sessions.
|
||||||
|
|||||||
@@ -35,17 +35,13 @@ export async function load({ params, parent }) { // route
|
|||||||
ae_acct.slct.event_presenter_obj = await load_event_presenter_obj;
|
ae_acct.slct.event_presenter_obj = await load_event_presenter_obj;
|
||||||
|
|
||||||
// Load event files for the presenter
|
// Load event files for the presenter
|
||||||
let ae_params = {
|
|
||||||
qry__enabled: 'all',
|
|
||||||
qry__hidden: 'all',
|
|
||||||
qry__limit: 50
|
|
||||||
}
|
|
||||||
|
|
||||||
let load_event_file_obj_li = await events_func.load_ae_obj_li__event_file({
|
let load_event_file_obj_li = await events_func.load_ae_obj_li__event_file({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
for_obj_type: 'event_presenter',
|
for_obj_type: 'event_presenter',
|
||||||
for_obj_id: event_presenter_id,
|
for_obj_id: event_presenter_id,
|
||||||
params: ae_params,
|
enabled: 'all',
|
||||||
|
hidden: 'all',
|
||||||
|
limit: 50,
|
||||||
try_cache: true
|
try_cache: true
|
||||||
})
|
})
|
||||||
.then((event_file_obj_li) => {
|
.then((event_file_obj_li) => {
|
||||||
|
|||||||
@@ -89,17 +89,13 @@ export async function load({ params, parent }) { // route
|
|||||||
ae_acct.slct.event_presentation_obj_li = load_event_presentation_obj_li;
|
ae_acct.slct.event_presentation_obj_li = load_event_presentation_obj_li;
|
||||||
|
|
||||||
// Load event files for the session
|
// Load event files for the session
|
||||||
let ae_params = {
|
|
||||||
qry__enabled: 'all',
|
|
||||||
qry__hidden: 'all',
|
|
||||||
qry__limit: 50
|
|
||||||
}
|
|
||||||
|
|
||||||
let load_event_file_obj_li = await events_func.load_ae_obj_li__event_file({
|
let load_event_file_obj_li = await events_func.load_ae_obj_li__event_file({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
for_obj_type: 'event_session',
|
for_obj_type: 'event_session',
|
||||||
for_obj_id: event_session_id,
|
for_obj_id: event_session_id,
|
||||||
params: ae_params,
|
enabled: 'all',
|
||||||
|
hidden: 'all',
|
||||||
|
limit: 50,
|
||||||
try_cache: true
|
try_cache: true
|
||||||
})
|
})
|
||||||
.then((event_file_obj_li) => {
|
.then((event_file_obj_li) => {
|
||||||
|
|||||||
@@ -81,16 +81,12 @@ async function handle_submit_form_files(event) {
|
|||||||
|
|
||||||
db_events.files.clear();
|
db_events.files.clear();
|
||||||
|
|
||||||
let params = {
|
|
||||||
qry__enabled: 'all',
|
|
||||||
qry__hidden: 'all',
|
|
||||||
}
|
|
||||||
|
|
||||||
events_func.load_ae_obj_li__event_file({
|
events_func.load_ae_obj_li__event_file({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
for_obj_type: link_to_type,
|
for_obj_type: link_to_type,
|
||||||
for_obj_id: link_to_id,
|
for_obj_id: link_to_id,
|
||||||
params: params,
|
enabled: 'all',
|
||||||
|
hidden: 'all',
|
||||||
try_cache: true
|
try_cache: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let log_lvl: number = 0;
|
let log_lvl: number = $state(0);
|
||||||
|
|
||||||
// *** Import Svelte specific
|
// *** Import Svelte specific
|
||||||
import { page } from '$app/state';
|
import { page } from '$app/state';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
/** @type {import('./$types').LayoutProps} */
|
/** @type {import('./$types').LayoutProps} */
|
||||||
let log_lvl: number = 0;
|
let log_lvl: number = $state(0);
|
||||||
|
|
||||||
let { data, children } = $props();
|
let { data, children } = $props();
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export async function load({ params, parent }) {
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`ae_journals journals [journal_id] +page.ts: journal_id = `, journal_id);
|
console.log(`ae_journals journals [journal_id] +page.ts: journal_id = `, journal_id);
|
||||||
}
|
}
|
||||||
// Load event journal object
|
// Load journal object
|
||||||
let load_journal_obj = await journals_func.load_ae_obj_id__journal({
|
let load_journal_obj = await journals_func.load_ae_obj_id__journal({
|
||||||
api_cfg: ae_acct.api,
|
api_cfg: ae_acct.api,
|
||||||
journal_id: journal_id,
|
journal_id: journal_id,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
/** @type {import('./$types').PageData} */
|
/** @type {import('./$types').PageData} */
|
||||||
let log_lvl: number = 0;
|
let log_lvl: number = $state(0);
|
||||||
|
|
||||||
// *** Import Svelte specific
|
// *** Import Svelte specific
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
|
|||||||
Reference in New Issue
Block a user