General improvements to reports

This commit is contained in:
Scott Idem
2024-07-25 11:29:59 -04:00
parent 8b53cd2b7f
commit 6b9284951e
6 changed files with 262 additions and 54 deletions

View File

@@ -292,7 +292,7 @@ let events_session_data_struct: key_val = {
qry_max__sessions: 75,
qry_max__presentations: 25,
qry_max__presenters: 75,
qry_max__files: 25,
qry_max__files: 75,
show_fields__presentation: true,
show_fields__session: true,

View File

@@ -39,6 +39,7 @@ let ae_placeholder_li: key_val = {};
let ae_promises: key_val = {};
let ae_tmp: key_val = {};
ae_tmp.show__file_li = true;
ae_tmp.show__direct_download = false;
let ae_triggers: key_val = {};
let dq__where_val: string = `${link_to_type}_id_random`;
@@ -56,22 +57,43 @@ onMount(() => {
});
</script>
<button
type="button"
on:click={() => {
console.log('*** Refresh button clicked ***');
ae_tmp.show__file_li = false;
console.log(`$lq__event_file_obj_li:`, $lq__event_file_obj_li);
$slct_trigger = 'load__event_file_obj_li';
ae_tmp.show__file_li = true;
}}
class="btn btn-sm p-1 m-1 variant-soft-tertiary hover:variant-ghost-warning float-right transition hover:transition-all"
class:hidden={display_mode != 'default' && !$ae_loc.administrator_access}
title="Refresh the list of files"
<span
class="float-right"
>
<span class="fas fa-sync-alt mx-1"></span>
Files
</button>
<button
type="button"
on:click={() => {
console.log('*** Refresh button clicked ***');
ae_tmp.show__file_li = false;
console.log(`$lq__event_file_obj_li:`, $lq__event_file_obj_li);
$slct_trigger = 'load__event_file_obj_li';
ae_tmp.show__file_li = true;
}}
class="btn btn-sm p-1 m-1 variant-soft-tertiary hover:variant-ghost-warning transition hover:transition-all *:hover:inline"
class:hidden={display_mode != 'default' && !$ae_loc.administrator_access}
title="Refresh the list of files"
>
<span class="fas fa-sync-alt mx-1"></span>
<div class="hidden">
Files
</div>
</button>
<button
type="button"
on:click={() => {
console.log('*** Show Alt Download button clicked ***');
ae_tmp.show__direct_download = !ae_tmp.show__direct_download;
}}
class="btn btn-sm p-1 m-1 variant-soft-tertiary hover:variant-ghost-warning transition hover:transition-all *:hover:inline"
title="Toggle direct download link and copy link button"
>
<span class="fas fa-download mx-1"></span>
<div class="hidden">
{ae_tmp.show__direct_download ? 'Alt On' : 'Alt Download Off'}
</div>
</button>
</span>
<section class="svelte_component event_file_uploaded_manage {container_class_li}"
class:text-sm={display_mode != 'default'}
@@ -138,7 +160,7 @@ onMount(() => {
// 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 variant-soft-primary hover:variant-filled-primary min-w-72 lg:min-w-96"
title={`Download this file: ${event_file_obj.filename} [API] -- SHA256 hash: ${event_file_obj.hash_sha256.slice(0, 10)}...`}
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]}
<span class="fas fa-spinner fa-spin mx-1"></span>
@@ -167,7 +189,29 @@ onMount(() => {
>
{event_file_obj.file_purpose}
</span>
</button>
<a
href="{$ae_api.base_url}/event/file/{event_file_obj.event_file_id_random}/download?filename={event_file_obj.filename}&x_no_account_id_token=direct-download"
class="btn btn-sm variant-soft-secondary *:hover:inline"
class:hidden={!ae_tmp.show__direct_download}
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-download mx-1"></span>
<div class="hidden">
Download
</div>
</a>
<button
type="button"
use:clipboard={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj.event_file_id_random}/download?filename=${event_file_obj.filename}&x_no_account_id_token=direct-download`)}
class="btn btn-sm variant-soft-secondary *:hover:inline"
class:hidden={!ae_tmp.show__direct_download}
title="Copy the direct download file link to the clipboard."
>
<span class="fas fa-copy mx-1"></span>
<div class="hidden">
Copy Link
</div>
</button>
{:else}
<!-- Show change filename input field here -->
@@ -388,6 +432,7 @@ onMount(() => {
Apple macOS <span class="fab fa-apple"></span>
</strong>
{/if} -->
</span>
<span>
<span

View File

@@ -3,6 +3,7 @@
import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils';
import { api } from '$lib/api';
import { clipboard } from '@skeletonlabs/skeleton';
import { liveQuery } from "dexie";
import { db_events } from "$lib/db_events";
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
@@ -42,6 +43,20 @@ let lq_kv__event_file_obj_li = liveQuery(
{#if event_file_id_random_li && $lq_kv__event_file_obj_li && $lq_kv__event_file_obj_li?.length > 0 && $lq_kv__event_file_obj_li?.length == event_file_id_random_li?.length}
<div class="overflow-auto">
<h2 class="h3">
<span class="text-md">
Results:
</span>
{#if $lq_kv__event_file_obj_li.length}
<span class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-200"
title="Count {$lq_kv__event_file_obj_li.length ?? 'None'}"
>
<span class="fas fa-list-ol mx-4"></span>
{$lq_kv__event_file_obj_li.length ?? 'None'}
</span>
{/if}
</h2>
<table
class="table-auto w-full table-striped table-hover"
>
@@ -49,9 +64,13 @@ let lq_kv__event_file_obj_li = liveQuery(
<tr>
<th class="px-4 py-2">
Filename
({$lq_kv__event_file_obj_li?.length}x)
<!-- ({$lq_kv__event_file_obj_li?.length}x) -->
</th>
<th class="px-4 py-2">
Download Link
</th>
<th class="px-4 py-2">Size</th>
<th class="px-4 py-2">Uploaded</th>
{#if show_location_fields}
<th class="px-4 py-2">Location</th>
{/if}
@@ -81,7 +100,7 @@ let lq_kv__event_file_obj_li = liveQuery(
<button
disabled={!allow_basic && !allow_moderator && !$ae_loc.trusted_access}
on:click={() => {
// 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({
api_cfg: $ae_api,
hosted_file_id: event_file_obj?.hosted_file_id_random,
@@ -127,7 +146,43 @@ let lq_kv__event_file_obj_li = liveQuery(
</button>
<!-- {event_file_obj?.filename} -->
</td>
<td class="px-4 py-2">
<a
href="{$ae_api.base_url}/event/file/{event_file_obj?.event_file_id_random}/download?filename={event_file_obj?.filename}&x_no_account_id_token=direct-download"
class="btn btn-sm variant-soft-secondary *:hover:inline"
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-download m-1"></span>
<div class="hidden">
Download
</div>
</a>
<button
type="button"
use:clipboard={encodeURI(`${$ae_api.base_url}/event/file/${event_file_obj?.event_file_id_random}/download?filename=${event_file_obj?.filename}&x_no_account_id_token=direct-download`)}
class="btn btn-sm variant-soft-secondary *:hover:inline"
title="Copy the direct download file link to the clipboard."
>
<span class="fas fa-copy m-1"></span>
<div class="hidden">
Copy Link
</div>
</button>
</td>
<td class="px-4 py-2">{ae_util.format_bytes(event_file_obj?.file_size)}</td>
<td class="px-4 py-2 text-sm">
<div>
<span>
{ae_util.iso_datetime_formatter(event_file_obj?.created_on, 'dddd')}
</span>
<span>
{ae_util.iso_datetime_formatter(event_file_obj?.created_on, 'date_long_month_day')}
</span>
</div>
<span>
{ae_util.iso_datetime_formatter(event_file_obj?.created_on, 'time_us_short')}
</span>
</td>
{#if show_location_fields}
<td class="px-4 py-2">
{#if event_file_obj?.event_location_id_random}
@@ -149,7 +204,7 @@ let lq_kv__event_file_obj_li = liveQuery(
{event_file_obj?.event_session_name}
</a>
</td>
<td class="px-4 py-2">{ae_util.iso_datetime_formatter(event_file_obj?.event_session_start_datetime, 'datetime_us_no_seconds')}</td>
<td class="px-4 py-2 text-sm">{ae_util.iso_datetime_formatter(event_file_obj?.event_session_start_datetime, 'datetime_us_no_seconds')}</td>
{/if}
{#if show_presentation_fields}
<td class="px-4 py-2">
@@ -159,7 +214,7 @@ let lq_kv__event_file_obj_li = liveQuery(
{@html ae_snip.html__not_set}
{/if}
</td>
<td class="px-4 py-2">
<td class="px-4 py-2 text-sm">
{#if event_file_obj?.event_presentation_id_random}
{ae_util.iso_datetime_formatter(event_file_obj?.event_presentation_start_datetime, 'time_us_short')}
{:else}

View File

@@ -38,48 +38,47 @@ let lq_kv__event_presenter_obj_li = liveQuery(
{#if event_presenter_id_random_li && $lq_kv__event_presenter_obj_li && $lq_kv__event_presenter_obj_li?.length > 0}
<div class="overflow-auto">
<h2 class="h3">
<span class="text-md">
Results:
</span>
{#if $lq_kv__event_presenter_obj_li.length}
<span class="text-3xl font-bold bg-success-100 px-4 border rounded-lg border-success-200"
title="Count {$lq_kv__event_presenter_obj_li.length ?? 'None'}"
>
<span class="fas fa-list-ol mx-4"></span>
{$lq_kv__event_presenter_obj_li.length ?? 'None'}
</span>
{/if}
</h2>
<table
class="table-auto w-full table-striped table-hover"
>
<thead>
<tr>
{#if show_session_fields}
<th class="px-4 py-2">
Session
({$lq_kv__event_presenter_obj_li?.length}x)
</th>
<th class="px-4 py-2">Start datetime</th>
{/if}
{#if show_presentation_fields}
<th class="px-4 py-2">Presentation</th>
<th class="px-4 py-2">Presentation time</th>
{/if}
<th class="px-4 py-2">Name</th>
<th class="px-4 py-2">Email</th>
<th class="px-4 py-2">Agree</th>
<th class="px-4 py-2">Files</th>
{#if show_session_fields}
<th class="px-4 py-2">
Session
</th>
<th class="px-4 py-2">Start datetime</th>
{/if}
{#if show_presentation_fields}
<th class="px-4 py-2">Presentation</th>
<th class="px-4 py-2">Presentation time</th>
{/if}
</tr>
</thead>
<tbody>
{#each $lq_kv__event_presenter_obj_li as event_presenter_obj}
<tr
class:dim={event_presenter_obj?.hide}>
{#if show_session_fields}
<td class="px-4 py-2">
<span class="fas fa-chalkboard-teacher"></span>
<a
href="/events_pres_mgmt/session/{event_presenter_obj?.event_session_id_random}"
class="text-blue-500 underline hover:text-blue-800"
>
{event_presenter_obj?.event_session_name}
</a>
</td>
<td class="px-4 py-2">{ae_util.iso_datetime_formatter(event_presenter_obj?.event_session_start_datetime, 'datetime_us_no_seconds')}</td>
{/if}
{#if show_presentation_fields}
<td class="px-4 py-2">{event_presenter_obj?.event_presentation_name}</td>
<td class="px-4 py-2">{ae_util.iso_datetime_formatter(event_presenter_obj?.event_presentation_start_datetime, 'time_us_short')}</td>
{/if}
<td class="px-4 py-2">
<span class="fas fa-user"></span>
<a
@@ -100,6 +99,25 @@ let lq_kv__event_presenter_obj_li = liveQuery(
</td>
<td class="px-4 py-2">{event_presenter_obj?.agree ? 'Yes' : 'No'}</td>
<td class="px-4 py-2">{event_presenter_obj?.file_count ?? '0'}</td>
{#if show_session_fields}
<td class="px-4 py-2">
<span class="fas fa-chalkboard-teacher"></span>
<a
href="/events_pres_mgmt/session/{event_presenter_obj?.event_session_id_random}"
class="text-blue-500 underline hover:text-blue-800"
>
{event_presenter_obj?.event_session_name}
</a>
</td>
<td class="px-4 py-2 text-sm">{ae_util.iso_datetime_formatter(event_presenter_obj?.event_session_start_datetime, 'datetime_us_no_seconds')}</td>
{/if}
{#if show_presentation_fields}
<td class="px-4 py-2">{event_presenter_obj?.event_presentation_name}</td>
<td class="px-4 py-2 text-sm">{ae_util.iso_datetime_formatter(event_presenter_obj?.event_presentation_start_datetime, 'time_us_short')}</td>
{/if}
</tr>
{/each}
</tbody>

View File

@@ -464,7 +464,8 @@ async function handle_search__event_presenter(
<label
class="text-sm"
for="qry_max__presenters">Max results:
<input
<!-- <input
type="number"
id="qry_max__presenters"
bind:value={$events_sess.pres_mgmt.qry_max__presenters}
@@ -486,7 +487,37 @@ async function handle_search__event_presenter(
}}
class="input max-w-16 text-sm"
placeholder="Max number of presenters to show"
> -->
<select
id="qry_max__presenters"
bind:value={$events_sess.pres_mgmt.qry_max__presenters}
on:change={() => {
handle_search__event_presenter({
api_cfg: $ae_api,
event_id: $events_slct.event_id,
agree: true,
biography: null,
ft_search_str: '',
lk_search_str: '',
params: {
'qry__enabled': 'enabled',
'qry__hidden': 'not_hidden',
'qry__limit': $events_sess.pres_mgmt.qry_max__presenters,},
try_cache: false,
log_lvl: log_lvl,
});
}}
class="select max-w-16 text-sm"
>
<option value={25}>25</option>
<option value={50}>50</option>
<option value={75}>75</option>
<option value={100}>100</option>
<option value={200}>200</option>
<option value={500}>500</option>
</select>
</label>
<Comp_event_presenter_obj_tbl
bind:event_presenter_id_random_li={event_presenter_id_random_li}
@@ -502,7 +533,8 @@ async function handle_search__event_presenter(
<label
class="text-sm"
for="qry_max__presenters">Max results:
<input
<!-- <input
type="number"
bind:value={$events_sess.pres_mgmt.qry_max__presenters}
on:change={() => {
@@ -523,7 +555,37 @@ async function handle_search__event_presenter(
}}
class="input max-w-16 text-sm"
placeholder="Max number of presenters to show"
> -->
<select
id="qry_max__presenters"
bind:value={$events_sess.pres_mgmt.qry_max__presenters}
on:change={() => {
handle_search__event_presenter({
api_cfg: $ae_api,
event_id: $events_slct.event_id,
agree: true,
biography: null,
ft_search_str: '',
lk_search_str: '',
params: {
'qry__enabled': 'enabled',
'qry__hidden': 'not_hidden',
'qry__limit': $events_sess.pres_mgmt.qry_max__presenters,},
try_cache: false,
log_lvl: log_lvl,
});
}}
class="select max-w-16 text-sm"
>
<option value={25}>25</option>
<option value={50}>50</option>
<option value={75}>75</option>
<option value={100}>100</option>
<option value={200}>200</option>
<option value={500}>500</option>
</select>
</label>
<Comp_event_presenter_obj_tbl
bind:event_presenter_id_random_li={event_presenter_id_random_li}
@@ -539,7 +601,8 @@ async function handle_search__event_presenter(
<label
class="text-sm"
for="qry_max__files">Max results:
<input
<!-- <input
type="number"
id="qry_max__files"
bind:value={$events_sess.pres_mgmt.qry_max__files}
@@ -560,7 +623,36 @@ async function handle_search__event_presenter(
}}
class="input max-w-16 text-sm"
placeholder="Max number of files to show"
> -->
<select
id="qry_max__files"
bind:value={$events_sess.pres_mgmt.qry_max__files}
on:change={() => {
handle_search__event_file({
api_cfg: $ae_api,
event_id: $events_slct.event_id,
created_on: null,
ft_search_str: '',
lk_search_str: '',
params: {
'qry__enabled': 'enabled',
'qry__hidden': 'not_hidden',
'qry__limit': $events_sess.pres_mgmt.qry_max__files,},
try_cache: false,
log_lvl: log_lvl,
});
}}
class="select max-w-16 text-sm"
>
<option value={25}>25</option>
<option value={50}>50</option>
<option value={75}>75</option>
<option value={100}>100</option>
<option value={200}>200</option>
<option value={500}>500</option>
</select>
</label>
<Comp_event_file_obj_tbl
bind:event_file_id_random_li={event_file_id_random_li}

View File

@@ -303,8 +303,6 @@ $: if ($lq__event_presenter_obj) {
<!-- Example: /events_pres_mgmt/session/Wh8UnJlbIA0?person_id=fV1dl_IJ0yY&person_pass=abc123 -->
<button
type="button"
use:clipboard={encodeURI(`${$ae_loc.url_origin}/events_pres_mgmt/session/${$lq__event_presenter_obj.event_session_id_random}?person_id=${$lq__event_presenter_obj.person_id_random}&person_pass=${$lq__event_presenter_obj.person_passcode}&presentation_id=${$lq__event_presenter_obj.event_presentation_id_random}&presenter_id=${$lq__event_presenter_obj.event_presenter_id_random}`)}
class="btn btn-sm variant-ghost-warning float-right m-1"
title="Copy the presenter access link to the clipboard."