Now with upload and download percent! Also better editing for session POC.

This commit is contained in:
Scott Idem
2024-06-21 12:25:36 -04:00
parent fd114bce22
commit 2552e1a839
11 changed files with 433 additions and 64 deletions

View File

@@ -87,6 +87,8 @@ export let post_object = async function post_object(
try {
window.postMessage({
type: 'api_post_json_form',
status: 'uploading',
task_id: task_id,
endpoint: endpoint,
size_total: progressEvent.total,
size_loaded: progressEvent.loaded,
@@ -104,6 +106,24 @@ export let post_object = async function post_object(
)
.then(function (response) {
console.log('POST Response Data:', response.data);
try {
window.postMessage({
type: 'api_post_json_form',
status: 'complete',
task_id: task_id,
endpoint: endpoint,
size_total: 0,
size_loaded: 0,
percent_completed: 100,
progress: 100,
rate: 0,
},
'*'
);
} catch (error) {
console.log('Error posting message to window:', error);
}
if (response.data['data'].result === null) {
// This should mean that the request was successful, but a result of None/null was returned from Aether API.
// console.log('Returning null after POST');