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
No files matched your search
@@ -1,13 +1,7 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
useHead({
|
|
||||||
bodyAttrs: {
|
|
||||||
class: 'bg-black'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NuxtLayout>
|
<UApp>
|
||||||
<NuxtPage />
|
<NuxtLayout>
|
||||||
</NuxtLayout>
|
<NuxtPage />
|
||||||
|
</NuxtLayout>
|
||||||
|
</UApp>
|
||||||
</template>
|
</template>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
@import "tailwindcss";
|
||||||
|
@import "@nuxt/ui";
|
||||||
@@ -1,26 +1,22 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue';
|
const config = useRuntimeConfig()
|
||||||
|
const healthResult = ref('Fetching health check...')
|
||||||
const runtimeConfig = useRuntimeConfig();
|
|
||||||
const healthResult = ref<string>("Fetching health check...");
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// Send a request to the API Health Check endpoint
|
try {
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Health`);
|
healthResult.value = await $fetch<string>('/api/Health', {
|
||||||
|
baseURL: config.public.apiBaseUrl,
|
||||||
// Extract the response payload (string result)
|
responseType: 'text'
|
||||||
const result = await response.text();
|
})
|
||||||
|
} catch {
|
||||||
// Set the result
|
healthResult.value = 'Unable to reach the API.'
|
||||||
healthResult.value = result;
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="text-slate-300">
|
<div>
|
||||||
<h1>Health Check</h1>
|
<h1 class="text-xl font-semibold">Health Check</h1>
|
||||||
<p>{{ healthResult }}</p>
|
<p>{{ healthResult }}</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,67 +1,61 @@
|
|||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
const api = useApi()
|
||||||
import { type ApiResponse } from '~/types/api-response';
|
const authenticated = useCookie<boolean>('authenticated')
|
||||||
|
|
||||||
const password = ref('');
|
const password = ref('')
|
||||||
const passwordError = ref('');
|
const showPassword = ref(false)
|
||||||
const authenticated = useCookie<boolean>('authenticated');
|
const error = ref('')
|
||||||
const runtimeConfig = useRuntimeConfig();
|
const loading = ref(false)
|
||||||
|
|
||||||
const handleLogin = async (event: Event) => {
|
const handleLogin = async () => {
|
||||||
// Prevent default form submission
|
error.value = ''
|
||||||
event.preventDefault();
|
loading.value = true
|
||||||
|
|
||||||
// Reset the error
|
|
||||||
passwordError.value = '';
|
|
||||||
|
|
||||||
// Send a request to the api to login
|
const response = await api.post<boolean>('/api/Authentication/login', password.value)
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Authentication/login`, {
|
loading.value = false
|
||||||
method: 'POST',
|
|
||||||
credentials: 'include',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: `"${password.value}"`
|
|
||||||
});
|
|
||||||
|
|
||||||
// Parse the response
|
if (response.success) {
|
||||||
const apiResponse = await response.json() as ApiResponse<boolean>;
|
authenticated.value = true
|
||||||
|
await navigateTo('/')
|
||||||
if (apiResponse.success) {
|
} else {
|
||||||
// If the response was successful, login and redirect to the home page
|
error.value = response.error ?? 'Unknown error'
|
||||||
authenticated.value = true;
|
}
|
||||||
navigateTo('/');
|
|
||||||
} else {
|
|
||||||
// Otherwise, set the error
|
|
||||||
passwordError.value = apiResponse.error ?? 'Unknown error';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bg-zinc-800 text-slate-300 text-center w-full md:w-96 rounded-md">
|
<UCard class="w-full md:w-96">
|
||||||
<h1 class="text-7xl mt-5">Yale</h1>
|
<template #header>
|
||||||
<div>
|
<div class="text-center">
|
||||||
<h4 class="hr text-2xl mt-3">User Access</h4>
|
<h1 class="text-5xl font-bold">Yale</h1>
|
||||||
</div>
|
<p class="text-muted mt-1">User Access</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<form @submit="handleLogin">
|
<UForm :state="{ password }" class="space-y-4" @submit="handleLogin">
|
||||||
<YaleFormInput type="password" v-model="password" placeholder="Password" class="block mt-10 w-5/6 mx-auto" />
|
<UFormField name="password" :error="error || undefined">
|
||||||
<p class="mt-3 w-5/6 mx-auto text-red-600" v-if="passwordError">{{ passwordError }}</p>
|
<UInput
|
||||||
<YaleButton type="submit" class="mb-8 mt-3 w-5/6 mx-auto ">Login</YaleButton>
|
v-model="password"
|
||||||
</form>
|
:type="showPassword ? 'text' : 'password'"
|
||||||
</div>
|
placeholder="Password"
|
||||||
|
autocomplete="current-password"
|
||||||
|
class="w-full"
|
||||||
|
autofocus
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<UButton
|
||||||
|
color="neutral"
|
||||||
|
variant="link"
|
||||||
|
size="sm"
|
||||||
|
:icon="showPassword ? 'i-lucide-eye-off' : 'i-lucide-eye'"
|
||||||
|
:aria-label="showPassword ? 'Hide password' : 'Show password'"
|
||||||
|
@click="showPassword = !showPassword"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormField>
|
||||||
|
|
||||||
|
<UButton type="submit" block :loading="loading" :disabled="!password">Login</UButton>
|
||||||
|
</UForm>
|
||||||
|
</UCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
|
||||||
.hr {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hr::after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
border-top: 2px solid theme('colors.slate.300');
|
|
||||||
margin-top: .1rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,132 +1,109 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type Person } from '@/types/yale';
|
import type { FormError, TableColumn } from '@nuxt/ui'
|
||||||
import { onMounted, ref } from 'vue';
|
import type { Person } from '~/types/yale'
|
||||||
import type { ApiResponse } from '~/types/api-response';
|
|
||||||
|
|
||||||
const people = ref([] as Person[]);
|
const api = useApi()
|
||||||
const person = ref({ id: 0, name: '', phoneNumber: '' } as Person);
|
const toast = useToast()
|
||||||
const loading = ref(true);
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
|
||||||
|
|
||||||
const addModal = ref(false);
|
const people = ref<Person[]>([])
|
||||||
|
const loading = ref(true)
|
||||||
|
const saving = ref(false)
|
||||||
|
const addOpen = ref(false)
|
||||||
|
const newPerson = reactive({ name: '', phoneNumber: '' })
|
||||||
|
|
||||||
// When the component is mounted, load the people
|
const columns: TableColumn<Person>[] = [
|
||||||
onMounted(async () => {
|
{ accessorKey: 'id', header: 'Person ID' },
|
||||||
await loadPeople();
|
{ accessorKey: 'name', header: 'Name' },
|
||||||
loading.value = false;
|
{ accessorKey: 'phoneNumber', header: 'Phone Number' },
|
||||||
});
|
{ id: 'actions', header: 'Actions' }
|
||||||
|
]
|
||||||
|
|
||||||
const loadPeople = async () => {
|
const loadPeople = async () => {
|
||||||
// Send a request to the api to get the people
|
loading.value = true
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/People`, { credentials: 'include' });
|
const response = await api.get<Person[]>('/api/People')
|
||||||
|
if (response.success) {
|
||||||
// Parse the response
|
people.value = response.data ?? []
|
||||||
const apiResponse = await response.json() as ApiResponse<Person[]>;
|
|
||||||
|
|
||||||
// Set the people
|
|
||||||
people.value = apiResponse.data || [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAddPerson = () => {
|
|
||||||
addModal.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSavePerson = async () => {
|
|
||||||
// Validate the person fields
|
|
||||||
if (!person.value.name || !person.value.phoneNumber) {
|
|
||||||
alert('Name and phone number are required');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the loading status
|
|
||||||
loading.value = true;
|
|
||||||
|
|
||||||
// Send a request to the api to save the person
|
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/People`, {
|
|
||||||
method: 'POST',
|
|
||||||
credentials: 'include',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: JSON.stringify(person.value)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Parse the response
|
|
||||||
const apiResponse = await response.json() as ApiResponse<Person>;
|
|
||||||
|
|
||||||
if (apiResponse.success) {
|
|
||||||
// Add the new person to the list
|
|
||||||
people.value.push(apiResponse.data!);
|
|
||||||
addModal.value = false;
|
|
||||||
} else {
|
} else {
|
||||||
alert(apiResponse.error ?? 'An error occurred');
|
toast.add({ title: 'Could not load people', description: response.error, color: 'error' })
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
// Close the modal and reset the person
|
|
||||||
loading.value = false;
|
|
||||||
person.value = { id: 0, name: '', phoneNumber: '' };
|
|
||||||
|
|
||||||
// Set the loading status
|
|
||||||
loading.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDeletePerson = async (id: number) => {
|
onMounted(loadPeople)
|
||||||
// Set the loading status
|
|
||||||
loading.value = true;
|
|
||||||
|
|
||||||
// Send a request to the api to delete the person
|
const validate = (state: typeof newPerson): FormError[] => {
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/People/${id}`, {
|
const errors: FormError[] = []
|
||||||
method: 'DELETE',
|
if (!state.name.trim()) errors.push({ name: 'name', message: 'Name is required' })
|
||||||
credentials: 'include'
|
if (!/^\+[1-9]\d{6,14}$/.test(state.phoneNumber.trim())) {
|
||||||
});
|
errors.push({ name: 'phoneNumber', message: 'Use international format, e.g. +61400000000' })
|
||||||
|
|
||||||
// Parse the response
|
|
||||||
const apiResponse = await response.json() as ApiResponse<Person>;
|
|
||||||
|
|
||||||
if (apiResponse.success) {
|
|
||||||
// Remove the person from the list
|
|
||||||
const index = people.value.findIndex(x => x.id === id);
|
|
||||||
people.value.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
alert(apiResponse.error ?? 'An error occurred');
|
|
||||||
}
|
}
|
||||||
|
return errors
|
||||||
|
}
|
||||||
|
|
||||||
// Set the loading status
|
const savePerson = async () => {
|
||||||
loading.value = false;
|
saving.value = true
|
||||||
|
const response = await api.post<Person>('/api/People', { id: 0, ...newPerson })
|
||||||
|
saving.value = false
|
||||||
|
|
||||||
|
if (response.success && response.data) {
|
||||||
|
people.value.push(response.data)
|
||||||
|
addOpen.value = false
|
||||||
|
newPerson.name = ''
|
||||||
|
newPerson.phoneNumber = ''
|
||||||
|
toast.add({ title: 'Person added', color: 'success' })
|
||||||
|
} else {
|
||||||
|
toast.add({ title: 'Could not add person', description: response.error, color: 'error' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletePerson = async (id: number) => {
|
||||||
|
const response = await api.delete<Person>(`/api/People/${id}`)
|
||||||
|
if (response.success) {
|
||||||
|
people.value = people.value.filter(x => x.id !== id)
|
||||||
|
toast.add({ title: 'Person removed', color: 'success' })
|
||||||
|
} else {
|
||||||
|
toast.add({ title: 'Could not remove person', description: response.error, color: 'error' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- Handle loading state -->
|
<div>
|
||||||
<div v-if="loading">Loading...</div>
|
<div class="flex justify-end mb-4">
|
||||||
<template v-else>
|
<UButton icon="i-lucide-user-plus" @click="addOpen = true">Add Person</UButton>
|
||||||
<div class="text-end my-2">
|
|
||||||
<YaleButton type="button" @click="handleAddPerson">Add Person</YaleButton>
|
|
||||||
</div>
|
</div>
|
||||||
<table class="w-full text-left">
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Person ID</th>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Phone Number</th>
|
|
||||||
<th scope="col">Actions</th>
|
|
||||||
</tr>
|
|
||||||
<PeopleListRow v-for="person in people" :key="person.id" :person="person" @delete-person="handleDeletePerson" />
|
|
||||||
</table>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- Add modal -->
|
<UTable
|
||||||
<Modal v-if="addModal" @close="addModal = false">
|
:data="people" :columns="columns" :loading="loading"
|
||||||
<template #title>
|
:ui="{ th: 'px-2 whitespace-nowrap', td: 'px-2' }"
|
||||||
Add Person
|
>
|
||||||
</template>
|
<template #actions-cell="{ row }">
|
||||||
<template #default>
|
<UButton
|
||||||
<div class="flex flex-col space-y-2">
|
color="error"
|
||||||
<YaleFormInput v-model="person.name" type="text" placeholder="Name" class="block w-full" />
|
variant="ghost"
|
||||||
<YaleFormInput v-model="person.phoneNumber" type="text" placeholder="Phone" class="block w-full" />
|
icon="i-lucide-trash-2"
|
||||||
<div class="flex justify-end">
|
:aria-label="`Delete ${row.original.name}`"
|
||||||
<YaleButton type="button" @click="handleSavePerson">Save</YaleButton>
|
@click="deletePerson(row.original.id)"
|
||||||
</div>
|
/>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
<template #empty>No people yet.</template>
|
||||||
</Modal>
|
</UTable>
|
||||||
</template>
|
|
||||||
|
<UModal v-model:open="addOpen" title="Add Person">
|
||||||
|
<template #body>
|
||||||
|
<UForm id="add-person" :state="newPerson" :validate="validate" class="space-y-4" @submit="savePerson">
|
||||||
|
<UFormField label="Name" name="name">
|
||||||
|
<UInput v-model="newPerson.name" placeholder="Name" class="w-full" />
|
||||||
|
</UFormField>
|
||||||
|
<UFormField label="Phone" name="phoneNumber">
|
||||||
|
<UInput v-model="newPerson.phoneNumber" type="tel" placeholder="+61400000000" class="w-full" />
|
||||||
|
</UFormField>
|
||||||
|
</UForm>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<UButton color="neutral" variant="outline" @click="addOpen = false">Cancel</UButton>
|
||||||
|
<UButton type="submit" form="add-person" :loading="saving">Save</UButton>
|
||||||
|
</template>
|
||||||
|
</UModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,300 +1,228 @@
|
|||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import type { ApiResponse } from '@/types/api-response';
|
import type { TableColumn } from '@nuxt/ui'
|
||||||
import UserCodeListRow from './UserCodeListRow.vue';
|
import { UserCodeStatus, type Person, type YaleUserCode } from '~/types/yale'
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import { UserCodeStatus, type Person, type YaleUserCode } from '@/types/yale';
|
|
||||||
|
|
||||||
const userCodes = ref([] as YaleUserCode[]);
|
type ModalKind = 'show' | 'edit' | 'clear' | 'send'
|
||||||
const userCode = ref({} as YaleUserCode);
|
|
||||||
const people = ref([] as { label: string, value: string }[]);
|
|
||||||
const personNumber = ref('');
|
|
||||||
const loading = ref(true);
|
|
||||||
const runtimeConfig = useRuntimeConfig();
|
|
||||||
|
|
||||||
// Modals
|
const api = useApi()
|
||||||
const showModal = ref(false);
|
const toast = useToast()
|
||||||
const editModal = ref(false);
|
|
||||||
const clearModal = ref(false);
|
|
||||||
const sendModal = ref(false);
|
|
||||||
|
|
||||||
// Form Fields
|
const userCodes = ref<YaleUserCode[]>([])
|
||||||
const newCode = ref('');
|
const people = ref<{ label: string, value: string }[]>([])
|
||||||
const newCodeError = ref('');
|
const loading = ref(true)
|
||||||
|
const saving = ref(false)
|
||||||
|
|
||||||
// When the component is mounted, load the user codes
|
// Only one modal is ever open, for one code at a time
|
||||||
onMounted(async () => {
|
const activeModal = ref<ModalKind | null>(null)
|
||||||
// Load the user codes and set the loading status when complete
|
const activeCode = ref<YaleUserCode | null>(null)
|
||||||
await loadUserCodes();
|
const newCode = ref('')
|
||||||
await loadPeople();
|
const newCodeError = ref('')
|
||||||
loading.value = false;
|
const personNumber = ref<string | undefined>(undefined)
|
||||||
});
|
|
||||||
|
|
||||||
const loadUserCodes = async () => {
|
const columns: TableColumn<YaleUserCode>[] = [
|
||||||
// Send a request to the api to get the user codes
|
{ accessorKey: 'id', header: 'Code ID' },
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Yale/codes`, { credentials: 'include' });
|
{ accessorKey: 'status', header: 'Status' },
|
||||||
|
{ id: 'actions', header: 'Actions' }
|
||||||
|
]
|
||||||
|
|
||||||
// Parse the response
|
const statusDisplay: Record<UserCodeStatus, { label: string, color: 'success' | 'neutral' | 'error' }> = {
|
||||||
const apiResponse = await response.json() as ApiResponse<YaleUserCode[]>;
|
[UserCodeStatus.AVAILABLE]: { label: 'Available', color: 'neutral' },
|
||||||
|
[UserCodeStatus.ENABLED]: { label: 'Enabled', color: 'success' },
|
||||||
// Set the user codes by id
|
[UserCodeStatus.DISABLED]: { label: 'Disabled', color: 'error' }
|
||||||
userCodes.value = apiResponse.data?.sort((a, b) => a.id - b.id) || [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadPeople = async () => {
|
const modalOpen = (kind: ModalKind) => activeModal.value === kind
|
||||||
// Send a request to the api to get the people
|
const setModalOpen = (open: boolean) => {
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/People`, { credentials: 'include' });
|
if (!open) activeModal.value = null
|
||||||
|
|
||||||
// Parse the response
|
|
||||||
const apiResponse = await response.json() as ApiResponse<Person[]>;
|
|
||||||
|
|
||||||
// Set the people for drop down
|
|
||||||
people.value = apiResponse.data?.map(x => ({ label: x.name, value: x.phoneNumber })) || [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmUpdateCode = async (id: number, code: string) => {
|
const loadAll = async () => {
|
||||||
// Reset the error
|
loading.value = true
|
||||||
newCodeError.value = '';
|
const [codes, peopleResponse] = await Promise.all([
|
||||||
|
api.get<YaleUserCode[]>('/api/Yale/codes'),
|
||||||
|
api.get<Person[]>('/api/People')
|
||||||
|
])
|
||||||
|
|
||||||
// Validate the new code first
|
if (codes.success) {
|
||||||
if (!/^\d{4,6}$/.test(code)) {
|
userCodes.value = (codes.data ?? []).sort((a, b) => a.id - b.id)
|
||||||
newCodeError.value = 'Code must be 4, 5 or 6 digits long';
|
} else {
|
||||||
return;
|
toast.add({ title: 'Could not load codes', description: codes.error, color: 'error' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the loading status
|
if (peopleResponse.success) {
|
||||||
loading.value = true;
|
people.value = (peopleResponse.data ?? []).map(x => ({ label: x.name, value: x.phoneNumber }))
|
||||||
|
}
|
||||||
// Send a request to the api, the body will just be the new code
|
loading.value = false
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Yale/code/${id}`, {
|
|
||||||
method: 'POST',
|
|
||||||
credentials: 'include',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: `"${code}"`
|
|
||||||
});
|
|
||||||
|
|
||||||
// Parse the result
|
|
||||||
const apiResponse = await response.json() as ApiResponse<boolean>;
|
|
||||||
|
|
||||||
if (apiResponse.success) {
|
|
||||||
// If the response was successful update the code in the list
|
|
||||||
const index = userCodes.value.findIndex(x => x.id === id);
|
|
||||||
userCodes.value[index].code = code;
|
|
||||||
userCodes.value[index].status = UserCodeStatus.ENABLED;
|
|
||||||
} else {
|
|
||||||
// Otherwise display an error to the user.
|
|
||||||
alert(apiResponse.error ?? 'Unknown error');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the new code
|
|
||||||
newCode.value = '';
|
|
||||||
|
|
||||||
// Close the edit modal
|
|
||||||
editModal.value = false;
|
|
||||||
|
|
||||||
// Set the loading status
|
|
||||||
loading.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmClearCode = async (id: number) => {
|
onMounted(loadAll)
|
||||||
// Set the loading status
|
|
||||||
loading.value = true;
|
|
||||||
|
|
||||||
// Send a request to the api
|
const openModal = (kind: ModalKind, code: YaleUserCode) => {
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Yale/code/${id}/status`, {
|
activeCode.value = code
|
||||||
method: 'POST',
|
newCode.value = ''
|
||||||
credentials: 'include'
|
newCodeError.value = ''
|
||||||
});
|
personNumber.value = undefined
|
||||||
|
activeModal.value = kind
|
||||||
// Parse the response
|
|
||||||
const apiResponse = await response.json() as ApiResponse<boolean>;
|
|
||||||
|
|
||||||
if (apiResponse.success) {
|
|
||||||
// If the response was successful set the code to available in the list
|
|
||||||
const index = userCodes.value.findIndex(x => x.id === id);
|
|
||||||
userCodes.value[index].code = '';
|
|
||||||
userCodes.value[index].status = UserCodeStatus.AVAILABLE;
|
|
||||||
} else {
|
|
||||||
// Otherwise display an error to the user.
|
|
||||||
alert(apiResponse.error ?? 'Unknown error');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Close the clear modal
|
|
||||||
clearModal.value = false;
|
|
||||||
|
|
||||||
// Set the loading status
|
|
||||||
loading.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleShowCode = (id: number) => {
|
const confirmUpdateCode = async () => {
|
||||||
// Get the user code to show
|
const code = activeCode.value
|
||||||
const code = userCodes.value.find(x => x.id === id);
|
if (!code) return
|
||||||
|
newCodeError.value = ''
|
||||||
|
|
||||||
// If the code is not found then show an error to the user
|
if (!/^\d{4,6}$/.test(newCode.value)) {
|
||||||
if (!code) {
|
newCodeError.value = 'Code must be 4, 5 or 6 digits long'
|
||||||
alert('Code not found');
|
return
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Set the user code to show
|
saving.value = true
|
||||||
userCode.value = code;
|
const response = await api.post<boolean>(`/api/Yale/code/${code.id}`, newCode.value)
|
||||||
|
saving.value = false
|
||||||
|
|
||||||
// Show the show-modal
|
if (response.success) {
|
||||||
showModal.value = true;
|
code.code = newCode.value
|
||||||
|
code.status = UserCodeStatus.ENABLED
|
||||||
|
activeModal.value = null
|
||||||
|
toast.add({ title: `Code #${code.id} updated`, color: 'success' })
|
||||||
|
} else {
|
||||||
|
toast.add({ title: 'Could not update code', description: response.error, color: 'error' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleUpdateCode = (id: number) => {
|
const confirmClearCode = async () => {
|
||||||
// Get the user code to update
|
const code = activeCode.value
|
||||||
const code = userCodes.value.find(x => x.id === id);
|
if (!code) return
|
||||||
|
|
||||||
// If the code is not found then show an error to the user
|
saving.value = true
|
||||||
if (!code) {
|
const response = await api.post<boolean>(`/api/Yale/code/${code.id}/status`)
|
||||||
alert('Code not found');
|
saving.value = false
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the user code to update
|
if (response.success) {
|
||||||
userCode.value = code;
|
code.code = ''
|
||||||
|
code.status = UserCodeStatus.AVAILABLE
|
||||||
// Show the edit-modal
|
activeModal.value = null
|
||||||
editModal.value = true;
|
toast.add({ title: `Code #${code.id} deleted`, color: 'success' })
|
||||||
|
} else {
|
||||||
|
toast.add({ title: 'Could not delete code', description: response.error, color: 'error' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClearCode = (id: number) => {
|
const confirmSendCode = async () => {
|
||||||
// Get the user code to clear
|
const code = activeCode.value
|
||||||
const code = userCodes.value.find(x => x.id === id);
|
if (!code || !personNumber.value) return
|
||||||
|
|
||||||
// If the code is not found then show an error to the user
|
saving.value = true
|
||||||
if (!code) {
|
const response = await api.post<boolean>(`/api/Yale/code/${code.id}/send`, personNumber.value)
|
||||||
alert('Code not found');
|
saving.value = false
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the user code to clear
|
if (response.success) {
|
||||||
userCode.value = code;
|
activeModal.value = null
|
||||||
|
toast.add({ title: 'Code sent successfully', color: 'success' })
|
||||||
// Show the clear-modal
|
} else {
|
||||||
clearModal.value = true;
|
toast.add({ title: 'Could not send code', description: response.error, color: 'error' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSendCode = (id: number) => {
|
|
||||||
// Get the user code to send
|
|
||||||
const code = userCodes.value.find(x => x.id === id);
|
|
||||||
|
|
||||||
// If the code is not found then show an error to the user
|
|
||||||
if (!code) {
|
|
||||||
alert('Code not found');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the user code
|
|
||||||
userCode.value = code;
|
|
||||||
|
|
||||||
// Show the send modal
|
|
||||||
sendModal.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmSendCode = async (id: number) => {
|
|
||||||
// Set the loading status
|
|
||||||
loading.value = true;
|
|
||||||
|
|
||||||
if (!personNumber.value) {
|
|
||||||
alert('Please select a person to send the code to');
|
|
||||||
loading.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send a request to the api to send the code
|
|
||||||
const response = await fetch(`${runtimeConfig.public.apiBaseUrl}/api/Yale/code/${id}/send`, {
|
|
||||||
method: 'POST',
|
|
||||||
credentials: 'include',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: `"${personNumber.value}"`
|
|
||||||
});
|
|
||||||
|
|
||||||
// Parse the response
|
|
||||||
const apiResponse = await response.json() as ApiResponse<boolean>;
|
|
||||||
|
|
||||||
if (apiResponse.success) {
|
|
||||||
alert('Code sent successfully');
|
|
||||||
} else {
|
|
||||||
alert(apiResponse.error ?? 'Unknown error');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Close the clear modal
|
|
||||||
sendModal.value = false;
|
|
||||||
|
|
||||||
// Clear the person number and user code
|
|
||||||
personNumber.value = '';
|
|
||||||
userCode.value = {} as YaleUserCode;
|
|
||||||
|
|
||||||
// Set the loading status
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- Handle loading state -->
|
<div>
|
||||||
<div v-if="loading">Loading...</div>
|
<UTable
|
||||||
<table v-else class="w-full text-left">
|
:data="userCodes" :columns="columns" :loading="loading"
|
||||||
<tr>
|
:ui="{ th: 'px-2 whitespace-nowrap', td: 'px-2' }"
|
||||||
<th scope="col">Code ID</th>
|
>
|
||||||
<th scope="col">Status</th>
|
<template #id-cell="{ row }">
|
||||||
<th scope="col">Actions</th>
|
<span class="inline-flex items-center gap-1">
|
||||||
</tr>
|
{{ row.original.id }}
|
||||||
<UserCodeListRow v-for="userCode in userCodes" :key="userCode.id" :user-code="userCode"
|
<UIcon v-if="row.original.isHome" name="i-lucide-house" class="size-4" aria-label="Home code" />
|
||||||
@update-code="handleUpdateCode" @clear-code="handleClearCode" @show-code="handleShowCode"
|
</span>
|
||||||
@send-code="handleSendCode" />
|
</template>
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- Show modal -->
|
<template #status-cell="{ row }">
|
||||||
<Modal v-if="showModal" @close="showModal = false">
|
<UBadge
|
||||||
<template #title>
|
:color="statusDisplay[row.original.status]?.color ?? 'neutral'"
|
||||||
User Code # {{ userCode.id }}
|
variant="subtle"
|
||||||
</template>
|
>
|
||||||
<template #default>
|
{{ statusDisplay[row.original.status]?.label ?? 'Unknown' }}
|
||||||
Code: {{ userCode.code }}
|
</UBadge>
|
||||||
</template>
|
</template>
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<!-- Edit modal -->
|
<template #actions-cell="{ row }">
|
||||||
<Modal v-if="editModal" @close="editModal = false">
|
<div class="flex">
|
||||||
<template #title>
|
<UButton
|
||||||
Edit User Code # {{ userCode.id }}
|
color="neutral" variant="ghost" size="sm" icon="i-lucide-eye" aria-label="Show code"
|
||||||
</template>
|
:disabled="row.original.status !== UserCodeStatus.ENABLED"
|
||||||
<template #default>
|
@click="openModal('show', row.original)"
|
||||||
<YaleFormInput v-model="newCode" type="text" placeholder="New Code" class="block w-full" />
|
/>
|
||||||
<p class="text-red-600 mt-3" v-if="newCodeError">{{ newCodeError }}</p>
|
<UButton
|
||||||
<YaleButton @click="confirmUpdateCode(userCode.id, newCode)" class="w-full mt-3">Update Code</YaleButton>
|
color="neutral" variant="ghost" size="sm" icon="i-lucide-pencil" aria-label="Edit code"
|
||||||
</template>
|
@click="openModal('edit', row.original)"
|
||||||
<template #footer v-if="userCode.isHome">
|
/>
|
||||||
<p class="text-red-600 mt-3">You are about to edit the home code, are you sure?</p>
|
<template v-if="!row.original.isHome">
|
||||||
</template>
|
<UButton
|
||||||
</Modal>
|
color="neutral" variant="ghost" size="sm" icon="i-lucide-send" aria-label="Send code"
|
||||||
|
:disabled="row.original.status !== UserCodeStatus.ENABLED"
|
||||||
|
@click="openModal('send', row.original)"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
color="error" variant="ghost" size="sm" icon="i-lucide-trash-2" aria-label="Delete code"
|
||||||
|
:disabled="row.original.status !== UserCodeStatus.ENABLED"
|
||||||
|
@click="openModal('clear', row.original)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</UTable>
|
||||||
|
|
||||||
<!-- Clear modal -->
|
<!-- Show -->
|
||||||
<Modal v-if="clearModal" @close="clearModal = false">
|
<UModal :open="modalOpen('show')" :title="`User Code #${activeCode?.id}`" @update:open="setModalOpen">
|
||||||
<template #title>
|
<template #body>
|
||||||
Delete User Code # {{ userCode.id }}
|
<p class="text-2xl font-mono tracking-widest text-center">{{ activeCode?.code }}</p>
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
</UModal>
|
||||||
<p>Are you sure you want to delete this code?</p>
|
|
||||||
<YaleButton @click="confirmClearCode(userCode.id)" class="w-full mt-3">Delete Code</YaleButton>
|
|
||||||
</template>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<!-- Send modal -->
|
<!-- Edit -->
|
||||||
<Modal v-if="sendModal" @close="sendModal = false">
|
<UModal :open="modalOpen('edit')" :title="`Edit User Code #${activeCode?.id}`" @update:open="setModalOpen">
|
||||||
<template #title>
|
<template #body>
|
||||||
Send User Code # {{ userCode.id }}
|
<form id="edit-code" class="space-y-4" @submit.prevent="confirmUpdateCode">
|
||||||
</template>
|
<UAlert
|
||||||
<template #default>
|
v-if="activeCode?.isHome"
|
||||||
<YaleFormSelect v-model="personNumber" :options="people" class="block w-full"
|
color="warning" variant="subtle" icon="i-lucide-triangle-alert"
|
||||||
placeholder="Select a Person" />
|
title="You are about to edit the home code, are you sure?"
|
||||||
<YaleButton @click="confirmSendCode(userCode.id)" class="w-full mt-3">Send Code</YaleButton>
|
/>
|
||||||
</template>
|
<UFormField :error="newCodeError || undefined">
|
||||||
</Modal>
|
<UInput
|
||||||
</template>
|
v-model="newCode" placeholder="New Code" inputmode="numeric" maxlength="6"
|
||||||
|
autocomplete="off" class="w-full" autofocus
|
||||||
|
/>
|
||||||
|
</UFormField>
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<UButton color="neutral" variant="outline" @click="activeModal = null">Cancel</UButton>
|
||||||
|
<UButton type="submit" form="edit-code" :loading="saving">Update Code</UButton>
|
||||||
|
</template>
|
||||||
|
</UModal>
|
||||||
|
|
||||||
|
<!-- Delete -->
|
||||||
|
<UModal :open="modalOpen('clear')" :title="`Delete User Code #${activeCode?.id}`" @update:open="setModalOpen">
|
||||||
|
<template #body>
|
||||||
|
<p>Are you sure you want to delete this code?</p>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<UButton color="neutral" variant="outline" @click="activeModal = null">Cancel</UButton>
|
||||||
|
<UButton color="error" :loading="saving" @click="confirmClearCode">Delete Code</UButton>
|
||||||
|
</template>
|
||||||
|
</UModal>
|
||||||
|
|
||||||
|
<!-- Send -->
|
||||||
|
<UModal :open="modalOpen('send')" :title="`Send User Code #${activeCode?.id}`" @update:open="setModalOpen">
|
||||||
|
<template #body>
|
||||||
|
<USelect v-model="personNumber" :items="people" placeholder="Select a person" class="w-full" />
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<UButton color="neutral" variant="outline" @click="activeModal = null">Cancel</UButton>
|
||||||
|
<UButton :loading="saving" :disabled="!personNumber" @click="confirmSendCode">Send Code</UButton>
|
||||||
|
</template>
|
||||||
|
</UModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import type { FetchError } from 'ofetch'
|
||||||
|
import type { ApiResponse } from '~/types/api-response'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thin wrapper around $fetch for the Yale Access API.
|
||||||
|
* Always resolves to an ApiResponse (never throws), and sends the user
|
||||||
|
* back to the login page when the server session has expired.
|
||||||
|
*/
|
||||||
|
export function useApi() {
|
||||||
|
const config = useRuntimeConfig()
|
||||||
|
const authenticated = useCookie<boolean>('authenticated')
|
||||||
|
|
||||||
|
async function request<T>(path: string, method: 'GET' | 'POST' | 'DELETE' = 'GET', body?: unknown): Promise<ApiResponse<T>> {
|
||||||
|
try {
|
||||||
|
return await $fetch<ApiResponse<T>>(path, {
|
||||||
|
baseURL: config.public.apiBaseUrl,
|
||||||
|
method,
|
||||||
|
credentials: 'include',
|
||||||
|
// The API takes bare JSON strings for some bodies, so always JSON-encode
|
||||||
|
...(body !== undefined && {
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
const err = e as FetchError<ApiResponse<T>>
|
||||||
|
|
||||||
|
// The cookie auth middleware answers an expired session with an empty 401
|
||||||
|
if (err.status === 401 && !err.data?.error) {
|
||||||
|
authenticated.value = false
|
||||||
|
await navigateTo('/login')
|
||||||
|
return { success: false, error: 'Your session has expired. Please log in again.' }
|
||||||
|
}
|
||||||
|
|
||||||
|
return err.data?.error
|
||||||
|
? { success: false, error: err.data.error }
|
||||||
|
: { success: false, error: 'Unable to reach the server.' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
get: <T>(path: string) => request<T>(path),
|
||||||
|
post: <T>(path: string, body?: unknown) => request<T>(path, 'POST', body),
|
||||||
|
delete: <T>(path: string) => request<T>(path, 'DELETE')
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="text-slate-300">
|
<div class="min-h-screen flex items-center justify-center p-4">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,6 +1,34 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const api = useApi()
|
||||||
|
const authenticated = useCookie<boolean>('authenticated')
|
||||||
|
|
||||||
|
const items = [
|
||||||
|
{ label: 'Home', to: '/', icon: 'i-lucide-house' },
|
||||||
|
{ label: 'People', to: '/people', icon: 'i-lucide-users' }
|
||||||
|
]
|
||||||
|
|
||||||
|
const logout = async () => {
|
||||||
|
await api.post('/api/Authentication/logout')
|
||||||
|
authenticated.value = false
|
||||||
|
await navigateTo('/login')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Navbar />
|
<UHeader title="Yale | User Access">
|
||||||
<div class="text-slate-300 container mx-auto px-4">
|
<UNavigationMenu :items="items" />
|
||||||
<slot />
|
|
||||||
</div>
|
<template #right>
|
||||||
</template>
|
<UColorModeButton />
|
||||||
|
<UButton color="neutral" variant="ghost" icon="i-lucide-log-out" aria-label="Log out" @click="logout" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #body>
|
||||||
|
<UNavigationMenu :items="items" orientation="vertical" class="-mx-2.5" />
|
||||||
|
</template>
|
||||||
|
</UHeader>
|
||||||
|
|
||||||
|
<UContainer class="py-6">
|
||||||
|
<slot />
|
||||||
|
</UContainer>
|
||||||
|
</template>
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
const anonymousRoutes = ['/login', '/health'];
|
const anonymousRoutes = ['/login', '/health']
|
||||||
|
|
||||||
export default defineNuxtRouteMiddleware((to, from) => {
|
export default defineNuxtRouteMiddleware((to) => {
|
||||||
// If the route is not the login page and the user is not logged in then redirect to login
|
const authenticated = useCookie<boolean>('authenticated')
|
||||||
const authenticated = useCookie<boolean>('authenticated');
|
|
||||||
if (!anonymousRoutes.includes(to.path) && !(authenticated.value) ) {
|
// Not logged in: send to the login page
|
||||||
return navigateTo('/login');
|
if (!anonymousRoutes.includes(to.path) && !authenticated.value) {
|
||||||
}
|
return navigateTo('/login')
|
||||||
})
|
}
|
||||||
|
|
||||||
|
// Already logged in: skip the login page
|
||||||
|
if (to.path === '/login' && authenticated.value) {
|
||||||
|
return navigateTo('/')
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<HealthCheck />
|
<UContainer class="py-6">
|
||||||
</template>
|
<HealthCheck />
|
||||||
|
</UContainer>
|
||||||
|
</template>
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<YalePanel heading="User Code List">
|
<UCard>
|
||||||
<UserCodeList />
|
<template #header>
|
||||||
</YalePanel>
|
<h2 class="text-lg font-semibold">User Codes</h2>
|
||||||
</template>
|
</template>
|
||||||
|
<UserCodeList />
|
||||||
|
</UCard>
|
||||||
|
</template>
|
||||||
@@ -5,7 +5,5 @@ definePageMeta({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="h-screen flex items-center justify-center w-11/12 md:w-auto mx-auto">
|
<LoginForm />
|
||||||
<LoginForm />
|
</template>
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<YalePanel title="People">
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
<h2 class="text-lg font-semibold">People</h2>
|
||||||
|
</template>
|
||||||
<PeopleList />
|
<PeopleList />
|
||||||
</YalePanel>
|
</UCard>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
modules: [ '@nuxtjs/tailwindcss' ],
|
modules: ['@nuxt/ui'],
|
||||||
|
css: ['~/assets/css/main.css'],
|
||||||
|
colorMode: { preference: 'dark', fallback: 'dark' },
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
compatibilityDate: '2025-07-15',
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
public: {
|
public: {
|
||||||
apiBaseUrl: 'https://localhost:7069'
|
apiBaseUrl: 'https://localhost:7069'
|
||||||
|
|||||||
@@ -7,15 +7,26 @@
|
|||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"preview": "nuxt preview",
|
"preview": "nuxt preview",
|
||||||
|
"test": "vitest run",
|
||||||
|
"test:watch": "vitest",
|
||||||
|
"typecheck": "nuxt typecheck",
|
||||||
"postinstall": "nuxt prepare"
|
"postinstall": "nuxt prepare"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/devtools": "latest",
|
"@iconify-json/lucide": "^1.2.155",
|
||||||
"@nuxtjs/tailwindcss": "^6.11.3",
|
"@nuxt/ui": "^4.12.0",
|
||||||
"nuxt": "^3.9.1",
|
"nuxt": "^4.6.4",
|
||||||
"vue": "^3.4.10",
|
"tailwindcss": "^4.3.5",
|
||||||
"vue-router": "^4.2.5"
|
"vue": "^3.5.45",
|
||||||
|
"vue-router": "^5.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"packageManager": "pnpm@12.6.0+sha512.3ef68f951cb111ac204b4a5a16f0b2ddf0da56a96e0413e81d855d9f0b55ef926714709028e1cd00c405c2c5fb7b9e8ec4dc46777c805d0373c2f2ff00fd20ec",
|
||||||
"packageManager": "pnpm@12.6.0+sha512.3ef68f951cb111ac204b4a5a16f0b2ddf0da56a96e0413e81d855d9f0b55ef926714709028e1cd00c405c2c5fb7b9e8ec4dc46777c805d0373c2f2ff00fd20ec"
|
"devDependencies": {
|
||||||
|
"@nuxt/test-utils": "^4.4.0",
|
||||||
|
"@vue/test-utils": "^2.5.1",
|
||||||
|
"happy-dom": "^21.0.4",
|
||||||
|
"typescript": "^5.9.3",
|
||||||
|
"vitest": "^5.1.0",
|
||||||
|
"vue-tsc": "^3.3.14"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
allowBuilds:
|
allowBuilds:
|
||||||
esbuild: true
|
esbuild: true
|
||||||
|
vue-demi: false
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 37 KiB |