🎉 Init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div v-if="loading" class="h-40 animate-pulse rounded-md bg-surface-raised" />
|
||||
<pre v-else class="whitespace-pre-wrap break-words font-mono text-xs text-text">{{ text }}</pre>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
const payload = usePopup().require<{ bucket: string; key: string }>().payload!
|
||||
const { getObjectText } = useS3Client()
|
||||
|
||||
const loading = ref(true)
|
||||
const text = ref('')
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
text.value = await getObjectText(payload.bucket, payload.key)
|
||||
}
|
||||
catch {
|
||||
text.value = 'Datei konnte nicht geladen werden.'
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user