File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 10
10
{{ activity.name }}
11
11
</v-app-bar-title >
12
12
<v-spacer ></v-spacer >
13
- <v-chip class =" ma-2" v-if =" activity.maxBlocks > 0" label >{{ $t("message.activity_program_remaining_blocks") }}: {{ workspace. remainingCapacity() }}</v-chip >
13
+ <v-chip class =" ma-2" v-if =" activity.maxBlocks > 0" label >{{ $t("message.activity_program_remaining_blocks") }}: {{ remainingCapacity }}</v-chip >
14
14
<!-- If the API is available, show the desired buttons -->
15
15
<template v-if =" status == 200 " >
16
16
<template v-for =" button in activity .buttons " >
@@ -366,6 +366,9 @@ export default {
366
366
}
367
367
return this .$i18n .t (' message.coderbot_status_offline' );
368
368
},
369
+ remainingCapacity () {
370
+ return this .$refs .workspace .remainingCapacity ();
371
+ }
369
372
},
370
373
mounted () {
371
374
this .loadMusicPackages ();
@@ -452,6 +455,7 @@ export default {
452
455
}).then ((response ) => {
453
456
console .log (' Activity loaded' , response .data );
454
457
this .activity = response .data ;
458
+ this .settings .activity = response .data ;
455
459
this .updateCssProps ();
456
460
457
461
let toolboxJSON = null ;
Original file line number Diff line number Diff line change @@ -92,10 +92,10 @@ export default {
92
92
// Options
93
93
{
94
94
toolbox: this .toolbox ,
95
- // path : 'static/js/blockly /',
95
+ media : ' media /' ,
96
96
// TODO: Use values from fetched configuration!
97
97
scrollbars: true ,
98
- maxBlocks: null , // this .activity.maxBlocks,
98
+ maxBlocks: settings .activity .maxBlocks ,
99
99
zoom: {
100
100
controls: true ,
101
101
wheel: false ,
@@ -220,6 +220,14 @@ export default {
220
220
221
221
clear () {
222
222
this .workspace .clear ();
223
+ },
224
+
225
+ remainingCapacity () {
226
+ let capacity = null ;
227
+ if (this .workspace ) {
228
+ capacity = this .workspace .remainingCapacity ();
229
+ }
230
+ return capacity;
223
231
}
224
232
},
225
233
};
You can’t perform that action at this time.
0 commit comments