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

nextcloud migration

This commit is contained in:
Hayden 2021-01-09 18:04:53 -09:00
parent cdad8b054e
commit af87045037
23 changed files with 851 additions and 126 deletions

View file

@ -2,64 +2,42 @@
<v-card :loading="loading">
<v-card-title class="headline"> Recipe Migration </v-card-title>
<v-divider></v-divider>
<v-card-text>
<p>
Currently Chowdown via public Repo URL is the only supported type of
migration
</p>
<v-form>
<v-row dense align="center">
<v-col cols="12" md="5" sm="5">
<v-text-field v-model="repo" label="Chowdown Repo URL">
</v-text-field>
</v-col>
<v-col cols="12" md="4" sm="5">
<v-btn text color="info" @click="importRepo"> Migrate </v-btn>
</v-col>
</v-row>
</v-form>
<v-alert v-if="failedRecipes[1]" outlined dense type="error">
<h4>Failed Recipes</h4>
<v-list dense>
<v-list-item v-for="fail in this.failedRecipes" :key="fail">
{{ fail }}
</v-list-item>
</v-list>
</v-alert>
<v-alert v-if="failedImages[1]" outlined dense type="error">
<h4>Failed Images</h4>
<v-list dense>
<v-list-item v-for="fail in this.failedImages" :key="fail">
{{ fail }}
</v-list-item>
</v-list>
</v-alert>
</v-card-text>
<v-tabs v-model="tab">
<v-tab>Chowdown</v-tab>
<v-tab>Nextcloud Recipes</v-tab>
<v-tab-item>
<ChowdownCard @loading="loading = true" @finished="finished" />
</v-tab-item>
<v-tab-item>
<NextcloudCard @loading="loading = true" @finished="finished" />
</v-tab-item>
</v-tabs>
</v-card>
</template>
<script>
import api from "../../../api";
import ChowdownCard from "./ChowdownCard";
import NextcloudCard from "./NextcloudCard";
// import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
// import TimePicker from "./Webhooks/TimePicker";
export default {
components: {
ChowdownCard,
NextcloudCard,
},
data() {
return {
processRan: false,
tab: null,
loading: false,
failedImages: [],
failedRecipes: [],
repo: "",
};
},
methods: {
async importRepo() {
this.loading = true;
let response = await api.migrations.migrateChowdown(this.repo);
this.failedImages = response.failedImages;
this.failedRecipes = response.failedRecipes;
finished() {
this.loading = false;
this.processRan = true;
this.$store.dispatch("requestRecentRecipes");
},
},
};