Skip to content

Commit dd83918

Browse files
committed
Fix log modal
1 parent 02bd494 commit dd83918

File tree

1 file changed

+68
-93
lines changed

1 file changed

+68
-93
lines changed

src/components/Settings.vue

Lines changed: 68 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
<v-card>
5151
<div class="cardContent">
5252
<div v-for="(value, key, index) in cb.status">
53-
<div v-if="key != 'log'">
54-
{{ key }}: <code>{{ value }}</code>
55-
</div>
53+
<div v-if="key != 'log'">
54+
{{ key }}: <code>{{ value }}</code>
55+
</div>
5656
</div>
5757
<br>
5858
</div>
@@ -70,81 +70,55 @@
7070
<v-btn @click="restoreConfig" color="warning">
7171
<v-icon>fas fa-redo</v-icon> Ripristina Impostazioni
7272
</v-btn>
73-
<!-- ** Restore button + dialog box** -->
74-
<v-dialog
75-
v-model="dialog"
76-
width="500" >
77-
<v-btn
78-
slot="activator"
79-
color="error"dark >
80-
<v-icon>fas fa-wrench</v-icon> Ripristina ad impostazioni di fabbrica
81-
</v-btn>
82-
83-
<v-card>
84-
<v-card-title
85-
class="headline grey lighten-2"
86-
primary-title >
87-
<h3>CoderBot - Restore</h3>
88-
</v-card-title>
89-
90-
<v-card-text>
91-
Sei sicuro di voler ripristinare il CoderBot?
92-
<br>
93-
<h3><b>Tutti i file salvati verranno cancellati</b></h3>
94-
</v-card-text>
95-
96-
<v-divider></v-divider>
97-
98-
<v-card-actions>
99-
<v-spacer></v-spacer>
100-
<v-btn
101-
color="primary"
102-
@click="dialog = false" >
103-
Esci
104-
</v-btn>
105-
<v-btn
106-
color="error"
107-
@click="restore" >
108-
<b>Ripristina</b>
109-
</v-btn>
110-
</v-card-actions>
111-
</v-card>
112-
</v-dialog>
113-
114-
<!-- Logs -->
115-
<v-dialog
116-
v-model="dialog_logs"
117-
width="700" >
118-
<v-btn
119-
slot="activator"
120-
color="warning" dark >
121-
<v-icon>fas fa-file-signature</v-icon> Show logs
122-
</v-btn>
123-
124-
<v-card>
125-
<v-card-title
126-
class="headline grey lighten-2"
127-
primary-title >
128-
<h3>CoderBot - Logs</h3>
129-
</v-card-title>
130-
131-
<div class="cardContent">
132-
<div v-for="value in cb.logs.log">
133-
{{ value }}
134-
</div>
135-
</div>
136-
<v-divider></v-divider>
137-
138-
<v-card-actions>
139-
<v-spacer></v-spacer>
140-
<v-btn
141-
color="primary"
142-
@click="dialog_logs = false" >
143-
Esci
144-
</v-btn>
145-
</v-card-actions>
146-
</v-card>
147-
</v-dialog>
73+
<!-- ** Restore button + dialog box** -->
74+
<v-dialog v-model="dialog" width="500">
75+
<v-btn slot="activator" color="error" dark>
76+
<v-icon>fas fa-wrench</v-icon> Ripristina ad impostazioni di fabbrica
77+
</v-btn>
78+
<v-card>
79+
<v-card-title class="headline grey lighten-2" primary-title>
80+
<h3>CoderBot - Restore</h3>
81+
</v-card-title>
82+
<v-card-text>
83+
Sei sicuro di voler ripristinare il CoderBot?
84+
<br>
85+
<h3><b>Tutti i file salvati verranno cancellati</b></h3>
86+
</v-card-text>
87+
<v-divider></v-divider>
88+
<v-card-actions>
89+
<v-spacer></v-spacer>
90+
<v-btn color="primary" @click="dialog = false">
91+
Esci
92+
</v-btn>
93+
<v-btn color="error" @click="restore">
94+
<b>Ripristina</b>
95+
</v-btn>
96+
</v-card-actions>
97+
</v-card>
98+
</v-dialog>
99+
<!-- Logs -->
100+
<v-dialog v-model="dialog_logs" width="700">
101+
<v-btn slot="activator" color="warning" dark>
102+
<v-icon>fas fa-file-signature</v-icon> Show logs
103+
</v-btn>
104+
<v-card>
105+
<v-card-title class="headline grey lighten-2" primary-title>
106+
<h3>CoderBot - Logs</h3>
107+
</v-card-title>
108+
<div class="cardContent">
109+
<div v-for="value in cb.logs.log">
110+
{{ value }}
111+
</div>
112+
</div>
113+
<v-divider></v-divider>
114+
<v-card-actions>
115+
<v-spacer></v-spacer>
116+
<v-btn color="primary" @click="dialog_logs = false">
117+
Esci
118+
</v-btn>
119+
</v-card-actions>
120+
</v-card>
121+
</v-dialog>
148122
<!--
149123
<v-btn color="warning">Aggiorna</v-btn>
150124
<v-btn color="error">Ripristina ad Impostazioni di fabbrica</v-btn> -->
@@ -358,20 +332,20 @@ export default {
358332
this.prepopulate()
359333
}.bind(this))
360334
},
361-
restore() {
362-
let axios = this.$axios
363-
let CB = this.CB
364-
axios.post(CB + '/reset')
365-
.then(function(response) {
335+
restore() {
336+
let axios = this.$axios
337+
let CB = this.CB
338+
axios.post(CB + '/reset')
339+
.then(function(response) {
366340
this.snackText = 'Ripristino ad impostazioni di fabbrica \
367341
Reboot in corso...'
368342
this.snackbar = true
369343
this.prepopulate()
370-
setTimeout(() => $(dialog).close(), 5000)
371-
this.dialog = false
344+
setTimeout(() => $(dialog).close(), 5000)
345+
this.dialog = false
372346
}.bind(this))
373-
},
374-
347+
},
348+
375349
shutdown() {
376350
let axios = this.$axios
377351
let CBv1 = this.CBv1
@@ -398,7 +372,7 @@ export default {
398372
axios.get(this.CB + '/status')
399373
.then(function(response) {
400374
this.cb.status = response.data
401-
this.cb.logs.log = response.data.log
375+
this.cb.logs.log = response.data.log
402376
}.bind(this))
403377
axios.get(this.CB + '/info')
404378
.then(function(response) {
@@ -420,7 +394,7 @@ export default {
420394
421395
this.statusData = response.data
422396
this.status = response.status
423-
this.cb.logs.log = response.data.log
397+
this.cb.logs.log = response.data.log
424398
}.bind(this))
425399
.catch(function(error) {
426400
// handle error
@@ -578,7 +552,8 @@ export default {
578552
formdata: null,
579553
files: null,
580554
status: null,
581-
dialog: false,
555+
dialog: false,
556+
dialog_logs:false,
582557
lastCommit: process.env.lastCommit,
583558
CB: process.env.CB_ENDPOINT + process.env.APIv2,
584559
CBv1: process.env.CB_ENDPOINT,
@@ -639,9 +614,9 @@ export default {
639614
vueVersion: null,
640615
kernel: null
641616
},
642-
logs: {
643-
log: null
644-
}
617+
logs: {
618+
log: null
619+
}
645620
},
646621
drawer: null,
647622
tab: null,

0 commit comments

Comments
 (0)