1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00
mealie/frontend/pages/user/group/data/reports/_id.vue
Philipp Fischbeck 86c99b10a2
Use composition API for more components, enable more type checking (#914)
* Activate more linting rules from eslint and typescript

* Properly add VForm as type information

* Fix usage of native types

* Fix more linting issues

* Rename vuetify types file, add VTooltip

* Fix some more typing problems

* Use composition API for more components

* Convert RecipeRating

* Convert RecipeNutrition

* Convert more components to composition API

* Fix globals plugin for type checking

* Add missing icon types

* Fix vuetify types in Nuxt context

* Use composition API for RecipeActionMenu

* Convert error.vue to composition API

* Convert RecipeContextMenu to composition API

* Use more composition API and type checking in recipe/create

* Convert AppButtonUpload to composition API

* Fix some type checking in RecipeContextMenu

* Remove unused components BaseAutoForm and BaseColorPicker

* Convert RecipeCategoryTagDialog to composition API

* Convert RecipeCardSection to composition API

* Convert RecipeCategoryTagSelector to composition API

* Properly import vuetify type definitions

* Convert BaseButton to composition API

* Convert AutoForm to composition API

* Remove unused requests API file

* Remove static routes from recipe API

* Fix more type errors

* Convert AppHeader to composition API, fixing some search bar focus problems

* Convert RecipeDialogSearch to composition API

* Update API types from pydantic models, handle undefined values

* Improve more typing problems

* Add types to other plugins

* Properly type the CRUD API access

* Fix typing of static image routes

* Fix more typing stuff

* Fix some more typing problems

* Turn off more rules
2022-01-08 21:15:23 -09:00

76 lines
2.1 KiB
Vue

<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> Recipe Data Migrations</template>
Recipes can be migrated from another supported application to Mealie. This is a great way to get started with
Mealie.
</BasePageTitle>
<v-container v-if="report">
<BaseCardSectionTitle :title="report.name"> </BaseCardSectionTitle>
<v-card-text> Report 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 class="pa-6" :colspan="headers.length">{{ item.exception }}</td>
</template>
</v-data-table>
</v-container>
</v-container>
</template>
<script lang="ts">
import { defineComponent, useRoute, reactive, toRefs, onMounted } from "@nuxtjs/composition-api";
import { useUserApi } from "~/composables/api";
export default defineComponent({
setup() {
const route = useRoute();
const id = route.value.params.id;
const api = useUserApi();
const state = reactive({
report: {},
});
async function getReport() {
const { data } = await api.groupReports.getOne(id);
if (data) {
state.report = data;
}
}
onMounted(async () => {
await getReport();
});
const itemHeaders = [
{ text: "Success", value: "success" },
{ text: "Message", value: "message" },
{ text: "Timestamp", value: "timestamp" },
];
return {
...toRefs(state),
id,
itemHeaders,
};
},
});
</script>
<style lang="scss" scoped>
</style>