dont use [...path] routing since it breaks building statically
This commit is contained in:
37
frontend/pages/warrens/files.vue
Normal file
37
frontend/pages/warrens/files.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import DirectoryListContextMenu from '~/components/DirectoryListContextMenu.vue';
|
||||
import RenameEntryDialog from '~/components/actions/RenameEntryDialog.vue';
|
||||
import { getWarrenDirectory } from '~/lib/api/warrens';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['authenticated'],
|
||||
});
|
||||
|
||||
const warrenStore = useWarrenStore();
|
||||
|
||||
if (warrenStore.current == null) {
|
||||
await navigateTo({
|
||||
path: '/warrens',
|
||||
});
|
||||
}
|
||||
|
||||
const entries = useAsyncData('current-directory', async () => {
|
||||
if (warrenStore.current == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await getWarrenDirectory(
|
||||
warrenStore.current.warrenId,
|
||||
warrenStore.current.path
|
||||
);
|
||||
}).data;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grow">
|
||||
<DirectoryListContextMenu class="w-full grow">
|
||||
<DirectoryList v-if="entries != null" :entries="entries" />
|
||||
</DirectoryListContextMenu>
|
||||
<RenameEntryDialog />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user