You've already forked obsidian-visualiser
Project list and starting editing
This commit is contained in:
18
pages/editing.vue
Normal file
18
pages/editing.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<div class="column">
|
||||
<textarea v-model="input"></textarea>
|
||||
<pre>{{ timing }}ms</pre>
|
||||
</div>
|
||||
<div class="column">
|
||||
<Suspense>
|
||||
<template #fallback>
|
||||
<div class="loading"></div>
|
||||
</template>
|
||||
<Markdown v-if="input.length > 0" :content="input" v-model="timing"/>
|
||||
</Suspense>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const input = ref(""), timing = ref(0);
|
||||
</script>
|
||||
@@ -6,6 +6,10 @@ const { data: content } = await useFetch(`/api/project/${route.params.projectId}
|
||||
path: unifySlug(route.params.slug)
|
||||
}
|
||||
});
|
||||
|
||||
const { set } = useProject();
|
||||
|
||||
await set(parseInt(route.params.projectId as string));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -69,7 +69,7 @@ onMounted(() => {
|
||||
<ContentRenderer :value="getContent(descriptions)" />
|
||||
<h2>Pages contenant le tag</h2>
|
||||
<div class="card-container">
|
||||
<NuxtLink :key="item._id" :href="'/explorer' + item._path" v-for="item of list" class="tag"> {{ item.title }} </NuxtLink>
|
||||
<NuxtLink :key="item._id" :to="{ path: '/explorer' + item._path, force: true }" v-for="item of list" class="tag"> {{ item.title }} </NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
24
pages/explorer/index.vue
Normal file
24
pages/explorer/index.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
const { id: project } = useProject();
|
||||
|
||||
const { data: projects, status, error } = await useFetch('/api/project');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head>
|
||||
<Title>Liste des projets</Title>
|
||||
</Head>
|
||||
<div class="site-body-center-column">
|
||||
<div class="projects-container">
|
||||
<div v-if="status === 'success'" class="project-list">
|
||||
<div v-for="p of projects" class="project-item">
|
||||
<NuxtLink class="project-title" :to="{ path: `/explorer/${p.id}${p.home}`, force: true }">{{ p.name }}</NuxtLink>
|
||||
<div class="project-user">Par {{ p.username }}</div>
|
||||
<div class="project-pages">{{ p.pages }} pages</div>
|
||||
<div class="project-summary">{{ p.summary ?? "Sans contenu" }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="status === 'pending'" class="loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -59,7 +59,7 @@ async function submit()
|
||||
placeholder="" title="Mot de passe"
|
||||
:error="passwordError" />
|
||||
<button>Se connecter</button>
|
||||
<NuxtLink to="/user/register">Pas de compte ?</NuxtLink>
|
||||
<NuxtLink :to="{ path: `/user/register`, force: true }">Pas de compte ?</NuxtLink>
|
||||
</form>
|
||||
<div v-else-if="status === AuthStatus.loading" class="input-form"><div class="loading"></div></div>
|
||||
<div v-else class="not-found-container">
|
||||
|
||||
@@ -87,7 +87,7 @@ async function submit()
|
||||
title="Confirmer le mot de passe"
|
||||
:error="confirmPassword === '' || confirmPassword === state.password ? '' : 'Les mots de passe saisies ne sont pas identique'" />
|
||||
<button>S'inscrire</button>
|
||||
<NuxtLink to="/user/login">Se connecter</NuxtLink>
|
||||
<NuxtLink :to="{ path: `/user/login`, force: true }">Se connecter</NuxtLink>
|
||||
</form>
|
||||
<div v-else-if="status === AuthStatus.loading" class="input-form"><div class="loading"></div></div>
|
||||
<div v-else class="not-found-container">
|
||||
|
||||
Reference in New Issue
Block a user