added first pass of homepage
This commit is contained in:
18
ui/src/api/docs.ts
Normal file
18
ui/src/api/docs.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// @ts-ignore
|
||||
const addr = import.meta.env.VITE_APIHOST;
|
||||
|
||||
export async function getWelcomeMessage(): Promise<string> {
|
||||
const res = await fetch(`${addr}/docs/welcome`, {
|
||||
method: "GET",
|
||||
credentials: 'include',
|
||||
});
|
||||
if (res.ok) {
|
||||
const out = res.json();
|
||||
if (!out) {
|
||||
return null;
|
||||
}
|
||||
return out;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { getWelcomeMessage } from '@/api/docs';
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -10,6 +12,13 @@ const user = useUserStore();
|
||||
function goToApplication() {
|
||||
router.push('/join') // change to your form route
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
let policy = await getWelcomeMessage() as any;
|
||||
welcomeRef.value.innerHTML = policy;
|
||||
})
|
||||
|
||||
const welcomeRef = ref<HTMLElement>(null);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -23,8 +32,10 @@ function goToApplication() {
|
||||
Begin Application
|
||||
</Button>
|
||||
</div>
|
||||
<div v-else>
|
||||
HOMEPAGEEEEEEEEEEEEEEEEEEE
|
||||
<div v-else class="mt-10">
|
||||
<div ref="welcomeRef" class="bookstack-container">
|
||||
<!-- LOA policy gets loaded here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user