Skip to content

Commit 5144b6e

Browse files
committed
Upload/Update UI improvements
1 parent 6a72b9d commit 5144b6e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/components/Settings.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,18 @@
7979
<v-card>
8080
<div class="cardContent">
8181
<template v-if="updateStatus==1">
82-
{{ counter }} %
82+
<h3>{{ counter }} %</h3>
83+
<br>
84+
{{ updateStatusText }}
8385

8486
</template>
8587
<template v-if="updateStatus==2">
86-
{{ updateStatusText }}
88+
8789
</template>
8890
<template v-if="updateStatus==0">
8991
<v-text-field label="Seleziona il pacchetto di aggiornamento" @click='pickFile' v-model='fileName' prepend-icon='attach_file'></v-text-field>
9092
<input type="file" style="display: none" ref="file" @change="onFilePicked">
91-
<v-btn @click="upload" color="error">Conferma</v-btn>
93+
<v-btn v-if="this.fileObj" @click="upload" color="error">Conferma</v-btn>
9294
</template>
9395
</div>
9496
</v-card>
@@ -270,17 +272,21 @@ export default {
270272
headers: { 'Content-Type': 'multipart/form-data' },
271273
onUploadProgress: progressEvent => {
272274
this.counter = Math.floor((progressEvent.loaded * 100) / progressEvent.total);
275+
if (this.counter == 100){
276+
this.updateStatusText = 'Upload completato. Aggiornamento in corso...'
277+
}
273278
}
274279
}
275280
this.updateStatus = 1
276-
this.$axios.post(this.CB + '/uploadFile', formdata, config).then(result => {
281+
282+
this.$axios.post(this.CB + '/uploadFile', formdata, config).then(function(result) {
277283
this.uploadCompleted = true;
278284
this.uploadInProgress = false;
279285
console.dir(result.data);
280-
this.updateStatus = 2
286+
281287
this.updateStatusText = 'Upload completato. Aggiornamento in corso...'
282288
283-
})
289+
}.bind(this))
284290
285291
},
286292
restoreConfig() {

0 commit comments

Comments
 (0)