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

Merge branch 'feature/21-additional-meta-data' into 'development'

Display additional meta data in UI

Closes #21

See merge request denbi/object-storage-access-ui!16
parents 892f4b1a cd88c818
No related branches found
No related tags found
2 merge requests!22Version 1.0.0,!16Display additional meta data in UI
...@@ -22,5 +22,13 @@ export type BucketOut = { ...@@ -22,5 +22,13 @@ export type BucketOut = {
* UID of the owner * UID of the owner
*/ */
owner: string; owner: string;
/**
* Number of Objects in this bucket
*/
num_objects: number;
/**
* Total size of objects in this bucket in bytes
*/
size: number;
}; };
...@@ -14,6 +14,10 @@ export type S3ObjectMetaInformation = { ...@@ -14,6 +14,10 @@ export type S3ObjectMetaInformation = {
* Name of the Bucket in which the object is * Name of the Bucket in which the object is
*/ */
bucket: string; bucket: string;
/**
* MIME type of the object
*/
content_type: string;
/** /**
* Size of the object in Bytes * Size of the object in Bytes
*/ */
......
...@@ -110,11 +110,11 @@ onMounted(() => { ...@@ -110,11 +110,11 @@ onMounted(() => {
</tr> </tr>
<tr> <tr>
<th scope="row" class="fw-bold">Objects:</th> <th scope="row" class="fw-bold">Objects:</th>
<td>0</td> <td>{{ bucket.num_objects }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row" class="fw-bold">Size:</th> <th scope="row" class="fw-bold">Size:</th>
<td>{{ filesize(0) }}</td> <td>{{ filesize(bucket.size) }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
...@@ -138,12 +138,14 @@ const objectState = reactive({ ...@@ -138,12 +138,14 @@ const objectState = reactive({
size: 0, size: 0,
bucket: "", bucket: "",
last_modified: "2022-01-01", last_modified: "2022-01-01",
content_type: "text/plain",
}, },
viewDetailObject: { viewDetailObject: {
key: "", key: "",
size: 0, size: 0,
bucket: "", bucket: "",
last_modified: "2022-01-01", last_modified: "2022-01-01",
content_type: "text/plain",
}, },
} as { } as {
objects: S3ObjectMetaInformation[]; objects: S3ObjectMetaInformation[];
......
...@@ -57,6 +57,7 @@ function copyObject() { ...@@ -57,6 +57,7 @@ function copyObject() {
bucket: formState.destBucket, bucket: formState.destBucket,
size: props.sourceObject.size, size: props.sourceObject.size,
last_modified: dayjs().toISOString(), last_modified: dayjs().toISOString(),
content_type: props.sourceObject.content_type,
}); });
copyModal?.hide(); copyModal?.hide();
successToast?.show(); successToast?.show();
......
...@@ -59,6 +59,7 @@ function uploadFolder() { ...@@ -59,6 +59,7 @@ function uploadFolder() {
bucket: props.bucketName, bucket: props.bucketName,
size: 0, size: 0,
last_modified: dayjs().toISOString(), last_modified: dayjs().toISOString(),
content_type: "text/plain",
}); });
formState.folderName = ""; formState.folderName = "";
}) })
......
...@@ -34,7 +34,7 @@ const props = defineProps<{ ...@@ -34,7 +34,7 @@ const props = defineProps<{
</tr> </tr>
<tr> <tr>
<th scope="row">Content Type</th> <th scope="row">Content Type</th>
<td>text/plain</td> <td>{{ props.s3Object.content_type }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">Timestamp</th> <th scope="row">Timestamp</th>
......
...@@ -95,6 +95,7 @@ async function uploadObject() { ...@@ -95,6 +95,7 @@ async function uploadObject() {
bucket: props.bucketName, bucket: props.bucketName,
size: formState.file?.size ?? 0, size: formState.file?.size ?? 0,
last_modified: dayjs().toISOString(), last_modified: dayjs().toISOString(),
content_type: formState.file?.type ?? "text/plain",
}); });
formState.key = ""; formState.key = "";
( (
......
...@@ -193,7 +193,14 @@ onMounted(() => { ...@@ -193,7 +193,14 @@ onMounted(() => {
:active="false" :active="false"
:loading="true" :loading="true"
:permission="undefined" :permission="undefined"
:bucket="{ name: '', description: '', created_at: '', owner: '' }" :bucket="{
name: '',
description: '',
created_at: '',
owner: '',
size: 0,
num_objects: 0,
}"
></bucket-list-item> ></bucket-list-item>
</div> </div>
</div> </div>
......
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