Skip to content
Snippets Groups Projects

Add direct S3 interaction

Merged Daniel Göbel requested to merge feature/s3-interaction into development
2 files
+ 92
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 70
0
 
<script setup lang="ts">
 
import BootstrapModal from "@/components/Modals/BootstrapModal.vue";
 
import type { S3ObjectMetaInformation } from "@/client";
 
import dayjs from "dayjs";
 
import fileSize from "filesize";
 
 
const props = defineProps<{
 
modalID: string;
 
modalLabel: string;
 
s3Object: S3ObjectMetaInformation;
 
}>();
 
</script>
 
 
<template>
 
<bootstrap-modal
 
:modalID="modalID"
 
:static-backdrop="true"
 
:modal-label="modalLabel"
 
>
 
<template v-slot:header>
 
<h4>Object Details</h4>
 
</template>
 
<template v-slot:body>
 
<div class="container-fluid">
 
<table class="table table-hover table-sm table-borderless">
 
<tbody>
 
<tr>
 
<th scope="row" class="col-4">Bucket</th>
 
<td class="col-8">{{ props.s3Object.bucket }}</td>
 
</tr>
 
<tr>
 
<th scope="row">Name</th>
 
<td>{{ props.s3Object.key }}</td>
 
</tr>
 
<tr>
 
<th scope="row">Content Type</th>
 
<td>text/plain</td>
 
</tr>
 
<tr>
 
<th scope="row">Timestamp</th>
 
<td>
 
{{
 
dayjs(props.s3Object.last_modified).format(
 
"YYYY-MM-DD HH:mm:ss"
 
)
 
}}
 
</td>
 
</tr>
 
<tr>
 
<th scope="row">Size</th>
 
<td>{{ fileSize(props.s3Object.size) }}</td>
 
</tr>
 
</tbody>
 
</table>
 
</div>
 
</template>
 
<template v-slot:footer>
 
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
 
Close
 
</button>
 
</template>
 
</bootstrap-modal>
 
</template>
 
 
<style scoped>
 
th {
 
font-weight: bold;
 
text-align: end;
 
}
 
</style>
Loading