More work on the Launcher and related

This commit is contained in:
Scott Idem
2025-09-17 16:36:04 -04:00
parent c9e9fbec79
commit 60fbfc434e
7 changed files with 341 additions and 365 deletions

View File

@@ -703,7 +703,7 @@ $effect(() => {
static static
m-auto m-auto
border border-gray-200 dark:border-gray-600 border-x border-gray-200 dark:border-gray-600
mt-12 mb-14 sm:mb-12 mt-12 mb-14 sm:mb-12
h-full w-full max-w-7xl h-full w-full max-w-7xl
" "
@@ -753,7 +753,7 @@ $effect(() => {
flex flex-col sm:flex-row flex-wrap sm:flex-nowrap gap-0 flex flex-col sm:flex-row flex-wrap sm:flex-nowrap gap-0
items-center items-center
justify-center justify-center
py-1 px-1 py-1 px-0.5
bg-gray-100 bg-gray-100
" "
> >
@@ -765,10 +765,11 @@ $effect(() => {
basis-1/5 basis-1/5
min-w-56 md:min-w-64 lg:min-w-72 min-w-56 md:min-w-64 lg:min-w-72
max-w-xs max-w-xs
py-1 px-0.5 pt-0.5 pr-0.5
flex flex-col gap-1 items-center justify-start flex flex-col gap-1 items-center justify-start
overflow-y-auto overflow-y-auto
border-r border-gray-300 dark:border-gray-600 border-r border-gray-200 dark:border-gray-700
hover:bg-surface-100-900
" "
class:hidden={$events_loc.launcher.hide__launcher_menu} class:hidden={$events_loc.launcher.hide__launcher_menu}
> >
@@ -793,6 +794,7 @@ $effect(() => {
bind:loading__session_li_status={$events_sess.launcher.loading__session_li_status} bind:loading__session_li_status={$events_sess.launcher.loading__session_li_status}
lq__event_session_obj_li={lq__event_session_obj_li} lq__event_session_obj_li={lq__event_session_obj_li}
bind:loading__session_id_status={$events_sess.launcher.loading__session_id_status}
lq__event_session_obj={lq__event_session_obj} lq__event_session_obj={lq__event_session_obj}
slct__event_session_id={$events_slct.event_session_id} slct__event_session_id={$events_slct.event_session_id}
> >
@@ -814,13 +816,12 @@ $effect(() => {
h-full h-full
min-w-xs min-w-xs
max-w-full max-w-full
py-1 px-1 py-1 px-0.5
basis-4/5 basis-4/5
flex flex-col gap-1 flex flex-col gap-1
items-center items-center
justify-center justify-center
overflow-y-auto overflow-y-auto
" "
> >

View File

@@ -586,18 +586,42 @@ async function handle_open_file() {
</Element_ae_crud> </Element_ae_crud>
<span class="event_file_created_on" class:hidden="{hide_created_on}"> <span
<span> class="
<span class="fas fa-calendar-day hidden lg:inline-block"></span> event_file_created_on
text-xs text-center
flex flex-row gap-1 items-center justify-end
w-24 max-w-28
preset-filled-surface-100-900
rounded
p-1
"
class:hidden="{hide_created_on}"
>
<span class="fas fa-calendar-day"></span>
<span class="flex flex-row flex-wrap gap-1 items-center justify-end">
<span class="w-18">
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'date_short')} {ae_util.iso_datetime_formatter(event_file_obj.created_on, 'date_short')}
</span> </span>
<span> <span class="w-18">
<!-- <span class="fas fa-clock"></span> --> <!-- <span class="fas fa-clock"></span> -->
{ae_util.iso_datetime_formatter(event_file_obj.created_on, 'time_12_short')} {ae_util.iso_datetime_formatter(event_file_obj.created_on, 'time_12_short')}
</span> </span>
</span> </span>
</span>
<span class="event_file_size text-right" class:hidden="{hide_size}"> <span
class="
event_file_size
text-xs text-center
flex flex-row gap-1 items-center justify-end
preset-filled-surface-100-900
w-22 max-w-28
rounded
p-1
"
class:hidden="{hide_size}"
>
<span class="fas fa-save"></span> <span class="fas fa-save"></span>
{#if event_file_obj.file_size}{ae_util.format_bytes(event_file_obj.file_size)}{/if} {#if event_file_obj.file_size}{ae_util.format_bytes(event_file_obj.file_size)}{/if}
</span> </span>

View File

@@ -51,7 +51,7 @@ let {
// *** Import Aether specific variables and functions // *** Import Aether specific variables and functions
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';
@@ -104,8 +104,6 @@ let ae_promises: key_val = $state({
" "
> >
<!-- <h2 class="text-sm font-semibold">{$lq__event_obj?.cfg_json.short_name ?? 'loading...'}</h2> -->
{#if $lq__event_event_file_obj_li} {#if $lq__event_event_file_obj_li}
<div class="w-full"> <div class="w-full">
@@ -138,9 +136,32 @@ let ae_promises: key_val = $state({
hover:preset-tonal-success hover:preset-tonal-success
transition-all transition-all
" "
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
> >
<span class="fas fa-file-archive m-1 text-neutral-800/80"></span> {#await ae_promises[event_file_obj.event_file_id_random]}
{event_file_obj?.filename} <span class="fas fa-spinner fa-spin mx-1"></span>
<span class="">
Downloading
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id_random]}
{$ae_sess.api_download_kv[event_file_obj.hosted_file_id_random].percent_completed}%
{/if}
:
</span>
{:then}
<!-- <span class="fas fa-download mx-1"></span> -->
<span class="fas fa-{ae_util.file_extension_icon(event_file_obj.extension)}"></span>
<!-- <span class="text-sm">
Download:
</span> -->
{/await}
<span class="grow">
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: 30})}
</span>
<!-- <span class="fas fa-file-archive m-1 text-neutral-800/80"></span>
{event_file_obj?.filename} -->
</button> </button>
{/each} {/each}
</div> </div>
@@ -156,113 +177,6 @@ let ae_promises: key_val = $state({
/> />
{/if} {/if}
<!-- <div
class="
w-full max-w-full
flex flex-row gap-1 items-center justify-center
"
>
{#if $lq__event_location_obj_li && $lq__event_location_obj_li.length > 0}
<div class="text-xs text-neutral-800/80"><strong>
Location:
{#if $ae_loc.administrator_access}
({$lq__event_location_obj_li?.length}&times;)
{/if}
{#await ae_promises[slct_event_location_id]}
<span class="fas fa-spinner fa-spin text-blue-500"></span>
{:then result}
<span class="fas fa-check text-green-500/80"></span>
{/await}
</strong></div>
<select
class="select text-xs p-1 w-42"
bind:value={slct_event_location_id}
onchange={async () => {
// console.log(`slct_event_location_id:`, slct_event_location_id);
console.log('Remove fields from the URL.');
// data_url.searchParams.delete('location_id');
data_url.searchParams.delete('presentation_id');
data_url.searchParams.delete('presenter_id');
data_url.searchParams.delete('session_id');
// let url_location_id = slct_event_location_id;
// data_url.searchParams.set('location_id', url_location_id);
let new_url = `/events/${$events_slct.event_id}/launcher`;
if (slct_event_location_id) {
$events_loc.launcher.slct.event_location_id = slct_event_location_id;
$events_slct.event_location_id = slct_event_location_id;
$events_slct.id_li__event_session = [];
ae_promises[slct_event_location_id] = events_func.load_ae_obj_li__event_session({
api_cfg: $ae_api,
for_obj_type: 'event_location',
for_obj_id: $events_slct.event_location_id,
inc_file_li: true,
inc_presentation_li: true,
inc_presenter_li: true,
enabled: $events_loc.launcher.show_content__enabled_sessions ? 'all' : 'enabled',
hidden: $events_loc.launcher.show_content__hidden_sessions ? 'all' : 'not_hidden',
limit: 49,
try_cache: true,
log_lvl: 1,
})
.then(async function (load_results) {
console.log(`load_results = `, load_results);
let event_session_id_li = [];
let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery.
for (let i = 0; i < load_results.length; i++) {
let event_session_obj = load_results[i];
let event_session_id_random = event_session_obj.event_session_id_random;
tmp_li.push(event_session_id_random);
}
event_session_id_li = tmp_li;
console.log(`event_session_id_li:`, event_session_id_li);
$events_slct.id_li__event_session = event_session_id_li;
return load_results;
});
new_url = `/events/${$events_slct.event_id}/launcher/${$events_slct.event_location_id}`;
} else {
// This will hide the selected session if the location is changed to false.
// WARNING: This may need to be commented out later.
// slct_event_session_id = null;
$events_loc.launcher.slct.event_location_id = null;
$events_slct.event_location_id = null;
$events_loc.launcher.slct.event_session_id = null;
$events_slct.event_session_id = null;
// WARNING: This may need to be commented out later.
}
goto(new_url, {replaceState: true});
// goto(new_url, {replaceState: false});
}}
>
<option value="">Select a location</option>
{#each $lq__event_location_obj_li as event_location_obj}
<option
value={event_location_obj?.id}
>
{event_location_obj?.name}
</option>
{/each}
</select>
{:else}
<div class="text-sm">
No locations found.
(Event ID: {$lq__event_obj?.id})
</div>
{/if}
</div>
{/if} -->
{#if $lq__location_event_file_obj_li} {#if $lq__location_event_file_obj_li}
<div class="w-full"> <div class="w-full">
@@ -287,6 +201,7 @@ let ae_promises: key_val = $state({
hover:preset-tonal-success hover:preset-tonal-success
transition-all transition-all
" "
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
> >
<span class="fas fa-file-archive m-1 text-neutral-800/80"></span> <span class="fas fa-file-archive m-1 text-neutral-800/80"></span>
{event_file_obj?.filename} {event_file_obj?.filename}
@@ -296,18 +211,15 @@ let ae_promises: key_val = $state({
{/if} {/if}
<!-- <div class="w-full"> -->
{#if $lq__event_session_obj_li} {#if $lq__event_session_obj_li}
<Menu_session_list_menu <Menu_session_list_menu
data_url={data_url} data_url={data_url}
bind:loading__session_id_status={loading__session_id_status}
lq__event_session_obj_li={lq__event_session_obj_li} lq__event_session_obj_li={lq__event_session_obj_li}
slct_event_session_id={$events_slct.event_session_id} slct_event_session_id={$events_slct.event_session_id}
/> />
{/if} {/if}
<!-- </div> -->
{#if $ae_loc.edit_mode} {#if $ae_loc.edit_mode}
<div <div

View File

@@ -62,11 +62,11 @@ let lq__event_file_obj_li = $derived(liveQuery(async () => {
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length} {#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
<section class="event_session_file_list"> <section class="event_session_file_list">
<div> <div>
<div class="text-xs"><strong> <div class="text-xs text-surface-600-400"><strong>
<span class="fas fa-file-archive"></span> <span class="fas fa-file-archive"></span>
Presenter Files: Presenter Files:
{#if $ae_loc.administrator_access} {#if $ae_loc.administrator_access && $ae_loc.edit_mode}
({$lq__event_file_obj_li?.length}) ({$lq__event_file_obj_li?.length}&times;)
{/if} {/if}
</strong></div> </strong></div>
</div> </div>

View File

@@ -146,10 +146,23 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
event_launcher_session_view event_launcher_session_view
grow h-full w-full grow h-full w-full
space-y-1 space-y-1
relative
" "
> >
<!-- <slot name="event_session_message">event session message</slot> --> <!-- <slot name="event_session_message">event session message</slot> -->
{#if $events_sess.launcher.loading__session_id_status}
<span class="absolute top-0 right-0 text-sm text-center text-gray-400">
<span class="fas fa-spinner fa-spin"></span>
Loading session information...
</span>
<!-- {:else}
<span class="absolute top-0 right-0 text-sm text-center text-gray-400">
Session loaded?
</span> -->
{/if}
{#if $lq__event_session_obj && $lq__event_session_obj.event_session_id_random} {#if $lq__event_session_obj && $lq__event_session_obj.event_session_id_random}
<header class="event_session_about text-center border-b-2 border-gray-400"> <header class="event_session_about text-center border-b-2 border-gray-400">
@@ -194,6 +207,7 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
{/if} {/if}
</h2> </h2>
</header> </header>
<!-- <section class="event_session_description text-xs" class:d_none="{hide_description}"> <!-- <section class="event_session_description text-xs" class:d_none="{hide_description}">
@@ -215,13 +229,16 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length} {#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
<section class="event_session_file_list"> <section class="event_session_file_list">
<div> <div>
<div class="text-xs"><strong> <div class="text-xs text-surface-600-400">
<strong>
<span class="fas fa-file-archive"></span> <span class="fas fa-file-archive"></span>
Session Files: Session Files:
{#if $ae_loc.administrator_access}
({$lq__event_file_obj_li?.length}) <span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}>
{/if} ({$lq__event_file_obj_li?.length}&times;)
</strong></div> </span>
</strong>
</div>
<!-- {#if $ae_loc.trusted_access || $events_loc.launcher.trusted_access} <!-- {#if $ae_loc.trusted_access || $events_loc.launcher.trusted_access}
<button on:click={async () => { <button on:click={async () => {
show_modal_upload_files = true; show_modal_upload_files = true;
@@ -255,7 +272,9 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
// window.postMessage({ type: 'download_event_file', event_file_id: event_file_obj.event_file_id_random, filename: event_file_obj.filename, auto_download: true }, '*'); // window.postMessage({ type: 'download_event_file', event_file_id: event_file_obj.event_file_id_random, filename: event_file_obj.filename, auto_download: true }, '*');
}} }}
class="btn btn-sm lg:btn-md preset-tonal-secondary hover:preset-filled-primary-500 min-w-72 lg:min-w-96" class="btn btn-sm lg:btn-md preset-tonal-secondary hover:preset-filled-primary-500 min-w-72 lg:min-w-96
transition-all
"
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`} title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
> >
{#await ae_promises[event_file_obj.event_file_id_random]} {#await ae_promises[event_file_obj.event_file_id_random]}
@@ -315,7 +334,7 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
{#if $lq__event_presentation_obj_li} {#if $lq__event_presentation_obj_li}
<div class="text-xs"><strong> <div class="text-xs text-surface-600-400"><strong>
{#if $lq__event_session_obj.type_code == 'poster'} {#if $lq__event_session_obj.type_code == 'poster'}
<span class="fas fa-image"></span> <span class="fas fa-image"></span>
Posters: Posters:
@@ -323,8 +342,8 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
<span class="fas fa-tv"></span> <span class="fas fa-tv"></span>
Presentations: Presentations:
{/if} {/if}
{#if $ae_loc.administrator_access} {#if $ae_loc.administrator_access && $ae_loc.edit_mode}
({$lq__event_presentation_obj_li?.length}) ({$lq__event_presentation_obj_li?.length}&times;)
{/if} {/if}
</strong></div> </strong></div>
@@ -349,7 +368,16 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
<ul class="event_presentation_presenter_list"> <ul class="event_presentation_presenter_list">
{#each $lq__event_presenter_obj_li as event_presenter_obj, index} {#each $lq__event_presenter_obj_li as event_presenter_obj, index}
{#if event_presenter_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random} {#if event_presenter_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random}
<li> <li
class="
border border-transparent
rounded-lg
hover:bg-surface-100-900
hover:border-surface-400-600
p-1
transition-all
"
>
{#if $lq__event_session_obj.type_code == 'poster'} {#if $lq__event_session_obj.type_code == 'poster'}
<Launcher_presenter_view_posters <Launcher_presenter_view_posters
lq__event_presenter_obj={event_presenter_obj} lq__event_presenter_obj={event_presenter_obj}

View File

@@ -45,15 +45,15 @@ let ae_promises: key_val = $state({
</script> </script>
<!-- text-neutral-800/80 -->
<div <div
class=" class="
w-full max-w-full w-full max-w-full
flex flex-row flex-wrap gap-1 items-center justify-center flex flex-col md:flex-row flex-wrap gap-1 items-center justify-center
" "
> >
{#if $lq__event_location_obj_li && $lq__event_location_obj_li.length > 0} {#if $lq__event_location_obj_li && $lq__event_location_obj_li.length > 0}
<div class="text-xs text-neutral-800/80"> <div class="text-xs text-surface-600-400">
<strong> <strong>
Location: Location:
<span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}> <span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}>

View File

@@ -48,12 +48,12 @@ let hover_timer: any = $state(null);
<div <div
class=" class="
w-full max-w-full w-full max-w-80
flex flex-col flex-wrap items-center justify-start flex flex-col md:flex-row flex-wrap gap-1 items-center justify-start md:justify-center
" "
> >
{#if $lq__event_session_obj_li && $lq__event_session_obj_li.length > 0} {#if $lq__event_session_obj_li && $lq__event_session_obj_li.length > 0}
<div class="text-xs text-neutral-800/80"> <div class="text-xs text-surface-600-400">
<strong> <strong>
Sessions: Sessions:
<span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}> <span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}>
@@ -70,10 +70,10 @@ let hover_timer: any = $state(null);
</div> </div>
<ul <ul
class="space-y-1" class="space-y-1 max-w-full p-0 m-0"
> >
{#each $lq__event_session_obj_li as event_session_obj} {#each $lq__event_session_obj_li as event_session_obj}
<li> <li class="p-0 m-0">
<button <button
type="button" type="button"
onmouseenter={() => { onmouseenter={() => {
@@ -81,12 +81,20 @@ let hover_timer: any = $state(null);
hover_timer = setTimeout(async () => { hover_timer = setTimeout(async () => {
loading__session_id_status = true; loading__session_id_status = true;
$events_slct.event_session_id = null; // $events_slct.event_session_id = null;
await tick(); // await tick();
slct_event_session_id = event_session_obj?.id; 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);
let new_url = data_url.toString();
console.log(new_url);
loading__session_id_status = false;
// goto(new_url, {replaceState: true}); // Updates the URL without reloading the page
goto(new_url, {replaceState: false}); // Updates the URL history without reloading the page
loading__session_id_status = 'loading';
$events_slct.event_session_obj = event_session_obj; $events_slct.event_session_obj = event_session_obj;
ae_promises.slct_event_session_id = events_func.load_ae_obj_id__event_session({ ae_promises.slct_event_session_id = events_func.load_ae_obj_id__event_session({
@@ -100,11 +108,11 @@ let hover_timer: any = $state(null);
.then(async (load_results) => { .then(async (load_results) => {
console.log(`load_results = `, load_results); console.log(`load_results = `, load_results);
let new_url = data_url.toString(); // let new_url = data_url.toString();
console.log(new_url); // console.log(new_url);
loading__session_id_status = false; loading__session_id_status = false;
// goto(new_url, {replaceState: true}); // Updates the URL without reloading the page // // goto(new_url, {replaceState: true}); // Updates the URL without reloading the page
goto(new_url, {replaceState: false}); // Updates the URL history without reloading the page // goto(new_url, {replaceState: false}); // Updates the URL history without reloading the page
}); });
}, hover_timer_wait); }, hover_timer_wait);
}} }}
@@ -122,9 +130,9 @@ let hover_timer: any = $state(null);
let new_url = data_url.toString(); let new_url = data_url.toString();
console.log(new_url); console.log(new_url);
loading__session_id_status = false;
// goto(new_url, {replaceState: true}); // Updates the URL without reloading the page // goto(new_url, {replaceState: true}); // Updates the URL without reloading the page
goto(new_url, {replaceState: false}); // Updates the URL history without reloading the page goto(new_url, {replaceState: false}); // Updates the URL history without reloading the page
loading__session_id_status = 'loading';
// $events_slct.event_session_id = event_session_obj?.id; // $events_slct.event_session_id = event_session_obj?.id;
$events_slct.event_session_obj = event_session_obj; $events_slct.event_session_obj = event_session_obj;
@@ -158,8 +166,11 @@ let hover_timer: any = $state(null);
btn btn-sm hover:preset-filled-primary-500 btn btn-sm hover:preset-filled-primary-500
overflow-hidden overflow-hidden
text-sm text-sm
w-full max-w-full w-full
text-left text-left
m-0
p-0
rounded-md rounded-md
flex flex-row items-center justify-start flex flex-row items-center justify-start
transition-all transition-all
@@ -175,7 +186,7 @@ let hover_timer: any = $state(null);
> >
<span <span
class="border-r border-surface-400-600 pr-1 w-28 max-w-28" class="border-r border-surface-400-600 pr-1 min-w-28"
> >
{#if $events_slct.event_session_id === event_session_obj?.id} {#if $events_slct.event_session_id === event_session_obj?.id}
<span class="fas fa-calendar-check"></span> <span class="fas fa-calendar-check"></span>