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>
|
|
|
|
<v-img max-height="175" max-width="175" :src="require('~/static/svgs/recipes-create.svg')"></v-img>
|
|
|
|
</template>
|
2023-01-29 02:39:51 +01:00
|
|
|
<template #title> {{ $t('recipe.recipe-creation') }} </template>
|
|
|
|
{{ $t('recipe.select-one-of-the-various-ways-to-create-a-recipe') }}
|
2021-10-19 18:45:03 -08:00
|
|
|
<template #content>
|
|
|
|
<div class="ml-auto">
|
2022-05-25 19:08:32 +02:00
|
|
|
<BaseOverflowButton v-model="subpage" rounded :items="subpages"> </BaseOverflowButton>
|
2021-10-19 18:45:03 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</BasePageTitle>
|
|
|
|
<section>
|
2022-05-25 19:08:32 +02:00
|
|
|
<NuxtChild />
|
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">
|
2024-01-09 08:37:22 -06:00
|
|
|
<router-link :to="`/group/migrations`"> {{ $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">
|
2022-05-25 19:08:32 +02:00
|
|
|
import { defineComponent, useRouter, useContext, computed, useRoute } from "@nuxtjs/composition-api";
|
2024-08-17 17:07:01 -05:00
|
|
|
import { useAppInfo } from "~/composables/api";
|
2022-01-16 03:38:11 +01:00
|
|
|
import { 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
|
|
|
|
2021-10-02 11:37:04 -08:00
|
|
|
export default defineComponent({
|
2022-05-25 19:08:32 +02:00
|
|
|
components: { AdvancedOnly },
|
2024-02-02 14:45:30 +00:00
|
|
|
middleware: ["auth", "group-only"],
|
2021-10-02 11:37:04 -08:00
|
|
|
setup() {
|
2023-11-05 19:07:02 -06:00
|
|
|
const { $auth, $globals, i18n } = useContext();
|
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,
|
2023-01-29 02:39:51 +01:00
|
|
|
text: i18n.tc("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,
|
|
|
|
text: i18n.tc("recipe.bulk-url-import"),
|
|
|
|
value: "bulk",
|
|
|
|
},
|
2024-09-30 10:52:13 -05:00
|
|
|
{
|
|
|
|
icon: $globals.icons.codeTags,
|
|
|
|
text: i18n.tc("recipe.import-from-html-or-json"),
|
|
|
|
value: "html",
|
|
|
|
},
|
2024-08-17 17:07:01 -05:00
|
|
|
{
|
|
|
|
icon: $globals.icons.fileImage,
|
|
|
|
text: i18n.tc("recipe.create-from-image"),
|
|
|
|
value: "image",
|
|
|
|
hide: !enableOpenAIImages.value,
|
|
|
|
},
|
2021-10-19 18:45:03 -08:00
|
|
|
{
|
|
|
|
icon: $globals.icons.edit,
|
2023-01-29 02:39:51 +01:00
|
|
|
text: i18n.tc("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,
|
2023-01-29 02:39:51 +01:00
|
|
|
text: i18n.tc("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,
|
2023-01-29 02:39:51 +01:00
|
|
|
text: i18n.tc("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();
|
2023-11-05 19:07:02 -06:00
|
|
|
const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "");
|
2021-10-02 11:37:04 -08:00
|
|
|
|
2022-05-25 19:08:32 +02:00
|
|
|
const subpage = computed({
|
|
|
|
set(subpage: string) {
|
2023-11-05 19:07:02 -06:00
|
|
|
router.push({ path: `/g/${groupSlug.value}/r/create/${subpage}`, query: route.value.query });
|
2022-01-09 07:15:23 +01:00
|
|
|
},
|
|
|
|
get() {
|
2022-05-25 19:08:32 +02:00
|
|
|
return route.value.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
|
|
|
};
|
|
|
|
},
|
2021-10-07 09:39:47 -08:00
|
|
|
head() {
|
|
|
|
return {
|
|
|
|
title: this.$t("general.create") as string,
|
|
|
|
};
|
|
|
|
},
|
2021-10-02 11:37:04 -08:00
|
|
|
});
|
|
|
|
</script>
|