Add pic upload fail info

This commit is contained in:
Michael Götz 2018-04-16 01:12:58 +02:00
parent ced89650f6
commit 3264a29e4f
4 changed files with 38 additions and 3 deletions

View File

@ -10664,6 +10664,14 @@
"integrity": "sha512-2j/t+wIbyVMP5NvctQoSUvLkYKoWAAk2QlQiilrM2a6/ulzFgdcLUJfTvs4XQ/3eZhHiBmmEojbjmM4AzZj8JA==",
"dev": true
},
"vue-image-crop-upload": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/vue-image-crop-upload/-/vue-image-crop-upload-2.2.3.tgz",
"integrity": "sha1-VHyeeCGGMTaH3sCnRGMlUNqW1zU=",
"requires": {
"babel-runtime": "6.26.0"
}
},
"vue-loader": {
"version": "13.7.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-13.7.1.tgz",
@ -10731,6 +10739,14 @@
"integrity": "sha512-x3LV3wdmmERhVCYy3quqA57NJW7F3i6faas++pJQWtknWT+n7k30F4TVdHvCLn48peTJFRvCpxs3UuFPqgeELg==",
"dev": true
},
"vue-upload-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/vue-upload-file/-/vue-upload-file-1.1.0.tgz",
"integrity": "sha1-AX2psaZ79CLqbvutALSRjFP4u0E=",
"requires": {
"babel-runtime": "6.26.0"
}
},
"vuelidate": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/vuelidate/-/vuelidate-0.6.2.tgz",

View File

@ -15,10 +15,12 @@
"vue": "^2.5.2",
"vue-awesome": "^2.3.5",
"vue-cookies": "^1.5.6",
"vue-image-crop-upload": "^2.2.3",
"vue-multiselect": "^2.1.0",
"vue-rate-it": "^2.1.0",
"vue-router": "^3.0.1",
"vue-star-rating": "^1.5.1",
"vue-upload-file": "^1.1.0",
"vuelidate": "^0.6.2",
"vuex": "^3.0.1"
},

View File

@ -12,6 +12,9 @@
<b-progress :value="uploadProgress" :max="100" variant="success" height="10px"
class="w-100"></b-progress>
</div>
<div v-else-if="error" class="error-response">
<icon :name="'times'" :scale="2" class="error"></icon>
</div>
<div v-else class="success-response">
<icon :name="'check-circle'" :scale="2" class="success"></icon>
</div>
@ -32,6 +35,7 @@
return {
showFileUpload: true,
showProgressBar: false,
error: false,
uploadProgress: 0,
};
},
@ -53,6 +57,7 @@
onSubmit() {
this.showFileUpload = false;
this.showProgressBar = true;
this.error = false;
let url = CONFIG.API_ROOT_FOOD + '/meals/' + this.$route.params.id + '/image';
let config = {
onUploadProgress: (progressEvent) => {
@ -80,6 +85,14 @@
}, 5000);
})
.catch(e => {
this.showProgressBar = false;
this.showFileUpload = false;
this.error = true;
this.uploadProgress = 0;
setTimeout(() => {
this.showFileUpload = true;
this.error = false;
}, 5000);
console.log(e.response);
});
},
@ -92,6 +105,10 @@
color: #57d25f;
}
.error {
color: #d22233;
}
.inputfile {
width: 0.1px;
height: 0.1px;

View File

@ -404,7 +404,7 @@ apple:
search:
terms:
- osx
- food
- foodAppStudWue
styles:
- brands
unicode: f179
@ -5036,7 +5036,7 @@ lemon:
label: Lemon
search:
terms:
- food
- foodAppStudWue
styles:
- solid
- regular
@ -8989,7 +8989,7 @@ utensils:
label: Utensils
search:
terms:
- food
- foodAppStudWue
- restaurant
- spoon
- knife