2021-10-02 11:37:04 -08:00
|
|
|
<template>
|
2021-10-19 18:45:03 -08:00
|
|
|
<div>
|
2022-05-25 19:08:32 +02:00
|
|
|
<v-container class="flex-column">
|
2021-10-19 18:45:03 -08:00
|
|
|
<BasePageTitle divider>
|
|
|
|
<template #header>
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-img
|
|
|
|
width="100%"
|
|
|
|
max-height="175"
|
|
|
|
max-width="175"
|
|
|
|
:src="require('~/static/svgs/recipes-create.svg')"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template #title>
|
|
|
|
{{ $t('recipe.recipe-creation') }}
|
2021-10-19 18:45:03 -08:00
|
|
|
</template>
|
|
|
|
<template #content>
|
2025-06-20 00:09:12 +07:00
|
|
|
<div class="flex-1-1 d-flex flex-column justify-center align-center ga-2">
|
|
|
|
<p>{{ $t('recipe.select-one-of-the-various-ways-to-create-a-recipe') }}</p>
|
|
|
|
<div class="ml-auto">
|
|
|
|
<BaseOverflowButton
|
|
|
|
v-model="subpage"
|
|
|
|
rounded
|
|
|
|
:items="subpages"
|
|
|
|
/>
|
|
|
|
</div>
|
2021-10-19 18:45:03 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</BasePageTitle>
|
|
|
|
<section>
|
2025-06-20 00:09:12 +07:00
|
|
|
<NuxtPage />
|
2021-10-28 19:28:33 -08:00
|
|
|
</section>
|
2021-10-19 18:45:03 -08:00
|
|
|
</v-container>
|
2021-12-09 19:52:53 -09:00
|
|
|
|
2022-04-01 11:05:25 -08:00
|
|
|
<AdvancedOnly>
|
2023-10-07 21:36:47 +02:00
|
|
|
<v-container class="d-flex justify-center align-center my-4">
|
2025-06-20 00:09:12 +07:00
|
|
|
<router-link
|
|
|
|
:to="`/group/migrations`"
|
|
|
|
class="text-primary"
|
|
|
|
> {{ $t('recipe.looking-for-migrations') }}</router-link>
|
2022-04-01 11:05:25 -08:00
|
|
|
</v-container>
|
|
|
|
</AdvancedOnly>
|
2021-10-19 18:45:03 -08:00
|
|
|
</div>
|
2021-10-02 11:37:04 -08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2024-08-17 17:07:01 -05:00
|
|
|
import { useAppInfo } from "~/composables/api";
|
2025-06-20 00:09:12 +07:00
|
|
|
import type { MenuItem } from "~/components/global/BaseOverflowButton.vue";
|
2022-04-01 11:05:25 -08:00
|
|
|
import AdvancedOnly from "~/components/global/AdvancedOnly.vue";
|
2022-01-09 07:15:23 +01:00
|
|
|
|
2025-06-20 00:09:12 +07:00
|
|
|
export default defineNuxtComponent({
|
2022-05-25 19:08:32 +02:00
|
|
|
components: { AdvancedOnly },
|
2025-06-20 00:09:12 +07:00
|
|
|
middleware: ["sidebase-auth", "group-only"],
|
2021-10-02 11:37:04 -08:00
|
|
|
setup() {
|
2025-06-20 00:09:12 +07:00
|
|
|
const i18n = useI18n();
|
|
|
|
const $auth = useMealieAuth();
|
|
|
|
const $globals = useNuxtApp().$globals;
|
|
|
|
|
|
|
|
useSeoMeta({
|
|
|
|
title: i18n.t("general.create"),
|
|
|
|
});
|
2021-10-16 16:06:13 -08:00
|
|
|
|
2024-08-17 17:07:01 -05:00
|
|
|
const appInfo = useAppInfo();
|
|
|
|
const enableOpenAIImages = computed(() => appInfo.value?.enableOpenaiImageServices);
|
|
|
|
|
|
|
|
const subpages = computed<MenuItem[]>(() => [
|
2021-10-16 16:06:13 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.link,
|
2025-06-20 00:09:12 +07:00
|
|
|
text: i18n.t("recipe.import-with-url"),
|
2021-10-16 16:06:13 -08:00
|
|
|
value: "url",
|
|
|
|
},
|
2024-01-09 08:37:22 -06:00
|
|
|
{
|
|
|
|
icon: $globals.icons.link,
|
2025-06-20 00:09:12 +07:00
|
|
|
text: i18n.t("recipe.bulk-url-import"),
|
2024-01-09 08:37:22 -06:00
|
|
|
value: "bulk",
|
|
|
|
},
|
2024-09-30 10:52:13 -05:00
|
|
|
{
|
|
|
|
icon: $globals.icons.codeTags,
|
2025-06-20 00:09:12 +07:00
|
|
|
text: i18n.t("recipe.import-from-html-or-json"),
|
2024-09-30 10:52:13 -05:00
|
|
|
value: "html",
|
|
|
|
},
|
2024-08-17 17:07:01 -05:00
|
|
|
{
|
|
|
|
icon: $globals.icons.fileImage,
|
2025-06-28 22:11:12 +02:00
|
|
|
text: i18n.t("recipe.create-from-images"),
|
2024-08-17 17:07:01 -05:00
|
|
|
value: "image",
|
|
|
|
hide: !enableOpenAIImages.value,
|
|
|
|
},
|
2021-10-19 18:45:03 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.edit,
|
2025-06-20 00:09:12 +07:00
|
|
|
text: i18n.t("recipe.create-recipe"),
|
2021-10-19 18:45:03 -08:00
|
|
|
value: "new",
|
|
|
|
},
|
2021-10-16 16:06:13 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.zip,
|
2025-06-20 00:09:12 +07:00
|
|
|
text: i18n.t("recipe.import-with-zip"),
|
2021-10-16 16:06:13 -08:00
|
|
|
value: "zip",
|
|
|
|
},
|
2021-10-19 18:45:03 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.robot,
|
2025-06-20 00:09:12 +07:00
|
|
|
text: i18n.t("recipe.debug-scraper"),
|
2021-10-19 18:45:03 -08:00
|
|
|
value: "debug",
|
|
|
|
},
|
2024-08-17 17:07:01 -05:00
|
|
|
]);
|
2021-10-16 16:06:13 -08:00
|
|
|
|
2022-01-09 07:15:23 +01:00
|
|
|
const route = useRoute();
|
2021-10-02 11:37:04 -08:00
|
|
|
const router = useRouter();
|
2025-06-20 00:09:12 +07:00
|
|
|
const groupSlug = computed(() => route.params.groupSlug || $auth.user.value?.groupSlug || "");
|
2021-10-02 11:37:04 -08:00
|
|
|
|
2022-05-25 19:08:32 +02:00
|
|
|
const subpage = computed({
|
|
|
|
set(subpage: string) {
|
2025-06-20 00:09:12 +07:00
|
|
|
router.push({ path: `/g/${groupSlug.value}/r/create/${subpage}`, query: route.query });
|
2022-01-09 07:15:23 +01:00
|
|
|
},
|
|
|
|
get() {
|
2025-06-20 00:09:12 +07:00
|
|
|
return route.path.split("/").pop() ?? "url";
|
2022-01-09 07:15:23 +01:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-10-02 11:37:04 -08:00
|
|
|
return {
|
2023-11-05 19:07:02 -06:00
|
|
|
groupSlug,
|
2022-05-25 19:08:32 +02:00
|
|
|
subpages,
|
|
|
|
subpage,
|
2021-10-02 11:37:04 -08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|