31
31
<v-card-title class =" mt-0" > {{ $t('general.upload-file') }} </v-card-title >
32
32
<v-card-text >
33
33
<AppButtonUpload
34
- accept =" . zip"
34
+ : accept =" content.acceptedFileType || '. zip' "
35
35
class =" mb-2"
36
36
:post =" false"
37
37
file-name =" file"
@@ -75,13 +75,14 @@ import { useUserApi } from "~/composables/api";
75
75
import { SupportedMigrations } from " ~/lib/api/types/group" ;
76
76
77
77
const MIGRATIONS = {
78
- nextcloud : " nextcloud " ,
78
+ mealie : " mealie_alpha " ,
79
79
chowdown: " chowdown" ,
80
80
copymethat: " copymethat" ,
81
+ myrecipebox: " myrecipebox" ,
82
+ nextcloud: " nextcloud" ,
81
83
paprika: " paprika" ,
82
- mealie: " mealie_alpha" ,
83
- tandoor: " tandoor" ,
84
84
plantoeat: " plantoeat" ,
85
+ tandoor: " tandoor" ,
85
86
};
86
87
87
88
export default defineComponent ({
@@ -95,15 +96,16 @@ export default defineComponent({
95
96
addMigrationTag: false ,
96
97
loading: false ,
97
98
treeState: true ,
98
- migrationType: MIGRATIONS .nextcloud as SupportedMigrations ,
99
+ migrationType: MIGRATIONS .mealie as SupportedMigrations ,
99
100
fileObject: {} as File ,
100
101
reports: [] as ReportSummary [],
101
102
});
102
103
103
104
const items: MenuItem [] = [
104
105
{
105
- text: i18n .tc (" migration.nextcloud.title" ),
106
- value: MIGRATIONS .nextcloud ,
106
+ text: i18n .tc (" migration.mealie-pre-v1.title" ),
107
+ value: MIGRATIONS .mealie ,
108
+ divider: true ,
107
109
},
108
110
{
109
111
text: i18n .tc (" migration.chowdown.title" ),
@@ -114,50 +116,77 @@ export default defineComponent({
114
116
value: MIGRATIONS .copymethat ,
115
117
},
116
118
{
117
- text: i18n .tc (" migration.paprika .title" ),
118
- value: MIGRATIONS .paprika ,
119
+ text: i18n .tc (" migration.myrecipebox .title" ),
120
+ value: MIGRATIONS .myrecipebox ,
119
121
},
120
122
{
121
- text: i18n .tc (" migration.mealie-pre-v1 .title" ),
122
- value: MIGRATIONS .mealie ,
123
+ text: i18n .tc (" migration.nextcloud .title" ),
124
+ value: MIGRATIONS .nextcloud ,
123
125
},
124
126
{
125
- text: i18n .tc (" migration.tandoor .title" ),
126
- value: MIGRATIONS .tandoor ,
127
+ text: i18n .tc (" migration.paprika .title" ),
128
+ value: MIGRATIONS .paprika ,
127
129
},
128
130
{
129
131
text: i18n .tc (" migration.plantoeat.title" ),
130
132
value: MIGRATIONS .plantoeat ,
131
133
},
134
+ {
135
+ text: i18n .tc (" migration.tandoor.title" ),
136
+ value: MIGRATIONS .tandoor ,
137
+ },
132
138
];
133
-
134
139
const _content = {
135
- [MIGRATIONS .nextcloud ]: {
136
- text: i18n .tc (" migration.nextcloud.description-long" ),
140
+ [MIGRATIONS .mealie ]: {
141
+ text: i18n .tc (" migration.mealie-pre-v1.description-long" ),
142
+ acceptedFileType: " .zip" ,
137
143
tree: [
138
144
{
139
145
id: 1 ,
140
146
icon: $globals .icons .zip ,
141
- name: " nextcloud .zip" ,
147
+ name: " mealie .zip" ,
142
148
children: [
143
149
{
144
150
id: 2 ,
145
- name: i18n .t (" migration.recipe-1" ),
146
- icon: $globals .icons .folderOutline ,
147
- children: [
148
- { id: 3 , name: " recipe.json" , icon: $globals .icons .codeJson },
149
- { id: 4 , name: " full.jpg" , icon: $globals .icons .fileImage },
150
- { id: 5 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
151
- ],
152
- },
153
- {
154
- id: 6 ,
155
- name: i18n .t (" migration.recipe-2" ),
151
+ name: " recipes" ,
156
152
icon: $globals .icons .folderOutline ,
157
153
children: [
158
- { id: 7 , name: " recipe.json" , icon: $globals .icons .codeJson },
159
- { id: 8 , name: " full.jpg" , icon: $globals .icons .fileImage },
160
- { id: 9 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
154
+ {
155
+ id: 3 ,
156
+ name: " recipe-name" ,
157
+ icon: $globals .icons .folderOutline ,
158
+ children: [
159
+ { id: 4 , name: " recipe-name.json" , icon: $globals .icons .codeJson },
160
+ {
161
+ id: 5 ,
162
+ name: " images" ,
163
+ icon: $globals .icons .folderOutline ,
164
+ children: [
165
+ { id: 6 , name: " original.webp" , icon: $globals .icons .codeJson },
166
+ { id: 7 , name: " full.jpg" , icon: $globals .icons .fileImage },
167
+ { id: 8 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
168
+ ],
169
+ },
170
+ ],
171
+ },
172
+ {
173
+ id: 9 ,
174
+ name: " recipe-name-1" ,
175
+ icon: $globals .icons .folderOutline ,
176
+ children: [
177
+ { id: 10 , name: " recipe-name-1.json" , icon: $globals .icons .codeJson },
178
+ {
179
+ id: 11 ,
180
+ name: " images" ,
181
+ icon: $globals .icons .folderOutline ,
182
+ children: [
183
+ { id: 12 , name: " original.webp" , icon: $globals .icons .codeJson },
184
+ { id: 13 , name: " full.jpg" , icon: $globals .icons .fileImage },
185
+ { id: 14 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
186
+ ],
187
+ },
188
+ ],
189
+ },
161
190
],
162
191
},
163
192
],
@@ -166,6 +195,7 @@ export default defineComponent({
166
195
},
167
196
[MIGRATIONS .chowdown ]: {
168
197
text: i18n .tc (" migration.chowdown.description-long" ),
198
+ acceptedFileType: " .zip" ,
169
199
tree: [
170
200
{
171
201
id: 1 ,
@@ -198,6 +228,7 @@ export default defineComponent({
198
228
},
199
229
[MIGRATIONS .copymethat ]: {
200
230
text: i18n .tc (" migration.copymethat.description-long" ),
231
+ acceptedFileType: " .zip" ,
201
232
tree: [
202
233
{
203
234
id: 1 ,
@@ -219,67 +250,66 @@ export default defineComponent({
219
250
}
220
251
],
221
252
},
222
- [MIGRATIONS .paprika ]: {
223
- text: i18n .tc (" migration.paprika.description-long" ),
253
+ [MIGRATIONS .myrecipebox ]: {
254
+ text: i18n .tc (" migration.myrecipebox.description-long" ),
255
+ acceptedFileType: " .csv" ,
224
256
tree: false ,
225
257
},
226
- [MIGRATIONS .mealie ]: {
227
- text: i18n .tc (" migration.mealie-pre-v1.description-long" ),
258
+ [MIGRATIONS .nextcloud ]: {
259
+ text: i18n .tc (" migration.nextcloud.description-long" ),
260
+ acceptedFileType: " .zip" ,
228
261
tree: [
229
262
{
230
263
id: 1 ,
231
264
icon: $globals .icons .zip ,
232
- name: " mealie .zip" ,
265
+ name: " nextcloud .zip" ,
233
266
children: [
234
267
{
235
268
id: 2 ,
236
- name: " recipes " ,
269
+ name: i18n . t ( " migration.recipe-1 " ) ,
237
270
icon: $globals .icons .folderOutline ,
238
271
children: [
239
- {
240
- id: 3 ,
241
- name: " recipe-name" ,
242
- icon: $globals .icons .folderOutline ,
243
- children: [
244
- { id: 4 , name: " recipe-name.json" , icon: $globals .icons .codeJson },
245
- {
246
- id: 5 ,
247
- name: " images" ,
248
- icon: $globals .icons .folderOutline ,
249
- children: [
250
- { id: 6 , name: " original.webp" , icon: $globals .icons .codeJson },
251
- { id: 7 , name: " full.jpg" , icon: $globals .icons .fileImage },
252
- { id: 8 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
253
- ],
254
- },
255
- ],
256
- },
257
- {
258
- id: 9 ,
259
- name: " recipe-name-1" ,
260
- icon: $globals .icons .folderOutline ,
261
- children: [
262
- { id: 10 , name: " recipe-name-1.json" , icon: $globals .icons .codeJson },
263
- {
264
- id: 11 ,
265
- name: " images" ,
266
- icon: $globals .icons .folderOutline ,
267
- children: [
268
- { id: 12 , name: " original.webp" , icon: $globals .icons .codeJson },
269
- { id: 13 , name: " full.jpg" , icon: $globals .icons .fileImage },
270
- { id: 14 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
271
- ],
272
- },
273
- ],
274
- },
272
+ { id: 3 , name: " recipe.json" , icon: $globals .icons .codeJson },
273
+ { id: 4 , name: " full.jpg" , icon: $globals .icons .fileImage },
274
+ { id: 5 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
275
+ ],
276
+ },
277
+ {
278
+ id: 6 ,
279
+ name: i18n .t (" migration.recipe-2" ),
280
+ icon: $globals .icons .folderOutline ,
281
+ children: [
282
+ { id: 7 , name: " recipe.json" , icon: $globals .icons .codeJson },
283
+ { id: 8 , name: " full.jpg" , icon: $globals .icons .fileImage },
284
+ { id: 9 , name: " thumb.jpg" , icon: $globals .icons .fileImage },
275
285
],
276
286
},
277
287
],
278
288
},
279
289
],
280
290
},
291
+ [MIGRATIONS .paprika ]: {
292
+ text: i18n .tc (" migration.paprika.description-long" ),
293
+ acceptedFileType: " .zip" ,
294
+ tree: false ,
295
+ },
296
+ [MIGRATIONS .plantoeat ]: {
297
+ text: i18n .tc (" migration.plantoeat.description-long" ),
298
+ acceptedFileType: " .zip" ,
299
+ tree: [
300
+ {
301
+ id: 1 ,
302
+ icon: $globals .icons .zip ,
303
+ name: " plantoeat-recipes-508318_10-13-2023.zip" ,
304
+ children: [
305
+ { id: 9 , name: " plantoeat-recipes-508318_10-13-2023.csv" , icon: $globals .icons .codeJson },
306
+ ],
307
+ }
308
+ ],
309
+ },
281
310
[MIGRATIONS .tandoor ]: {
282
311
text: i18n .tc (" migration.tandoor.description-long" ),
312
+ acceptedFileType: " .zip" ,
283
313
tree: [
284
314
{
285
315
id: 1 ,
@@ -317,19 +347,6 @@ export default defineComponent({
317
347
}
318
348
],
319
349
},
320
- [MIGRATIONS .plantoeat ]: {
321
- text: i18n .tc (" migration.plantoeat.description-long" ),
322
- tree: [
323
- {
324
- id: 1 ,
325
- icon: $globals .icons .zip ,
326
- name: " plantoeat-recipes-508318_10-13-2023.zip" ,
327
- children: [
328
- { id: 9 , name: " plantoeat-recipes-508318_10-13-2023.csv" , icon: $globals .icons .codeJson },
329
- ],
330
- }
331
- ],
332
- },
333
350
};
334
351
335
352
function setFileObject(fileObject : File ) {
@@ -378,6 +395,7 @@ export default defineComponent({
378
395
} else {
379
396
return {
380
397
text: " " ,
398
+ acceptedFileType: " .zip" ,
381
399
tree: false ,
382
400
};
383
401
}
0 commit comments