1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 04:25:24 +02:00

feat: Migrate to Nuxt 3 framework (#5184)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Hoa (Kyle) Trinh 2025-06-20 00:09:12 +07:00 committed by GitHub
parent 89ab7fac25
commit c24d532608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
403 changed files with 23959 additions and 19557 deletions

View file

@ -0,0 +1,88 @@
<template>
<v-container>
<BasePageTitle divider>
<template #header>
<v-img
width="100%"
max-height="200"
max-width="200"
class="mb-2"
:src="require('~/static/svgs/data-reports.svg')"
/>
</template>
<template #title>
{{ $t('group.report') }}
</template>
</BasePageTitle>
<v-container v-if="report">
<BaseCardSectionTitle :title="report.name" />
<v-card-text> {{ $t('group.report-with-id', { id: id }) }} </v-card-text>
<v-data-table
:headers="itemHeaders"
:items="report.entries"
:items-per-page="50"
show-expand
>
<template #[`item.success`]="{ item }">
<v-icon :color="item.success ? 'success' : 'error'">
{{ item.success ? $globals.icons.checkboxMarkedCircle : $globals.icons.close }}
</v-icon>
</template>
<template #[`item.timestamp`]="{ item }">
{{ $d(Date.parse(item.timestamp!), "short") }}
</template>
<template #[`expanded-item`]="{ headers, item }">
<td
v-if="item.exception"
class="pa-6"
:colspan="headers.length"
>
{{ item.exception }}
</td>
</template>
</v-data-table>
</v-container>
</v-container>
</template>
<script lang="ts">
import { useUserApi } from "~/composables/api";
import type { ReportOut } from "~/lib/api/types/reports";
export default defineNuxtComponent({
middleware: "sidebase-auth",
setup() {
const route = useRoute();
const id = route.params.id as string;
const api = useUserApi();
const report = ref<ReportOut | null>(null);
async function getReport() {
const { data } = await api.groupReports.getOne(id);
report.value = data ?? null;
}
onMounted(async () => {
await getReport();
});
const itemHeaders = [
{ title: "Success", value: "success" },
{ title: "Message", value: "message" },
{ title: "Timestamp", value: "timestamp" },
];
return {
report,
id,
itemHeaders,
};
},
});
</script>
<style lang="scss" scoped></style>

View file

@ -1,70 +0,0 @@
<template>
<v-container>
<BasePageTitle divider>
<template #header>
<v-img max-height="200" max-width="200" class="mb-2" :src="require('~/static/svgs/data-reports.svg')"></v-img>
</template>
<template #title> {{ $t('group.report') }} </template>
</BasePageTitle>
<v-container v-if="report">
<BaseCardSectionTitle :title="report.name"> </BaseCardSectionTitle>
<v-card-text> {{ $t('group.report-with-id', { id:id }) }} </v-card-text>
<v-data-table :headers="itemHeaders" :items="report.entries" :items-per-page="50" show-expand>
<template #item.success="{ item }">
<v-icon :color="item.success ? 'success' : 'error'">
{{ item.success ? $globals.icons.checkboxMarkedCircle : $globals.icons.close }}
</v-icon>
</template>
<template #item.timestamp="{ item }">
{{ $d(Date.parse(item.timestamp), "short") }}
</template>
<template #expanded-item="{ headers, item }">
<td v-if="item.exception" class="pa-6" :colspan="headers.length">{{ item.exception }}</td>
</template>
</v-data-table>
</v-container>
</v-container>
</template>
<script lang="ts">
import { defineComponent, useRoute, ref, onMounted } from "@nuxtjs/composition-api";
import { useUserApi } from "~/composables/api";
import { ReportOut } from "~/lib/api/types/reports";
export default defineComponent({
middleware: "auth",
setup() {
const route = useRoute();
const id = route.value.params.id;
const api = useUserApi();
const report = ref<ReportOut | null>(null);
async function getReport() {
const { data } = await api.groupReports.getOne(id);
report.value = data ?? null;
}
onMounted(async () => {
await getReport();
});
const itemHeaders = [
{ text: "Success", value: "success" },
{ text: "Message", value: "message" },
{ text: "Timestamp", value: "timestamp" },
];
return {
report,
id,
itemHeaders,
};
},
});
</script>
<style lang="scss" scoped></style>