Skip to content

Commit eb16832

Browse files
author
Antonino Tramontana
committed
added refresh function
1 parent ddc6355 commit eb16832

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

src/components/Settings.vue

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,14 @@
452452
<v-flex xs12 md6 offset-md3>
453453
<h3 class="text-xs-left">Gestione Pacchetti</h3>
454454
<br>
455-
<v-card>
455+
<h3 class="text-xs-left"> Pacchetti installati:</h3>
456+
<v-card v-for="pkgnames in settings.packagesInstalled">
456457
<div class="cardContent">
457-
<h3 class="text-xs-left"> Pacchetti installati:</h3>
458458

459+
<li> nome: <b>{{pkgnames[0][0]}}</b> tipo: <b>{{pkgnames[1]}} </b><span style="display: flex; justify-content: flex-end"><v-btn @click="deletePkg(pkgnames[0][1])" color="red" dark>
460+
<v-icon>fas fa-trash</v-icon> Rimuovi </v-btn></span>
461+
</li>
462+
<!--
459463
<div v-for="pkgnames in settings.packagesInstalled">
460464
<ul>
461465
<li> nome: {{pkgnames[0][0]}} tipo: {{pkgnames[1]}} <span style="display: flex; justify-content: flex-end"><v-btn @click="deletePkg(pkgnames[0][1])" color="red" dark>
@@ -464,19 +468,20 @@
464468
</li>
465469
</ul>
466470
</div>
467-
<br>
471+
-->
472+
</div>
468473
</v-card>
474+
<br>
469475
<h3 class="text-xs-left"> Aggiungi Pacchetto </h3>
470476
<v-card>
471477
<div class="cardContent">
472478
<template v-if="updateStatus==1">
473-
<h3>File Caricato</h3>
479+
<b>Pacchetto installato</b>
474480
<br>
475481
{{ updateStatusText }}
476482
<v-btn @click="refresh" color="error">Aggiorna</v-btn>
477483
</template>
478484
<template v-if="updateStatus==2">
479-
Errore, pacchetto non installato.
480485
</template>
481486
<template v-if="updateStatus==0">
482487
<v-text-field label="Seleziona il pacchetto da installare" @click='pickFile' v-model='fileName' prepend-icon='attach_file'></v-text-field>
@@ -504,7 +509,7 @@
504509
{{ snackText }}
505510
<v-btn color="pink" flat @click="snackbar = false">
506511
Chiudi
507-
</v-btn>
512+
</v-btn
508513
</v-snackbar>
509514
</v-app>
510515
</div>
@@ -571,6 +576,7 @@ export default {
571576
572577
},
573578
579+
574580
uploadPackage() {
575581
let qs = this.$qs
576582
var pkgName = qs.stringify({
@@ -585,7 +591,7 @@ export default {
585591
this.uploadInProgress = false;
586592
console.dir(result.data);
587593
588-
this.updateStatusText = 'Pacchetto installato. Clicca "AGGIORNA" per visualizzare le modifiche.'
594+
this.updateStatusText = 'Clicca "AGGIORNA" per visualizzare le modifiche.'
589595
590596
}.bind(this))
591597
@@ -610,6 +616,19 @@ export default {
610616
}.bind(this))
611617
612618
},
619+
620+
refresh(){
621+
window.location.reload();
622+
/* readTextFile
623+
this.packagesInstalled = packageList
624+
this.$http.get('vue/index.html#/settings').then((results) => {
625+
console.log(results.data.data);
626+
}, (results) => {
627+
console.log('ERROR');
628+
console.log(results);
629+
});
630+
*/
631+
},
613632
614633
/* readTextFile(file, callback) {
615634
var rawFile = new XMLHttpRequest();
@@ -735,6 +754,8 @@ export default {
735754
console.log('Pacchetto rimosso')
736755
this.snackText = "Pacchetto rimosso"
737756
this.snackbar = true
757+
this.packagesInstalled =
758+
window.location.reload();
738759
}.bind(this))
739760
},
740761

0 commit comments

Comments
 (0)