mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-12 21:35:18 -05:00
feat: Suggest HTML importer on URL importer failure (#6685)
This commit is contained in:
@@ -636,6 +636,8 @@
|
|||||||
"scrape-recipe-suggest-bulk-importer": "Try out the bulk importer",
|
"scrape-recipe-suggest-bulk-importer": "Try out the bulk importer",
|
||||||
"scrape-recipe-have-raw-html-or-json-data": "Have raw HTML or JSON data?",
|
"scrape-recipe-have-raw-html-or-json-data": "Have raw HTML or JSON data?",
|
||||||
"scrape-recipe-you-can-import-from-raw-data-directly": "You can import from raw data directly",
|
"scrape-recipe-you-can-import-from-raw-data-directly": "You can import from raw data directly",
|
||||||
|
"scrape-recipe-website-being-blocked": "Website being blocked?",
|
||||||
|
"scrape-recipe-try-importing-raw-html-instead": "Try importing the raw HTML instead.",
|
||||||
"import-original-keywords-as-tags": "Import original keywords as tags",
|
"import-original-keywords-as-tags": "Import original keywords as tags",
|
||||||
"stay-in-edit-mode": "Stay in Edit mode",
|
"stay-in-edit-mode": "Stay in Edit mode",
|
||||||
"parse-recipe-ingredients-after-import": "Parse recipe ingredients after import",
|
"parse-recipe-ingredients-after-import": "Parse recipe ingredients after import",
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
<p>{{ $t('recipe.scrape-recipe-description') }}</p>
|
<p>{{ $t('recipe.scrape-recipe-description') }}</p>
|
||||||
<p>
|
<p>
|
||||||
{{ $t('recipe.scrape-recipe-have-a-lot-of-recipes') }}
|
{{ $t('recipe.scrape-recipe-have-a-lot-of-recipes') }}
|
||||||
<a :href="bulkImporterTarget">{{ $t('recipe.scrape-recipe-suggest-bulk-importer') }}</a>.
|
<router-link :to="bulkImporterTarget">{{ $t('recipe.scrape-recipe-suggest-bulk-importer') }}</router-link>.
|
||||||
<br>
|
<br>
|
||||||
{{ $t('recipe.scrape-recipe-have-raw-html-or-json-data') }}
|
{{ $t('recipe.scrape-recipe-have-raw-html-or-json-data') }}
|
||||||
<a :href="htmlOrJsonImporterTarget">{{ $t('recipe.scrape-recipe-you-can-import-from-raw-data-directly') }}</a>.
|
<router-link :to="htmlOrJsonImporterTarget">{{ $t('recipe.scrape-recipe-you-can-import-from-raw-data-directly') }}</router-link>.
|
||||||
</p>
|
</p>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="recipeUrl"
|
v-model="recipeUrl"
|
||||||
@@ -81,10 +81,17 @@
|
|||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-divider class="my-3 mx-2" />
|
<v-divider class="my-3 mx-2" />
|
||||||
|
|
||||||
<p>
|
<div class="force-url-white">
|
||||||
{{ $t("new-recipe.error-details") }}
|
<p>
|
||||||
</p>
|
{{ $t("recipe.scrape-recipe-website-being-blocked") }}
|
||||||
<div class="d-flex row justify-space-around my-3 force-white">
|
<router-link :to="htmlOrJsonImporterTarget">{{ $t("recipe.scrape-recipe-try-importing-raw-html-instead") }}</router-link>
|
||||||
|
</p>
|
||||||
|
<br>
|
||||||
|
<p>
|
||||||
|
{{ $t("new-recipe.error-details") }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex row justify-space-around my-3 force-url-white">
|
||||||
<a
|
<a
|
||||||
class="dark"
|
class="dark"
|
||||||
href="https://developers.google.com/search/docs/data-types/recipe"
|
href="https://developers.google.com/search/docs/data-types/recipe"
|
||||||
@@ -202,6 +209,16 @@ export default defineNuxtComponent({
|
|||||||
|
|
||||||
const domUrlForm = ref<VForm | null>(null);
|
const domUrlForm = ref<VForm | null>(null);
|
||||||
|
|
||||||
|
// Remove import URL from query params when leaving the page
|
||||||
|
const isLeaving = ref(false);
|
||||||
|
onBeforeRouteLeave((to) => {
|
||||||
|
if (isLeaving.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isLeaving.value = true;
|
||||||
|
router.replace({ query: undefined }).then(() => router.push(to));
|
||||||
|
});
|
||||||
|
|
||||||
async function createByUrl(url: string | null, importKeywordsAsTags: boolean) {
|
async function createByUrl(url: string | null, importKeywordsAsTags: boolean) {
|
||||||
if (url === null) {
|
if (url === null) {
|
||||||
return;
|
return;
|
||||||
@@ -232,8 +249,8 @@ export default defineNuxtComponent({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style scoped>
|
||||||
.force-white > a {
|
.force-url-white a {
|
||||||
color: white !important;
|
color: white !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user