Work on reports for LCI

This commit is contained in:
Scott Idem
2025-09-08 17:12:44 -04:00
parent 88c4f4e891
commit 438d366b98
3 changed files with 126 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "osit-aether-app-svelte", "name": "osit-aether-app-svelte",
"version": "3.0.6", "version": "3.1.0",
"description": "One Sky IT's Aether App created with Svelte, SvelteKit, Tailwind CSS, Lucide, Font Awesome, and Skeleton UI. -Scott Idem", "description": "One Sky IT's Aether App created with Svelte, SvelteKit, Tailwind CSS, Lucide, Font Awesome, and Skeleton UI. -Scott Idem",
"homepage": "https://oneskyit.com/", "homepage": "https://oneskyit.com/",
"private": true, "private": true,

View File

@@ -384,6 +384,7 @@ export async function qry__event_file(
event_id, event_id,
qry_created_on = null, // Example greater than: '2024-10-24' qry_created_on = null, // Example greater than: '2024-10-24'
qry_min_file_size = null, qry_min_file_size = null,
qry_file_purpose = null,
enabled = 'enabled', enabled = 'enabled',
hidden = 'not_hidden', hidden = 'not_hidden',
limit = 50, limit = 50,
@@ -397,6 +398,7 @@ export async function qry__event_file(
event_id: any, event_id: any,
qry_created_on?: null|string, qry_created_on?: null|string,
qry_min_file_size?: null|number, qry_min_file_size?: null|number,
qry_file_purpose?: null|string,
enabled?: string, enabled?: string,
hidden?: string, hidden?: string,
limit?: number, limit?: number,
@@ -427,7 +429,7 @@ export async function qry__event_file(
} }
if (qry_min_file_size) { if (qry_min_file_size) {
console.log('qry_min_file_size:', qry_min_file_size); // console.log('qry_min_file_size:', qry_min_file_size);
let qry_param = let qry_param =
{ {
type: "AND", type: "AND",
@@ -438,6 +440,21 @@ export async function qry__event_file(
params_json['qry'].push(qry_param); params_json['qry'].push(qry_param);
} }
if (qry_file_purpose) {
let qry_param =
{
type: "AND",
field: "file_purpose",
operator: "=",
value: qry_file_purpose
};
params_json['qry'].push(qry_param);
}
if (log_lvl) {
console.log('params_json:', params_json);
}
ae_promises.load__event_file_obj_li = await api.get_ae_obj_li_for_obj_id_crud_v2({ ae_promises.load__event_file_obj_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
api_cfg: api_cfg, api_cfg: api_cfg,
obj_type: 'event_file', obj_type: 'event_file',

View File

@@ -94,11 +94,13 @@ if ($events_loc.pres_mgmt.show_report == 'sessions_poc_agree') {
} else if ($events_loc.pres_mgmt.show_report == 'recent_files') { } else if ($events_loc.pres_mgmt.show_report == 'recent_files') {
handle_qry__event_file({ handle_qry__event_file({
created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0, created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0,
file_purpose: $events_loc.pres_mgmt.qry__files_purpose ?? null,
log_lvl: 0, log_lvl: 0,
}); });
} else if ($events_loc.pres_mgmt.show_report == 'large_files') { } else if ($events_loc.pres_mgmt.show_report == 'large_files') {
handle_qry__event_file({ handle_qry__event_file({
min_file_size: $events_loc.pres_mgmt.qry__files_min_size ?? 100000000, // in bytes min_file_size: $events_loc.pres_mgmt.qry__files_min_size ?? 100000000, // in bytes
file_purpose: $events_loc.pres_mgmt.qry__files_purpose ?? null,
log_lvl: log_lvl, log_lvl: log_lvl,
}); });
} }
@@ -117,6 +119,7 @@ async function handle_qry__event_file(
{ {
created_on_offset = null, created_on_offset = null,
min_file_size = null, // in bytes min_file_size = null, // in bytes
file_purpose = null,
ft_search_str = '', ft_search_str = '',
lk_search_str = '', lk_search_str = '',
try_cache = true, try_cache = true,
@@ -124,6 +127,7 @@ async function handle_qry__event_file(
}: { }: {
created_on_offset?: null|number, created_on_offset?: null|number,
min_file_size?: null|number, min_file_size?: null|number,
file_purpose?: null|string,
ft_search_str?: string, ft_search_str?: string,
lk_search_str?: string, lk_search_str?: string,
try_cache?: boolean, try_cache?: boolean,
@@ -185,6 +189,7 @@ async function handle_qry__event_file(
event_id: $events_slct.event_id, event_id: $events_slct.event_id,
qry_created_on: created_on_str, qry_created_on: created_on_str,
qry_min_file_size: min_file_size, qry_min_file_size: min_file_size,
qry_file_purpose: file_purpose,
// fulltext_search_qry_str: ft_search_str, // fulltext_search_qry_str: ft_search_str,
// like_search_qry_str: lk_search_str, // like_search_qry_str: lk_search_str,
// external_event_id: $events_loc.pres_mgmt.default__external_registration_id, // external_event_id: $events_loc.pres_mgmt.default__external_registration_id,
@@ -1038,11 +1043,19 @@ async function handle_qry__event_session(
<!-- Show recently uploaded files --> <!-- Show recently uploaded files -->
{#if $events_loc.pres_mgmt.show_report == 'recent_files' && event_file_id_random_li} {#if $events_loc.pres_mgmt.show_report == 'recent_files' && event_file_id_random_li}
<h3 class="h4 text-center"> <header class="w-full flex flex-row flex-wrap items-center justify-center gap-1">
Recent File Uploads <h3 class="h4 text-center">
Recent File Uploads
</h3>
{#if $events_sess.pres_mgmt.status_rpt[$events_sess.pres_mgmt?.show_report] == 'loading'}
<span class="fas fa-spinner fa-spin m-1"></span>
<span>Loading...</span>
{/if}
<!-- Show list of offsets: 10 minutes, 1 hours, 6 hours, 12 hours, 24 hours, 48 hours, 72 hours --> <!-- Show list of offsets: 10 minutes, 1 hours, 6 hours, 12 hours, 24 hours, 48 hours, 72 hours -->
<div class="flex flex-row items-center justify-center">
<select <select
class="inline-block select text-sm w-28 m-1 ae_btn_info" class="inline-block select text-sm p-1 w-40 m-1 ae_btn_info"
bind:value={$events_loc.pres_mgmt.qry__files_offset_seconds} bind:value={$events_loc.pres_mgmt.qry__files_offset_seconds}
onchange={() => { onchange={() => {
if ($events_loc.pres_mgmt?.qry__files_offset_seconds) { if ($events_loc.pres_mgmt?.qry__files_offset_seconds) {
@@ -1053,6 +1066,7 @@ async function handle_qry__event_session(
// created_on.setSeconds(created_on.getSeconds() - offset); // created_on.setSeconds(created_on.getSeconds() - offset);
handle_qry__event_file({ handle_qry__event_file({
created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0, created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0,
file_purpose: $events_loc.pres_mgmt.qry__file_purpose ?? null,
log_lvl: 1, log_lvl: 1,
}); });
} else { } else {
@@ -1065,7 +1079,7 @@ async function handle_qry__event_session(
$events_loc.pres_mgmt.show_report = 'recent_files'; $events_loc.pres_mgmt.show_report = 'recent_files';
}} }}
> >
<option value="">-- not set --</option> <option value="">-- offset not set --</option>
<option value="600">10 minutes</option> <option value="600">10 minutes</option>
<option value="1800">30 minutes</option> <option value="1800">30 minutes</option>
<option value="3600">1 hour</option> <option value="3600">1 hour</option>
@@ -1077,8 +1091,48 @@ async function handle_qry__event_session(
<option value="172800">48 hours</option> <option value="172800">48 hours</option>
<option value="259200">72 hours</option> <option value="259200">72 hours</option>
<option value="604800">1 week</option> <option value="604800">1 week</option>
<option value="1209600">2 weeks</option>
<option value="2419200">4 weeks</option>
<option value="7776000">12 weeks</option>
<option value="15552000">24 weeks</option>
</select> </select>
</h3>
<select
id="file_purpose"
name="file_purpose"
class="inline-block select text-sm w-40 p-1 m-1 ae_btn_info"
bind:value={$events_loc.pres_mgmt.qry__file_purpose}
onchange={() => {
handle_qry__event_file({
created_on_offset: $events_loc.pres_mgmt.qry__files_offset_seconds ?? 0,
file_purpose: $events_loc.pres_mgmt.qry__file_purpose ?? null,
log_lvl: 1,
});
$events_loc.pres_mgmt.show_report = 'recent_files';
}}
>
<option
value={null}
selected={!$events_loc.pres_mgmt.qry__file_purpose}
class="text-xs"
>
-- purpose not set --
</option>
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv) as [key, file_purpose_option]}
<option
value={key} selected={$events_loc.pres_mgmt.qry__file_purpose === key}
disabled={file_purpose_option?.disabled}
class:hidden={file_purpose_option?.hidden}
>
{file_purpose_option?.name}
</option>
{/each}
{/if}
</select>
</div>
</header>
<!-- <p class="text-center text-red-500 font-bold"> <!-- <p class="text-center text-red-500 font-bold">
This report is new and still being tested. This report is new and still being tested.
@@ -1098,10 +1152,18 @@ async function handle_qry__event_session(
<!-- Show large files --> <!-- Show large files -->
{#if $events_loc.pres_mgmt.show_report == 'large_files' && event_file_id_random_li} {#if $events_loc.pres_mgmt.show_report == 'large_files' && event_file_id_random_li}
<h3 class="h4 text-center"> <header class="w-full flex flex-row flex-wrap items-center justify-center gap-1">
Large File Uploads <h3 class="h4 text-center">
Large File Uploads
</h3>
{#if $events_sess.pres_mgmt.status_rpt[$events_sess.pres_mgmt?.show_report] == 'loading'}
<span class="fas fa-spinner fa-spin m-1"></span>
<span>Loading...</span>
{/if}
<div class="flex flex-row items-center justify-center">
<select <select
class="inline-block select text-sm w-28 m-1 ae_btn_info" class="inline-block select text-sm w-40 p-1 m-1 ae_btn_info"
bind:value={$events_loc.pres_mgmt.qry__files_min_size} bind:value={$events_loc.pres_mgmt.qry__files_min_size}
onchange={() => { onchange={() => {
handle_qry__event_file({ handle_qry__event_file({
@@ -1122,7 +1184,43 @@ async function handle_qry__event_session(
<option value="1000000000">1 GB</option> <option value="1000000000">1 GB</option>
<!-- <option value="5000000000">5 GB</option> --> <!-- <option value="5000000000">5 GB</option> -->
</select> </select>
</h3>
<select
id="file_purpose"
name="file_purpose"
class="inline-block select text-sm w-40 p-1 m-1 ae_btn_info"
bind:value={$events_loc.pres_mgmt.qry__file_purpose}
onchange={() => {
handle_qry__event_file({
min_file_size: $events_loc.pres_mgmt.qry__files_min_size ?? 100000000, // in bytes
file_purpose: $events_loc.pres_mgmt.qry__file_purpose ?? null,
log_lvl: 1,
});
$events_loc.pres_mgmt.show_report = 'recent_files';
}}
>
<option
value={null}
selected={!$events_loc.pres_mgmt.qry__file_purpose}
class="text-xs"
>
-- purpose not set --
</option>
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv) as [key, file_purpose_option]}
<option
value={key} selected={$events_loc.pres_mgmt.qry__file_purpose === key}
disabled={file_purpose_option?.disabled}
class:hidden={file_purpose_option?.hidden}
>
{file_purpose_option?.name}
</option>
{/each}
{/if}
</select>
</div>
</header>
<Comp_event_file_obj_tbl <Comp_event_file_obj_tbl
bind:event_file_id_random_li={event_file_id_random_li} bind:event_file_id_random_li={event_file_id_random_li}