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

Display a new folder not as file

#58
parent b460a4ba
No related branches found
No related tags found
2 merge requests!84Remove development branch,!52Resolve "Display new folder not as file"
This commit is part of merge request !52. Comments created here will be created in the context of that merge request.
...@@ -62,7 +62,7 @@ function uploadFolder() { ...@@ -62,7 +62,7 @@ function uploadFolder() {
uploadModal?.hide(); uploadModal?.hide();
successToast?.show(); successToast?.show();
emit("folder-created", { emit("folder-created", {
key: key, key: realKey,
bucket: props.bucketName, bucket: props.bucketName,
size: 0, size: 0,
last_modified: dayjs().toISOString(), last_modified: dayjs().toISOString(),
......
...@@ -72,9 +72,7 @@ const stringInput = ref<HTMLInputElement | undefined>(undefined); ...@@ -72,9 +72,7 @@ const stringInput = ref<HTMLInputElement | undefined>(undefined);
const format = computed<string | undefined>(() => props.parameter["format"]); const format = computed<string | undefined>(() => props.parameter["format"]);
const filesInBucket = computed<string[]>(() => const filesInBucket = computed<string[]>(() =>
keysInBucket.value.filter( keysInBucket.value.filter((obj) => !obj.endsWith("/"))
(obj) => !obj.endsWith("/") && !obj.endsWith(".s3keep")
)
); );
const foldersInBucket = computed<string[]>(() => const foldersInBucket = computed<string[]>(() =>
......
...@@ -210,7 +210,7 @@ onMounted(() => { ...@@ -210,7 +210,7 @@ onMounted(() => {
role="status" role="status"
aria-hidden="true" aria-hidden="true"
></span> ></span>
Save View
</button> </button>
</template> </template>
</bootstrap-modal> </bootstrap-modal>
......
...@@ -20,16 +20,18 @@ export const useBucketStore = defineStore({ ...@@ -20,16 +20,18 @@ export const useBucketStore = defineStore({
buckets: [], buckets: [],
ownPermissions: {}, ownPermissions: {},
_lastFetchBucketPromise: undefined, _lastFetchBucketPromise: undefined,
_bla: 0, _lastFetchBucketPromiseTimestamp: 0,
} as { } as {
buckets: BucketOut[]; buckets: BucketOut[];
ownPermissions: Record<string, BucketPermissionOut>; ownPermissions: Record<string, BucketPermissionOut>;
_lastFetchBucketPromise?: CancelablePromise<never>; _lastFetchBucketPromise?: CancelablePromise<never>;
_bla: number; _lastFetchBucketPromiseTimestamp: number;
}), }),
getters: { getters: {
ownBucketsAndFullPermissions(): string[] { ownBucketsAndFullPermissions(): string[] {
const authStore = useAuthStore();
const names = this.buckets const names = this.buckets
.filter((bucket) => bucket.owner === authStore.currentUID)
.map((bucket) => bucket.name) .map((bucket) => bucket.name)
.concat( .concat(
Object.values(this.ownPermissions) Object.values(this.ownPermissions)
...@@ -153,8 +155,8 @@ export const useBucketStore = defineStore({ ...@@ -153,8 +155,8 @@ export const useBucketStore = defineStore({
* then no API call will be made and the last one reused * then no API call will be made and the last one reused
*/ */
const currentTime = new Date().getTime(); const currentTime = new Date().getTime();
if (currentTime - this._bla > 5000) { if (currentTime - this._lastFetchBucketPromiseTimestamp > 5000) {
this._bla = currentTime; this._lastFetchBucketPromiseTimestamp = currentTime;
const authStore = useAuthStore(); const authStore = useAuthStore();
if (this.buckets.length > 0) { if (this.buckets.length > 0) {
onFinally?.(); onFinally?.();
......
...@@ -3,6 +3,7 @@ import type { S3Key } from "@/client/s3proxy"; ...@@ -3,6 +3,7 @@ import type { S3Key } from "@/client/s3proxy";
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue"; import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
import DeleteModal from "@/components/modals/DeleteModal.vue"; import DeleteModal from "@/components/modals/DeleteModal.vue";
import { environment } from "../../environment";
const props = defineProps<{ const props = defineProps<{
s3key: S3Key; s3key: S3Key;
...@@ -37,6 +38,8 @@ function deleteKeyTrigger() { ...@@ -37,6 +38,8 @@ function deleteKeyTrigger() {
:back-modal-id="undefined" :back-modal-id="undefined"
@confirm-delete="deleteKeyTrigger" @confirm-delete="deleteKeyTrigger"
/> />
<h3>S3 Endpoint:</h3>
<div class="fs-4 mb-4">{{ environment.S3_URL }}</div>
<h3>Access Key:</h3> <h3>Access Key:</h3>
<div v-if="props.loading" class="placeholder-glow"> <div v-if="props.loading" class="placeholder-glow">
<span class="placeholder col-5 mt-3 mb-2 fs-4"></span><br /> <span class="placeholder col-5 mt-3 mb-2 fs-4"></span><br />
......
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