added first pass of homepage

This commit is contained in:
2025-12-16 11:49:14 -05:00
parent e9cce2571a
commit 5f03820891
4 changed files with 57 additions and 2 deletions

18
ui/src/api/docs.ts Normal file
View 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;
}
}

View File

@@ -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>