1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

feat: Import + Translate recipe images with OpenAI (#3974)

Co-authored-by: Johan Lindell <johan@lindell.me>
Co-authored-by: boc-the-git <3479092+boc-the-git@users.noreply.github.com>
This commit is contained in:
Michael Genson 2024-08-17 17:07:01 -05:00 committed by GitHub
parent 3d921cb677
commit 8a15f400e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 924 additions and 241 deletions

View file

@ -28,6 +28,7 @@
<script lang="ts">
import { defineComponent, useRouter, useContext, computed, useRoute } from "@nuxtjs/composition-api";
import { useAppInfo } from "~/composables/api";
import { MenuItem } from "~/components/global/BaseOverflowButton.vue";
import AdvancedOnly from "~/components/global/AdvancedOnly.vue";
@ -37,7 +38,10 @@ export default defineComponent({
setup() {
const { $auth, $globals, i18n } = useContext();
const subpages: MenuItem[] = [
const appInfo = useAppInfo();
const enableOpenAIImages = computed(() => appInfo.value?.enableOpenaiImageServices);
const subpages = computed<MenuItem[]>(() => [
{
icon: $globals.icons.link,
text: i18n.tc("recipe.import-with-url"),
@ -48,6 +52,12 @@ export default defineComponent({
text: i18n.tc("recipe.bulk-url-import"),
value: "bulk",
},
{
icon: $globals.icons.fileImage,
text: i18n.tc("recipe.create-from-image"),
value: "image",
hide: !enableOpenAIImages.value,
},
{
icon: $globals.icons.edit,
text: i18n.tc("recipe.create-recipe"),
@ -63,7 +73,7 @@ export default defineComponent({
text: i18n.tc("recipe.debug-scraper"),
value: "debug",
},
];
]);
const route = useRoute();
const router = useRouter();