Skip to content
Snippets Groups Projects
Verified Commit 2544498c authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Enable copying object to source folder

#15
parent b11365cf
No related branches found
No related tags found
1 merge request!12Add direct S3 interaction
...@@ -4,8 +4,7 @@ import { CopyObjectCommand } from "@aws-sdk/client-s3"; ...@@ -4,8 +4,7 @@ import { CopyObjectCommand } from "@aws-sdk/client-s3";
import BootstrapModal from "@/components/Modals/BootstrapModal.vue"; import BootstrapModal from "@/components/Modals/BootstrapModal.vue";
import type { BucketOut } from "@/client"; import type { BucketOut } from "@/client";
import { Modal, Toast } from "bootstrap"; import { Modal, Toast } from "bootstrap";
import { onMounted, reactive, watch, computed } from "vue"; import { onMounted, reactive, watch } from "vue";
import type { ComputedRef } from "vue";
const props = defineProps<{ const props = defineProps<{
modalID: string; modalID: string;
...@@ -31,15 +30,9 @@ let copyModal: Modal | null = null; ...@@ -31,15 +30,9 @@ let copyModal: Modal | null = null;
let successToast: Toast | null = null; let successToast: Toast | null = null;
let errorToast: Toast | null = null; let errorToast: Toast | null = null;
const sourceFilteredBuckets: ComputedRef<BucketOut[]> = computed(() => {
return props.availableBuckets.filter(
(bucket) => bucket.name !== props.sourceBucketName
);
});
function getFileName(key: string): string { function getFileName(key: string): string {
const spliitedKey = key.split("/"); const splittedKey = key.split("/");
return spliitedKey[spliitedKey.length - 1]; return splittedKey[splittedKey.length - 1];
} }
function copyObject() { function copyObject() {
...@@ -159,7 +152,7 @@ onMounted(() => { ...@@ -159,7 +152,7 @@ onMounted(() => {
> >
<option disabled selected>Select one...</option> <option disabled selected>Select one...</option>
<option <option
v-for="bucket in sourceFilteredBuckets" v-for="bucket in props.availableBuckets"
:key="bucket.name" :key="bucket.name"
:value="bucket.name" :value="bucket.name"
> >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment