Migrate frontend to Nuxt 4 and Nuxt UI
- Upgrade to Nuxt 4 (sources under app/), add @nuxt/ui, Tailwind v4 and Lucide icons; drop @nuxtjs/tailwindcss - Replace the custom Yale* components, Modal, Navbar and icon components with UButton/UInput/UModal/UTable/UCard/UHeader/UBadge/UAlert and toasts - Add dark/light mode toggle and a logout button - Add a useApi composable: central base URL/credentials, JSON-encoded bodies, error handling, and redirect to login when the session expires - Fix modal listener leak, missing People heading, unhandled fetch errors and login redirect for already-authenticated users - Make the code and people tables fit on phone screens - Retake README screenshots
This commit is contained in:
1 parent
d0425c8cb2
commit
a9bef7b50d
22 files changed
+4732
-3472
No files matched your search
@@ -1,26 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
const healthResult = ref<string>("Fetching health check...");
|
||||
const config = useRuntimeConfig()
|
||||
const healthResult = ref('Fetching health check...')
|
||||
|
||||
onMounted(async () => {
|
||||
// Send a request to the API Health Check endpoint
|
||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Health`);
|
||||
|
||||
// Extract the response payload (string result)
|
||||
const result = await response.text();
|
||||
|
||||
// Set the result
|
||||
healthResult.value = result;
|
||||
try {
|
||||
healthResult.value = await $fetch<string>('/api/Health', {
|
||||
baseURL: config.public.apiBaseUrl,
|
||||
responseType: 'text'
|
||||
})
|
||||
} catch {
|
||||
healthResult.value = 'Unable to reach the API.'
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-slate-300">
|
||||
<h1>Health Check</h1>
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold">Health Check</h1>
|
||||
<p>{{ healthResult }}</p>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user