mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
refactor: clean up bag javascript
This commit is contained in:
parent
a58b0d6a19
commit
75d140849b
7 changed files with 67 additions and 52 deletions
|
@ -22,6 +22,7 @@
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<span>
|
<span>
|
||||||
<UploadBtn
|
<UploadBtn
|
||||||
|
class="mt-1"
|
||||||
url="/api/backups/upload/"
|
url="/api/backups/upload/"
|
||||||
@uploaded="getAvailableBackups"
|
@uploaded="getAvailableBackups"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<p>
|
<p>
|
||||||
{{$t('migration.you-can-import-recipes-from-either-a-zip-file-or-a-directory-located-in-the-app-data-migraiton-folder-please-review-the-documentation-to-ensure-your-directory-structure-matches-what-is-expected')}}
|
{{
|
||||||
|
$t(
|
||||||
|
"migration.you-can-import-recipes-from-either-a-zip-file-or-a-directory-located-in-the-app-data-migraiton-folder-please-review-the-documentation-to-ensure-your-directory-structure-matches-what-is-expected"
|
||||||
|
)
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
<v-row align="center">
|
<v-row align="center">
|
||||||
|
@ -13,27 +17,32 @@
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
></v-select>
|
></v-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="2" sm="12">
|
<v-col md="1" sm="12">
|
||||||
<v-btn text color="info" @click="importRecipes"> {{$t('migration.migrate')}} </v-btn>
|
<v-btn-toggle group>
|
||||||
</v-col>
|
<v-btn text color="info" @click="importRecipes">
|
||||||
<v-col cols="12" md="1" sm="12">
|
{{ $t("migration.migrate") }}
|
||||||
<v-btn text color="error" @click="deleteImportValidation">
|
</v-btn>
|
||||||
{{$t('general.delete')}}
|
<v-btn text color="error" @click="deleteImportValidation">
|
||||||
</v-btn>
|
{{ $t("general.delete") }}
|
||||||
<Confirmation
|
</v-btn>
|
||||||
:title="$t('general.delete-data')"
|
<UploadBtn
|
||||||
:message="$t('migration.delete-confirmation')"
|
url="/api/migration/upload/"
|
||||||
color="error"
|
class="mt-1"
|
||||||
icon="mdi-alert-circle"
|
@uploaded="getAvaiableImports"
|
||||||
ref="deleteThemeConfirm"
|
/>
|
||||||
v-on:confirm="deleteImport()"
|
|
||||||
/>
|
<Confirmation
|
||||||
</v-col>
|
:title="$t('general.delete-data')"
|
||||||
</v-row>
|
:message="$t('migration.delete-confirmation')"
|
||||||
<v-row>
|
color="error"
|
||||||
<v-col cols="12" md="5" sm="12">
|
icon="mdi-alert-circle"
|
||||||
<UploadMigrationButton @uploaded="getAvaiableImports" />
|
ref="deleteThemeConfirm"
|
||||||
|
v-on:confirm="deleteImport()"
|
||||||
|
/>
|
||||||
|
</v-btn-toggle>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
<v-spacer></v-spacer>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-form>
|
</v-form>
|
||||||
<SuccessFailureAlert
|
<SuccessFailureAlert
|
||||||
|
@ -48,13 +57,13 @@
|
||||||
<script>
|
<script>
|
||||||
import api from "../../../api";
|
import api from "../../../api";
|
||||||
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
|
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
|
||||||
import UploadMigrationButton from "./UploadMigrationButton";
|
|
||||||
import Confirmation from "../../UI/Confirmation";
|
import Confirmation from "../../UI/Confirmation";
|
||||||
|
import UploadBtn from "../../UI/UploadBtn";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SuccessFailureAlert,
|
SuccessFailureAlert,
|
||||||
UploadMigrationButton,
|
|
||||||
Confirmation,
|
Confirmation,
|
||||||
|
UploadBtn,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -63,7 +72,7 @@ export default {
|
||||||
availableImports: [],
|
availableImports: [],
|
||||||
selectedImport: null,
|
selectedImport: null,
|
||||||
rules: {
|
rules: {
|
||||||
required: (v) => !!v || "Selection Required",
|
required: v => !!v || "Selection Required",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
<v-form ref="form" lazy-validation>
|
<v-form ref="form" lazy-validation>
|
||||||
<v-row dense align="center">
|
<v-row dense align="center">
|
||||||
<v-col cols="12" md="4" sm="3">
|
<v-col md="4" sm="3">
|
||||||
<v-select
|
<v-select
|
||||||
:label="$t('settings.theme.saved-color-theme')"
|
:label="$t('settings.theme.saved-color-theme')"
|
||||||
:items="availableThemes"
|
:items="availableThemes"
|
||||||
|
@ -51,18 +51,18 @@
|
||||||
return-object
|
return-object
|
||||||
v-model="selectedTheme"
|
v-model="selectedTheme"
|
||||||
@change="themeSelected"
|
@change="themeSelected"
|
||||||
:rules="[(v) => !!v || $t('settings.theme.theme-is-required')]"
|
:rules="[v => !!v || $t('settings.theme.theme-is-required')]"
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
</v-select>
|
</v-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" sm="1">
|
<v-col>
|
||||||
<NewThemeDialog @new-theme="appendTheme" />
|
<v-btn-toggle group>
|
||||||
</v-col>
|
<NewThemeDialog @new-theme="appendTheme" class="mt-1" />
|
||||||
<v-col cols="12" sm="1">
|
<v-btn text color="error" @click="deleteSelectedThemeValidation">
|
||||||
<v-btn text color="error" @click="deleteSelectedThemeValidation">
|
Delete
|
||||||
Delete
|
</v-btn>
|
||||||
</v-btn>
|
</v-btn-toggle>
|
||||||
<Confirmation
|
<Confirmation
|
||||||
:title="$t('settings.theme.delete-theme')"
|
:title="$t('settings.theme.delete-theme')"
|
||||||
:message="
|
:message="
|
||||||
|
@ -74,6 +74,7 @@
|
||||||
v-on:confirm="deleteSelectedTheme()"
|
v-on:confirm="deleteSelectedTheme()"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-form>
|
</v-form>
|
||||||
<v-row dense align-content="center" v-if="selectedTheme.colors">
|
<v-row dense align-content="center" v-if="selectedTheme.colors">
|
||||||
|
@ -123,15 +124,10 @@
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-row>
|
<v-spacer></v-spacer>
|
||||||
<v-col> </v-col>
|
<v-btn color="success" @click="saveThemes" class="mr-2">
|
||||||
<v-col></v-col>
|
{{ $t("general.save") }}
|
||||||
<v-col align="end">
|
</v-btn>
|
||||||
<v-btn text color="success" @click="saveThemes">
|
|
||||||
{{ $t("settings.theme.save-colors-and-apply-theme") }}
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
@ -187,7 +183,7 @@ export default {
|
||||||
//Change to default if deleting current theme.
|
//Change to default if deleting current theme.
|
||||||
if (
|
if (
|
||||||
!this.availableThemes.some(
|
!this.availableThemes.some(
|
||||||
(theme) => theme.name === this.selectedTheme.name
|
theme => theme.name === this.selectedTheme.name
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
await this.$store.dispatch("resetTheme");
|
await this.$store.dispatch("resetTheme");
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-title class="headline">
|
<v-card-title class="headline">
|
||||||
{{$t('settings.webhooks.meal-planner-webhooks')}}
|
{{ $t("settings.webhooks.meal-planner-webhooks") }}
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<p v-html="$t('settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at', {time: time})"></p>
|
<p
|
||||||
|
v-html="
|
||||||
|
$t(
|
||||||
|
'settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at',
|
||||||
|
{ time: time }
|
||||||
|
)
|
||||||
|
"
|
||||||
|
></p>
|
||||||
|
|
||||||
<v-row dense align="center">
|
<v-row dense align="center">
|
||||||
<v-col cols="12" md="2" sm="5">
|
<v-col cols="12" md="2" sm="5">
|
||||||
|
@ -19,7 +26,9 @@
|
||||||
<TimePickerDialog @save-time="saveTime" />
|
<TimePickerDialog @save-time="saveTime" />
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="4" sm="5">
|
<v-col cols="12" md="4" sm="5">
|
||||||
<v-btn text color="info" @click="testWebhooks"> {{$t('settings.webhooks.test-webhooks')}} </v-btn>
|
<v-btn text color="info" @click="testWebhooks">
|
||||||
|
{{ $t("settings.webhooks.test-webhooks") }}
|
||||||
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
@ -46,8 +55,8 @@
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col> </v-col>
|
<v-col> </v-col>
|
||||||
<v-col align="end">
|
<v-col align="end">
|
||||||
<v-btn text color="success" @click="saveWebhooks">
|
<v-btn color="success" @click="saveWebhooks" class="mr-2 mb-1">
|
||||||
{{$t('settings.webhooks.save-webhooks')}}
|
{{ $t("settings.webhooks.save-webhooks") }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
@click="onButtonClick"
|
@click="onButtonClick"
|
||||||
color="success"
|
color="success"
|
||||||
text
|
text
|
||||||
class="ma-2 white--text"
|
|
||||||
>
|
>
|
||||||
<v-icon left dark> mdi-cloud-upload </v-icon>
|
<v-icon left > mdi-cloud-upload </v-icon>
|
||||||
Upload
|
Upload
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-form>
|
</v-form>
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Paste in your recipe data. Each line will be treated as an item in a list"
|
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Paste in your recipe data. Each line will be treated as an item in a list"
|
||||||
},
|
},
|
||||||
"general": {
|
"general": {
|
||||||
|
"upload": "Upload",
|
||||||
"submit": "Submit",
|
"submit": "Submit",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
|
|
|
@ -109,7 +109,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
editPlan(id) {
|
editPlan(id) {
|
||||||
this.plannedMeals.forEach((element) => {
|
this.plannedMeals.forEach(element => {
|
||||||
if (element.uid === id) {
|
if (element.uid === id) {
|
||||||
this.editMealPlan = element;
|
this.editMealPlan = element;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue