diff --git a/src/lib/ae_events_stores.ts b/src/lib/ae_events_stores.ts index 68f85f80..baf9956e 100644 --- a/src/lib/ae_events_stores.ts +++ b/src/lib/ae_events_stores.ts @@ -172,6 +172,8 @@ let events_local_data_struct: key_val = { show_content__session_help: true, show_content__session_search_help: true, show_content__presenter_page_help: true, + show_content__presenter_view: null, + show_content__session_view: null, show_menu__session: null, diff --git a/src/lib/ae_string_snippets.ts b/src/lib/ae_string_snippets.ts index 08b70a56..6f7e1c4a 100644 --- a/src/lib/ae_string_snippets.ts +++ b/src/lib/ae_string_snippets.ts @@ -18,7 +18,8 @@ string_snippets['classes__core_menu__button_warning'] = 'btn btn-sm mx-1 variant // string_snippets['classes__events_pres_mgmt_menu'] = 'flex flex-col items-center space-y-1 border border-blue-200 rounded-md py-1 px-2 hover:bg-blue-100 transition-all duration-700 hover:duration-300'; string_snippets['classes__events_pres_mgmt_menu'] = 'w-full flex flex-col items-center gap-1 border border-gray-200 rounded-md p-1 hover:bg-gray-100 transition-all duration-700 hover:duration-300'; -string_snippets['classes__events_pres_mgmt_menu__button'] = 'btn btn-sm mx-1 variant-soft-tertiary text-info-300 hover:text-info-800'; +string_snippets['classes__events_pres_mgmt_menu__button'] = 'btn btn-sm mx-1 variant-soft-tertiary text-info-300 hover:text-info-800 hover:variant-filled-tertiary'; +string_snippets['classes__events_pres_mgmt_menu__button_special'] = 'btn btn-sm mx-1 variant-ghost-tertiary text-info-300 hover:text-info-800 hover:variant-filled-tertiary'; string_snippets['classes__events_pres_mgmt_menu__button_highlight'] = 'btn btn-sm mx-1 variant-filled-tertiary text-info-300 hover:text-info-800'; string_snippets['classes__events_pres_mgmt_menu__button_warning'] = 'btn btn-sm mx-1 variant-soft-warning text-info-300 hover:text-info-800'; diff --git a/src/lib/element_input_files_tbl.svelte b/src/lib/element_input_files_tbl.svelte index 662a8159..8a6a0750 100644 --- a/src/lib/element_input_files_tbl.svelte +++ b/src/lib/element_input_files_tbl.svelte @@ -7,7 +7,7 @@ import { ae_util } from '$lib/ae_utils'; import { core_func } from '$lib/ae_core_functions'; import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores'; -export let element_id = 'svelte_input_file_element'; +// export let element_id = 'svelte_input_file_element'; export let container_class_li: string[] = []; export let table_class_li: string[] = ['table', 'table-sm', 'table-striped', 'table-hover' , 'text-sm']; @@ -20,9 +20,9 @@ export let input_file_list: any = null; export let file_list_status: null|string = null; export let processed_file_list: any[] = []; -const dispatch = createEventDispatcher(); +// const dispatch = createEventDispatcher(); -let input_file_list_processed: any[] = []; +// let input_file_list_processed: any[] = []; onMount(() => { console.log('** Element Mounted: ** Element Input File'); @@ -37,22 +37,26 @@ $: if (input_file_list) { // console.log(result); if (!result || !result.length) { + processed_file_list = []; file_list_status = 'none'; } // Save the results to the file upload list to be displayed as a table. - input_file_list_processed = result; // Includes file hash + // input_file_list_processed = result; // Includes file hash - dispatch( - 'input_file_list_updated', - { - element_id: element_id, - input_file_list: input_file_list, - input_file_list_processed: result, // Includes file hash - } - ); + // dispatch( + // 'input_file_list_updated', + // { + // element_id: element_id, + // input_file_list: input_file_list, + // input_file_list_processed: result, // Includes file hash + // } + // ); }); +} else { + processed_file_list = []; + file_list_status = 'none'; } @@ -298,9 +302,9 @@ function remove_file_from_filelist(index) { {/if} - + - {#if use_selected_file_table && input_file_list_processed && input_file_list_processed.length} + {#if use_selected_file_table && processed_file_list && processed_file_list.length} Files selected for upload
| Hash | - {#each input_file_list_processed as file_list_item, file_index} + {#each processed_file_list as file_list_item, file_index}|
|---|---|
| @@ -332,9 +336,9 @@ function remove_file_from_filelist(index) { class:bg-pink-200={file_list_item.warning_size} > {file_list_item.file_size_string} - + {#if $ae_sess.api_upload_kv[file_list_item.hash_sha256]} + ({$ae_sess.api_upload_kv[file_list_item.hash_sha256].percent_completed}%) + {/if} | 0) {
task_id = link_to_id; // Ideally this should be the file hash, but we may be uploading multiple files at once. This should be done with a loop instead?
- hosted_file_results = await handle_input_upload_files(event.target[input_element_id].files, task_id);
+ // Loop through each file and upload them individually in event.target[input_element_id].files
+ // The task_id should be the file hash.
+ // processed_file_list[i] has the file hash_sha256, hash_sha256_match, warnings, uploaded, uploaded_bytes, filename, and file_size_bytes.
+ for (let i = 0; i < event.target[input_element_id].files.length; i++) {
+ let tmp_file = event.target[input_element_id].files[i];
- if (hosted_file_results) {
- console.log(`hosted_file_results:`, hosted_file_results);
- } else {
- console.log(`hosted_file_results:`, hosted_file_results);
+ task_id = $events_sess.files.processed_file_list[i].hash_sha256;
+
+ hosted_file_results = await handle_input_upload_files([tmp_file], task_id);
+
+ if (hosted_file_results) {
+ console.log(`hosted_file_results:`, hosted_file_results);
+ } else {
+ console.log(`hosted_file_results:`, hosted_file_results);
+ }
}
+ // hosted_file_results = await handle_input_upload_files(event.target[input_element_id].files, task_id);
+ $events_sess.files.processed_file_list = [];
+ $events_sess = $events_sess;
+ event.target.reset();
+ // await tick();
}
$events_sess.files.disable_submit__event_file_obj = false;
+ $events_sess.files.submit_status = 'saved';
+ submit_status = 'saved';
+ upload_complete = true;
}
@@ -154,11 +177,11 @@ async function handle_input_upload_files(input_upload_files, task_id) {
console.log(error);
return false;
})
- .finally(function (event_file_id) {
+ .finally( function () {
// $events_sess.files.files_uploading_count--;
$slct_trigger = 'load__event_file_obj_li';
- return event_file_id;
+ // return event_file_id;
});
console.log(ae_promises.upload__hosted_file_obj);
@@ -177,10 +200,22 @@ async function handle_input_upload_files(input_upload_files, task_id) {
class:hidden={!$ae_loc.trusted_access}
class="modal-form {$ae_loc.hub.classes__form} flex flex-col gap-1 items-center justify-center w-full"
>
+ {#await ae_promises.upload__hosted_file_obj}
+
+
+
+ Uploading
+ {#if $ae_sess.api_upload_kv[task_id]}
+ {$ae_sess.api_upload_kv[task_id].percent_completed}%
+ {/if}
+
+
+ {/await}
|