Work on reports for LCI
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"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",
|
||||
"homepage": "https://oneskyit.com/",
|
||||
"private": true,
|
||||
|
||||
@@ -384,6 +384,7 @@ export async function qry__event_file(
|
||||
event_id,
|
||||
qry_created_on = null, // Example greater than: '2024-10-24'
|
||||
qry_min_file_size = null,
|
||||
qry_file_purpose = null,
|
||||
enabled = 'enabled',
|
||||
hidden = 'not_hidden',
|
||||
limit = 50,
|
||||
@@ -397,6 +398,7 @@ export async function qry__event_file(
|
||||
event_id: any,
|
||||
qry_created_on?: null|string,
|
||||
qry_min_file_size?: null|number,
|
||||
qry_file_purpose?: null|string,
|
||||
enabled?: string,
|
||||
hidden?: string,
|
||||
limit?: number,
|
||||
@@ -427,7 +429,7 @@ export async function qry__event_file(
|
||||
}
|
||||
|
||||
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 =
|
||||
{
|
||||
type: "AND",
|
||||
@@ -438,6 +440,21 @@ export async function qry__event_file(
|
||||
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({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_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') {
|
||||
handle_qry__event_file({
|
||||
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,
|
||||
});
|
||||
} else if ($events_loc.pres_mgmt.show_report == 'large_files') {
|
||||
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__files_purpose ?? null,
|
||||
log_lvl: log_lvl,
|
||||
});
|
||||
}
|
||||
@@ -117,6 +119,7 @@ async function handle_qry__event_file(
|
||||
{
|
||||
created_on_offset = null,
|
||||
min_file_size = null, // in bytes
|
||||
file_purpose = null,
|
||||
ft_search_str = '',
|
||||
lk_search_str = '',
|
||||
try_cache = true,
|
||||
@@ -124,6 +127,7 @@ async function handle_qry__event_file(
|
||||
}: {
|
||||
created_on_offset?: null|number,
|
||||
min_file_size?: null|number,
|
||||
file_purpose?: null|string,
|
||||
ft_search_str?: string,
|
||||
lk_search_str?: string,
|
||||
try_cache?: boolean,
|
||||
@@ -185,6 +189,7 @@ async function handle_qry__event_file(
|
||||
event_id: $events_slct.event_id,
|
||||
qry_created_on: created_on_str,
|
||||
qry_min_file_size: min_file_size,
|
||||
qry_file_purpose: file_purpose,
|
||||
// fulltext_search_qry_str: ft_search_str,
|
||||
// like_search_qry_str: lk_search_str,
|
||||
// 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 -->
|
||||
{#if $events_loc.pres_mgmt.show_report == 'recent_files' && event_file_id_random_li}
|
||||
<h3 class="h4 text-center">
|
||||
Recent File Uploads
|
||||
<header class="w-full flex flex-row flex-wrap items-center justify-center gap-1">
|
||||
<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 -->
|
||||
<div class="flex flex-row items-center justify-center">
|
||||
<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}
|
||||
onchange={() => {
|
||||
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);
|
||||
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,
|
||||
});
|
||||
} else {
|
||||
@@ -1065,7 +1079,7 @@ async function handle_qry__event_session(
|
||||
$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="1800">30 minutes</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="259200">72 hours</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>
|
||||
</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">
|
||||
This report is new and still being tested.
|
||||
@@ -1098,10 +1152,18 @@ async function handle_qry__event_session(
|
||||
|
||||
<!-- Show large files -->
|
||||
{#if $events_loc.pres_mgmt.show_report == 'large_files' && event_file_id_random_li}
|
||||
<h3 class="h4 text-center">
|
||||
Large File Uploads
|
||||
<header class="w-full flex flex-row flex-wrap items-center justify-center gap-1">
|
||||
<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
|
||||
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}
|
||||
onchange={() => {
|
||||
handle_qry__event_file({
|
||||
@@ -1122,7 +1184,43 @@ async function handle_qry__event_session(
|
||||
<option value="1000000000">1 GB</option>
|
||||
<!-- <option value="5000000000">5 GB</option> -->
|
||||
</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
|
||||
bind:event_file_id_random_li={event_file_id_random_li}
|
||||
|
||||
Reference in New Issue
Block a user