Loading client/src/components/Upload/DefaultBoxORNL.vue +7 −2 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ const uploadCompleted = ref(0); const uploadFile = ref(null); const uploadItems = ref({}); const uploadSize = ref(0); const queue = ref(createUploadQueue()); const counterNonRunning = computed(() => counterAnnounce.value + counterSuccess.value + counterError.value); const enableBuild = computed( Loading @@ -106,7 +107,7 @@ const listExtensions = computed(() => props.effectiveExtensions.filter((ext) => const showHelper = computed(() => Object.keys(uploadItems.value).length === 0); const uploadValues = computed(() => Object.values(uploadItems.value)); const queue = computed(() => createUploadQueue()); function createUploadQueue() { return new UploadQueue({ Loading @@ -115,7 +116,6 @@ function createUploadQueue() { complete: eventComplete, error: eventError, get: (index) => uploadItems.value[index], historyId: historyId.value, multiple: props.multiple, progress: eventProgress, success: eventSuccess, Loading Loading @@ -312,6 +312,11 @@ function eventStart() { uploadValues.value.forEach((model) => { if (model.status === "init") { model.status = "queued"; if (!model.targetHistoryId) { // Associate with current history once upload starts // This will not change if the current history is changed during upload model.targetHistoryId = historyId.value; } uploadSize.value += model.fileSize; } }); Loading client/src/components/Upload/UploadContainerORNL.vue +13 −3 Original line number Diff line number Diff line <script setup> import { BTab, BTabs } from "bootstrap-vue"; import { BAlert, BTab, BTabs } from "bootstrap-vue"; import { getDatatypesMapper } from "components/Datatypes"; import LoadingSpan from "components/LoadingSpan"; import { AUTO_EXTENSION, DEFAULT_DBKEY, Loading @@ -13,6 +12,8 @@ import { import { storeToRefs } from "pinia"; import { computed, onMounted, ref } from "vue"; import { canMutateHistory } from "@/api"; import { useHistoryStore } from "@/stores/historyStore"; import { useUploadStore } from "@/stores/uploadStore"; import { uploadPayload } from "@/utils/upload-payload.js"; Loading Loading @@ -83,6 +84,8 @@ const regular = ref(null); const { percentage, status } = storeToRefs(useUploadStore()); const { currentHistory } = storeToRefs(useHistoryStore()); const effectiveExtensions = computed(() => { if (props.formats === null || !datatypesMapperReady.value) { return listExtensions.value; Loading @@ -107,6 +110,7 @@ const historyAvailable = computed(() => Boolean(props.currentHistoryId)); const ready = computed( () => dbKeysSet.value && extensionsSet.value && historyAvailable.value && datatypesMapperReady.value ); const canUploadToHistory = computed(() => currentHistory.value && canMutateHistory(currentHistory.value)); const showCollection = computed(() => !props.formats && props.multiple); // const showComposite = computed(() => !props.formats || hasCompositeExtension); const showComposite = false; Loading Loading @@ -163,7 +167,13 @@ defineExpose({ </script> <template> <BTabs v-if="ready"> <BAlert v-if="!canUploadToHistory" variant="warning" show> <span v-localize> The current history is immutable and you cannot upload data to it. Please select a different history or create a new one. </span> </BAlert> <BTabs v-else-if="ready"> <BTab v-if="showRegular" id="regular" title="Regular" button-id="tab-title-link-regular"> <DefaultBoxORNL ref="regular" Loading Loading
client/src/components/Upload/DefaultBoxORNL.vue +7 −2 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ const uploadCompleted = ref(0); const uploadFile = ref(null); const uploadItems = ref({}); const uploadSize = ref(0); const queue = ref(createUploadQueue()); const counterNonRunning = computed(() => counterAnnounce.value + counterSuccess.value + counterError.value); const enableBuild = computed( Loading @@ -106,7 +107,7 @@ const listExtensions = computed(() => props.effectiveExtensions.filter((ext) => const showHelper = computed(() => Object.keys(uploadItems.value).length === 0); const uploadValues = computed(() => Object.values(uploadItems.value)); const queue = computed(() => createUploadQueue()); function createUploadQueue() { return new UploadQueue({ Loading @@ -115,7 +116,6 @@ function createUploadQueue() { complete: eventComplete, error: eventError, get: (index) => uploadItems.value[index], historyId: historyId.value, multiple: props.multiple, progress: eventProgress, success: eventSuccess, Loading Loading @@ -312,6 +312,11 @@ function eventStart() { uploadValues.value.forEach((model) => { if (model.status === "init") { model.status = "queued"; if (!model.targetHistoryId) { // Associate with current history once upload starts // This will not change if the current history is changed during upload model.targetHistoryId = historyId.value; } uploadSize.value += model.fileSize; } }); Loading
client/src/components/Upload/UploadContainerORNL.vue +13 −3 Original line number Diff line number Diff line <script setup> import { BTab, BTabs } from "bootstrap-vue"; import { BAlert, BTab, BTabs } from "bootstrap-vue"; import { getDatatypesMapper } from "components/Datatypes"; import LoadingSpan from "components/LoadingSpan"; import { AUTO_EXTENSION, DEFAULT_DBKEY, Loading @@ -13,6 +12,8 @@ import { import { storeToRefs } from "pinia"; import { computed, onMounted, ref } from "vue"; import { canMutateHistory } from "@/api"; import { useHistoryStore } from "@/stores/historyStore"; import { useUploadStore } from "@/stores/uploadStore"; import { uploadPayload } from "@/utils/upload-payload.js"; Loading Loading @@ -83,6 +84,8 @@ const regular = ref(null); const { percentage, status } = storeToRefs(useUploadStore()); const { currentHistory } = storeToRefs(useHistoryStore()); const effectiveExtensions = computed(() => { if (props.formats === null || !datatypesMapperReady.value) { return listExtensions.value; Loading @@ -107,6 +110,7 @@ const historyAvailable = computed(() => Boolean(props.currentHistoryId)); const ready = computed( () => dbKeysSet.value && extensionsSet.value && historyAvailable.value && datatypesMapperReady.value ); const canUploadToHistory = computed(() => currentHistory.value && canMutateHistory(currentHistory.value)); const showCollection = computed(() => !props.formats && props.multiple); // const showComposite = computed(() => !props.formats || hasCompositeExtension); const showComposite = false; Loading Loading @@ -163,7 +167,13 @@ defineExpose({ </script> <template> <BTabs v-if="ready"> <BAlert v-if="!canUploadToHistory" variant="warning" show> <span v-localize> The current history is immutable and you cannot upload data to it. Please select a different history or create a new one. </span> </BAlert> <BTabs v-else-if="ready"> <BTab v-if="showRegular" id="regular" title="Regular" button-id="tab-title-link-regular"> <DefaultBoxORNL ref="regular" Loading