Project list and starting editing

This commit is contained in:
2024-08-06 15:16:48 +02:00
parent a3d0b3b5bd
commit aba56bb034
24 changed files with 1189 additions and 943 deletions

View File

@@ -26,7 +26,7 @@
<div v-else class="loading"></div>
</div>
</Teleport>
<NuxtLink :to="path" :class="class" noPrefetch @mouseenter="(e) => showPreview(e, true)" @mouseleave="hidePreview">
<NuxtLink :to="{ path, force: true }" :class="class" noPrefetch @mouseenter="(e) => showPreview(e, true)" @mouseleave="hidePreview">
<slot v-bind="$attrs"></slot>
</NuxtLink>
</template>
@@ -74,22 +74,30 @@ if (parseURL(props.href).protocol !== undefined)
let id = ref(props.project);
if(id.value === undefined)
{
id = useProject().id;
id.value = useProject().id.value;
}
const { data: page, status, error, execute } = await useLazyFetch(`/api/project/${id.value}/file`, {
query: {
search: "%" + parseURL(props.href).pathname,
}
},
immediate: false,
dedupe: 'defer',
});
if(external.value)
if(!external.value)
{
execute();
await execute();
}
if(status.value === 'error')
{
console.error(error.value);
}
if (page.value && page.value[0])
{
path.value = `/explorer/${id.value}${page.value[0].path}`;
console.log(path.value);
}
</script>