| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <div> | 
					
						
							|  |  |  |     <v-checkbox | 
					
						
							|  |  |  |       v-for="(option, index) in options" | 
					
						
							|  |  |  |       :key="index" | 
					
						
							|  |  |  |       v-model="option.value" | 
					
						
							|  |  |  |       class="mb-n4 mt-n3" | 
					
						
							|  |  |  |       dense | 
					
						
							|  |  |  |       :label="option.text" | 
					
						
							|  |  |  |       @change="emitValue()" | 
					
						
							|  |  |  |     ></v-checkbox> | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |     <template v-if="importBackup"> | 
					
						
							|  |  |  |       <v-divider class="my-3"></v-divider> | 
					
						
							|  |  |  |       <v-checkbox | 
					
						
							|  |  |  |         v-model="forceImport" | 
					
						
							|  |  |  |         class="mb-n4" | 
					
						
							|  |  |  |         dense | 
					
						
							|  |  |  |         :label="$t('settings.remove-existing-entries-matching-imported-entries')" | 
					
						
							|  |  |  |         @change="emitValue()" | 
					
						
							|  |  |  |       ></v-checkbox> | 
					
						
							|  |  |  |     </template> | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |   </div> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  | <script lang="ts"> | 
					
						
							|  |  |  | import { defineComponent, onMounted, useContext } from "@nuxtjs/composition-api"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  | const UPDATE_EVENT = "input"; | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  | export default defineComponent({ | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |   props: { | 
					
						
							|  |  |  |     importBackup: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: false, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |   setup(_, context) { | 
					
						
							|  |  |  |     const { i18n } = useContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const options = { | 
					
						
							|  |  |  |       recipes: { | 
					
						
							|  |  |  |         value: true, | 
					
						
							|  |  |  |         text: i18n.t("general.recipes"), | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |       }, | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |       users: { | 
					
						
							|  |  |  |         value: true, | 
					
						
							|  |  |  |         text: i18n.t("user.users"), | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       groups: { | 
					
						
							|  |  |  |         value: true, | 
					
						
							|  |  |  |         text: i18n.t("group.groups"), | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     const forceImport = false; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function emitValue() { | 
					
						
							|  |  |  |       context.emit(UPDATE_EVENT, { | 
					
						
							|  |  |  |         recipes: options.recipes.value, | 
					
						
							| 
									
										
										
										
											2021-12-04 14:18:46 -09:00
										 |  |  |         settings: false, | 
					
						
							|  |  |  |         themes: false, | 
					
						
							|  |  |  |         pages: false, | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |         users: options.users.value, | 
					
						
							|  |  |  |         groups: options.groups.value, | 
					
						
							| 
									
										
										
										
											2021-12-04 14:18:46 -09:00
										 |  |  |         notifications: false, | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |         forceImport, | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |       }); | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     onMounted(() => { | 
					
						
							|  |  |  |       emitValue(); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       options, | 
					
						
							|  |  |  |       forceImport, | 
					
						
							|  |  |  |       emitValue, | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  | }); | 
					
						
							|  |  |  | </script> |