|
26 | 26 | </v-tabs>
|
27 | 27 | </v-toolbar>
|
28 | 28 | <v-content>
|
29 |
| - <template v-if="status == 200"> |
| 29 | + <!--<template v-if="status == 200">--> |
30 | 30 | <v-tabs-items v-model="tab">
|
31 | 31 | <v-tab-item>
|
32 | 32 | <v-container grid-list-md text-xs-center>
|
|
257 | 257 | </v-layout>
|
258 | 258 | </v-container>
|
259 | 259 | </v-tab-item>
|
| 260 | + <!-- TEST TAB --> |
| 261 | + <v-tab-item> |
| 262 | + <v-container grid-list-md text-xs-center> |
| 263 | + <v-layout row wrap align-center> |
| 264 | + <v-flex xs12 md6 offset-md3> |
| 265 | + <h3 class="text-xs-left">COMPONENTS TESTS</h3> |
| 266 | + <v-card> |
| 267 | + |
| 268 | + <div class="cardContent"> |
| 269 | + <div id='test_array'> |
| 270 | + <v-switch label="Motors" value="motors" v-model="checkedTests"></v-switch> |
| 271 | + <v-switch label="Sonar" value="sonar" v-model="checkedTests"></v-switch> |
| 272 | + <v-switch label="Speaker" value="speaker" v-model="checkedTests"></v-switch> |
| 273 | + <v-switch label="OCR" value="ocr" v-model="checkedTests"></v-switch> |
| 274 | + <span>Checked names: {{ checkedTests }}</span> |
| 275 | + </div> |
| 276 | + <br> |
| 277 | + <v-btn @click="runTests" slot="activator" color="error" dark> |
| 278 | + <v-icon>fas fa-share-square</v-icon> Run tests |
| 279 | + </v-btn> |
| 280 | + </div> |
| 281 | + |
| 282 | + </v-card> |
| 283 | + </v-flex> |
| 284 | + </v-layout> |
| 285 | + </v-container> |
| 286 | + </v-tab-item> |
260 | 287 | </v-tabs-items>
|
261 |
| - </template> |
| 288 | + <!--</template> |
262 | 289 | <template v-else>
|
263 | 290 | <br>
|
264 | 291 | In attesa che CoderBot torni online...<br>
|
265 | 292 | <v-icon large>signal_wifi_off</v-icon>
|
266 |
| - </template> |
| 293 | + </template>--> |
267 | 294 | </v-content>
|
268 | 295 | <!-- Notification Snackbar -->
|
269 | 296 | <v-snackbar v-model="snackbar">
|
|
275 | 302 | </v-app>
|
276 | 303 | </div>
|
277 | 304 | </template>
|
| 305 | + |
278 | 306 | <script>
|
279 | 307 | import sidebar from "../components/Sidebar"
|
280 | 308 |
|
@@ -332,6 +360,16 @@ export default {
|
332 | 360 | this.prepopulate()
|
333 | 361 | }.bind(this))
|
334 | 362 | },
|
| 363 | + runTests() { |
| 364 | + let axios = this.$axios |
| 365 | + let CB = this.CB |
| 366 | + axios.post(CB + '/testCoderbot', { params: { varargin: this.checkedTests } }) |
| 367 | + .then(function(response) { |
| 368 | + this.snackText = 'Running tests' |
| 369 | + this.snackbar = true |
| 370 | + this.prepopulate() |
| 371 | + }.bind(this)) |
| 372 | + }, |
335 | 373 | restore() {
|
336 | 374 | let axios = this.$axios
|
337 | 375 | let CB = this.CB
|
@@ -564,6 +602,7 @@ export default {
|
564 | 602 | fileUrl: '',
|
565 | 603 | counter: 0,
|
566 | 604 | updateStatusText: '',
|
| 605 | + checkedTests: [], // checked test array |
567 | 606 | updateStatus: 0,
|
568 | 607 | // TODO: Prepopulate this
|
569 | 608 | settings: {
|
@@ -622,7 +661,7 @@ export default {
|
622 | 661 | drawer: null,
|
623 | 662 | tab: null,
|
624 | 663 | //tabs: ['Generali', 'Rete', 'Movimento', 'Suoni', 'Avanzate'],
|
625 |
| - tabs: ['Generali', 'Movimento', 'Suoni', 'Avanzate'], |
| 664 | + tabs: ['Generali', 'Movimento', 'Suoni', 'Avanzate', 'Test'], |
626 | 665 | }
|
627 | 666 | }
|
628 | 667 | }
|
|
0 commit comments