mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 15:49:42 +02:00
fixed backup bug + removed console.logs
This commit is contained in:
parent
b8f7b58da3
commit
1559b015af
8 changed files with 56 additions and 10 deletions
|
@ -19,8 +19,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async import(fileName) {
|
async import(fileName) {
|
||||||
apiReq.post(backupURLs.importBackup(fileName));
|
let response = await apiReq.post(backupURLs.importBackup(fileName));
|
||||||
store.dispatch("requestRecentRecipes");
|
store.dispatch("requestRecentRecipes");
|
||||||
|
return response;
|
||||||
},
|
},
|
||||||
|
|
||||||
async delete(fileName) {
|
async delete(fileName) {
|
||||||
|
|
|
@ -12,7 +12,6 @@ export default {
|
||||||
async migrateChowdown(repoURL) {
|
async migrateChowdown(repoURL) {
|
||||||
let postBody = { url: repoURL };
|
let postBody = { url: repoURL };
|
||||||
let response = await apiReq.post(migrationURLs.chowdownURL, postBody);
|
let response = await apiReq.post(migrationURLs.chowdownURL, postBody);
|
||||||
console.log(response);
|
|
||||||
store.dispatch("requestRecentRecipes");
|
store.dispatch("requestRecentRecipes");
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
:items="availableTemplates"
|
:items="availableTemplates"
|
||||||
v-model="selectedTemplate"
|
v-model="selectedTemplate"
|
||||||
></v-combobox>
|
></v-combobox>
|
||||||
</v-col>
|
</v-col>0
|
||||||
<v-col dense cols="12" sm="12" md="2">
|
<v-col dense cols="12" sm="12" md="2">
|
||||||
<v-btn block color="accent" @click="createBackup" width="165">
|
<v-btn block color="accent" @click="createBackup" width="165">
|
||||||
Backup Recipes
|
Backup Recipes
|
||||||
|
@ -56,16 +56,28 @@
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
<SuccessFailureAlert
|
||||||
|
success-header="Successfully Imported"
|
||||||
|
:success="successfulImports"
|
||||||
|
failed-header="Failed Imports"
|
||||||
|
:failed="failedImports"
|
||||||
|
/>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from "../../../api";
|
import api from "../../../api";
|
||||||
|
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
SuccessFailureAlert,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
failedImports: [],
|
||||||
|
successfulImports: [],
|
||||||
backupLoading: false,
|
backupLoading: false,
|
||||||
backupTag: null,
|
backupTag: null,
|
||||||
selectedBackup: null,
|
selectedBackup: null,
|
||||||
|
@ -83,11 +95,15 @@ export default {
|
||||||
this.availableBackups = response.imports;
|
this.availableBackups = response.imports;
|
||||||
this.availableTemplates = response.templates;
|
this.availableTemplates = response.templates;
|
||||||
},
|
},
|
||||||
importBackup() {
|
async importBackup() {
|
||||||
if (this.$refs.form.validate()) {
|
if (this.$refs.form.validate()) {
|
||||||
this.backupLoading = true;
|
this.backupLoading = true;
|
||||||
|
|
||||||
api.backups.import(this.selectedBackup);
|
let response = await api.backups.import(this.selectedBackup);
|
||||||
|
console.log(response.data);
|
||||||
|
this.failedImports = response.data.failed;
|
||||||
|
this.successfulImports = response.data.successful;
|
||||||
|
|
||||||
this.backupLoading = false;
|
this.backupLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from "../../../api";
|
import api from "../../../api";
|
||||||
|
// import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
|
||||||
// import TimePicker from "./Webhooks/TimePicker";
|
// import TimePicker from "./Webhooks/TimePicker";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -150,7 +150,6 @@ export default {
|
||||||
this.availableThemes = await api.themes.requestAll();
|
this.availableThemes = await api.themes.requestAll();
|
||||||
this.selectedTheme = this.$store.getters.getActiveTheme;
|
this.selectedTheme = this.$store.getters.getActiveTheme;
|
||||||
this.selectedDarkMode = this.$store.getters.getDarkMode;
|
this.selectedDarkMode = this.$store.getters.getDarkMode;
|
||||||
console.log(this.selectedDarkMode);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -201,7 +200,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
setStoresDarkMode() {
|
setStoresDarkMode() {
|
||||||
console.log(this.selectedDarkMode);
|
|
||||||
this.$store.commit("setDarkMode", this.selectedDarkMode);
|
this.$store.commit("setDarkMode", this.selectedDarkMode);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
34
frontend/src/components/UI/SuccessFailureAlert.vue
Normal file
34
frontend/src/components/UI/SuccessFailureAlert.vue
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<v-alert v-if="success[0]" outlined dense type="success">
|
||||||
|
<h4>{{ successHeader }}</h4>
|
||||||
|
<v-list dense>
|
||||||
|
<v-list-item v-for="success in this.success" :key="success">
|
||||||
|
{{ success }}
|
||||||
|
</v-list-item>
|
||||||
|
</v-list>
|
||||||
|
</v-alert>
|
||||||
|
<v-alert v-if="failed[0]" outlined dense type="error">
|
||||||
|
<h4>{{ failedHeader }}</h4>
|
||||||
|
<v-list dense>
|
||||||
|
<v-list-item v-for="fail in this.failed" :key="fail">
|
||||||
|
{{ fail }}
|
||||||
|
</v-list-item>
|
||||||
|
</v-list>
|
||||||
|
</v-alert>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
successHeader: String,
|
||||||
|
success: Array,
|
||||||
|
failedHeader: String,
|
||||||
|
failed: Array,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
|
@ -55,7 +55,6 @@ export default {
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.mealPlan = await api.mealPlans.thisWeek();
|
this.mealPlan = await api.mealPlans.thisWeek();
|
||||||
console.log(this.mealPlan);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getOrder(index) {
|
getOrder(index) {
|
||||||
|
|
|
@ -56,7 +56,6 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
newVersion() {
|
newVersion() {
|
||||||
if ((this.latestVersion != null) & (this.latestVersion != this.version)) {
|
if ((this.latestVersion != null) & (this.latestVersion != this.version)) {
|
||||||
console.log("New Version Avaiable");
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -68,7 +67,6 @@ export default {
|
||||||
let response = await axios.get(
|
let response = await axios.get(
|
||||||
"https://api.github.com/repos/hay-kot/mealie/releases/latest"
|
"https://api.github.com/repos/hay-kot/mealie/releases/latest"
|
||||||
);
|
);
|
||||||
console.log(response);
|
|
||||||
this.latestVersion = response.data.tag_name;
|
this.latestVersion = response.data.tag_name;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue