Mercurial > gemma
comparison client/src/components/importconfiguration/types/Soundingresults.vue @ 3013:30222bcbfec9
import_configuration: add email option to onetime imports
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 11 Apr 2019 14:37:13 +0200 |
parents | 1b8bb4f89227 |
children | cb3b31566e48 |
comparison
equal
deleted
inserted
replaced
3012:802fcb50c484 | 3013:30222bcbfec9 |
---|---|
87 </div> | 87 </div> |
88 </div> | 88 </div> |
89 </div> | 89 </div> |
90 <div class="mt-3"> | 90 <div class="mt-3"> |
91 <div v-if="uploadState" class="input-group"> | 91 <div v-if="uploadState" class="input-group"> |
92 <div class="custom-file"> | 92 <div :key="1" class="flex-column mr-4"> |
93 <div class="flex-row text-left"> | |
94 <small class="text-muted"> | |
95 <translate>Email Notification</translate> | |
96 </small> | |
97 </div> | |
98 <div class="flex-flex-row text-left"> | |
99 <toggle-button | |
100 v-model="eMailNotification" | |
101 class="mt-2" | |
102 :speed="100" | |
103 :labels="{ | |
104 checked: this.$options.on, | |
105 unchecked: this.$options.off | |
106 }" | |
107 :width="60" | |
108 :height="30" | |
109 /> | |
110 </div> | |
111 </div> | |
112 <div class="custom-file mt-4"> | |
93 <input | 113 <input |
94 accept=".zip" | 114 accept=".zip" |
95 type="file" | 115 type="file" |
96 @change="fileSelected" | 116 @change="fileSelected" |
97 class="custom-file-input" | 117 class="custom-file-input" |
167 importDate: "", | 187 importDate: "", |
168 uploadLabel: this.$gettext("choose .zip- file"), | 188 uploadLabel: this.$gettext("choose .zip- file"), |
169 uploadFile: null, | 189 uploadFile: null, |
170 disableUpload: false, | 190 disableUpload: false, |
171 token: null, | 191 token: null, |
172 messages: [] | 192 messages: [], |
193 eMailNotification: false | |
173 }; | 194 }; |
174 }, | 195 }, |
175 methods: { | 196 methods: { |
176 back() { | 197 back() { |
177 this.$store.commit("importschedule/setListMode"); | 198 this.$store.commit("importschedule/setListMode"); |
184 this.importDate = ""; | 205 this.importDate = ""; |
185 this.uploadLabel = this.$gettext("choose .zip- file"); | 206 this.uploadLabel = this.$gettext("choose .zip- file"); |
186 this.uploadFile = null; | 207 this.uploadFile = null; |
187 this.disableUpload = false; | 208 this.disableUpload = false; |
188 this.token = null; | 209 this.token = null; |
210 this.eMailNotification = false; | |
189 this.messages = []; | 211 this.messages = []; |
190 }, | 212 }, |
191 fileSelected(e) { | 213 fileSelected(e) { |
192 const files = e.target.files || e.dataTransfer.files; | 214 const files = e.target.files || e.dataTransfer.files; |
193 if (!files) return; | 215 if (!files) return; |
213 }); | 235 }); |
214 }, | 236 }, |
215 upload() { | 237 upload() { |
216 let formData = new FormData(); | 238 let formData = new FormData(); |
217 formData.append("soundingresult", this.uploadFile); | 239 formData.append("soundingresult", this.uploadFile); |
240 if (this.eMailNotification) { | |
241 formData.append("send-email", this.eMailNotification); | |
242 } | |
218 HTTP.post("/imports/sr-upload", formData, { | 243 HTTP.post("/imports/sr-upload", formData, { |
219 headers: { | 244 headers: { |
220 "X-Gemma-Auth": localStorage.getItem("token"), | 245 "X-Gemma-Auth": localStorage.getItem("token"), |
221 "Content-Type": "multipart/form-data" | 246 "Content-Type": "multipart/form-data" |
222 } | 247 } |