|
14 | 14 | <!-- If the API is available, show the desired buttons -->
|
15 | 15 | <template v-if="status == 200">
|
16 | 16 | <template v-for="button, i in activity.buttons">
|
17 |
| - <v-btn @click="_self[button.action]()" style="height: 70%" :color="button.colorBtn" :class="button.colorText"> |
18 |
| - {{ button.label }} |
19 |
| - <v-icon right dark>{{ button.icon }}</v-icon> |
20 |
| - </v-btn> |
| 17 | + <template v-if="button.type == 'flat'"> |
| 18 | + <v-btn @click="_self[button.action]()" flat> |
| 19 | + <v-icon>{{ button.icon }}</v-icon> |
| 20 | + {{ button.label }} |
| 21 | + </v-btn> |
| 22 | + </template> |
| 23 | + <template v-else> |
| 24 | + <v-btn @click="_self[button.action]()" style="height: 70%" :color="button.colorBtn" :class="button.colorText"> |
| 25 | + {{ button.label }} |
| 26 | + <v-icon right dark>{{ button.icon }}</v-icon> |
| 27 | + </v-btn> |
| 28 | + </template> |
21 | 29 |
|
22 | 30 | </template>
|
23 | 31 | </template>
|
@@ -299,20 +307,80 @@ export default {
|
299 | 307 | // Get the activity
|
300 | 308 | let axios = this.$axios
|
301 | 309 | let CB = this.CB
|
302 |
| - console.log("Loading activity", this.$route.params.name) |
303 |
| - this.saved = true; |
304 |
| - axios.get(CB + '/loadActivity', { |
305 |
| - params: { |
306 |
| - name: this.$route.params.name |
307 |
| - } |
308 |
| - }) |
309 |
| - .then(function(response) { |
310 |
| - console.log("Activity loaded", response.data) |
311 |
| - this.activity = response.data |
312 |
| - this.updateCssProps() |
313 |
| -
|
314 |
| - }.bind(this)) |
315 |
| -
|
| 310 | + if (this.$route.path == '/program') { |
| 311 | + console.log('Loading the default activity') |
| 312 | + this.activity = { |
| 313 | + "bodyFont": "Roboto", |
| 314 | + "buttons": [{ |
| 315 | + "action": "saveProgram", |
| 316 | + "icon": "save", |
| 317 | + "label": "Salva", |
| 318 | + "type": "flat" |
| 319 | + }, |
| 320 | + { |
| 321 | + "action": "toggleSaveAs", |
| 322 | + "icon": "edit", |
| 323 | + "label": "Salva con Nome", |
| 324 | + "type": "flat" |
| 325 | + }, |
| 326 | + { |
| 327 | + "action": "loadProgramList", |
| 328 | + "icon": "folder_open", |
| 329 | + "label": "Carica", |
| 330 | + "type": "flat" |
| 331 | + }, |
| 332 | + { |
| 333 | + "action": "runProgramLegacy", |
| 334 | + "icon": "play_arrow", |
| 335 | + "label": "Esegui", |
| 336 | + "type": "flat" |
| 337 | + }, |
| 338 | + { |
| 339 | + "action": "getProgramCode", |
| 340 | + "icon": "code", |
| 341 | + "label": "Mostra codice", |
| 342 | + "type": "flat" |
| 343 | + }, |
| 344 | + { |
| 345 | + "action": "exportProgram", |
| 346 | + "icon": "fa-file-export", |
| 347 | + "label": "Esporta", |
| 348 | + "type": "flat" |
| 349 | + }, |
| 350 | + { |
| 351 | + "action": "pickFile", |
| 352 | + "icon": "fa-file-import", |
| 353 | + "label": "Importa", |
| 354 | + "type": "flat" |
| 355 | + }, |
| 356 | +
|
| 357 | + ], |
| 358 | + "capsSwitch": false, |
| 359 | + "codeFont": "ubuntumono", |
| 360 | + "description": null, |
| 361 | + "drawerEnabled": true, |
| 362 | + "exec": { |
| 363 | + "camera": true, |
| 364 | + "log": true |
| 365 | + }, |
| 366 | + "fontSize": "Medio", |
| 367 | + "name": "Programma", |
| 368 | + "showName": true |
| 369 | + } |
| 370 | + } else { |
| 371 | + console.log("Loading activity", this.$route.params.name) |
| 372 | + this.saved = true; |
| 373 | + axios.get(CB + '/loadActivity', { |
| 374 | + params: { |
| 375 | + name: this.$route.params.name |
| 376 | + } |
| 377 | + }) |
| 378 | + .then(function(response) { |
| 379 | + console.log("Activity loaded", response.data) |
| 380 | + this.activity = response.data |
| 381 | + this.updateCssProps() |
| 382 | + }.bind(this)) |
| 383 | + } |
316 | 384 |
|
317 | 385 | this.status = null
|
318 | 386 | this.pollStatus();
|
|
0 commit comments