Skip to content

Commit b4c3ef4

Browse files
committed
Basic runtime popup
1 parent 8615283 commit b4c3ef4

File tree

1 file changed

+50
-29
lines changed

1 file changed

+50
-29
lines changed

src/components/Blockly.vue

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@
7070
</div>
7171
</div>
7272
</v-content>
73+
<!-- Runtime modal -->
74+
<v-dialog v-model="runtimeDialog" width="500">
75+
<v-card>
76+
<v-card-title class="headline grey lighten-2" primary-title>
77+
Esecuzione
78+
</v-card-title>
79+
<v-card-text>
80+
<v-img :src="webcamStream"/>
81+
</v-card-text>
82+
<v-divider></v-divider>
83+
<v-card-actions>
84+
<v-spacer></v-spacer>
85+
<v-btn color="primary" flat @click="runtimeDialog = false">
86+
Chiudi
87+
</v-btn>
88+
</v-card-actions>
89+
</v-card>
90+
</v-dialog>
7391
<!-- Hidden file input. Its file dialog it's event-click triggered by the "pickFile" method -->
7492
<input type="file" style="display: none" ref="file" @change="importProgram">
7593
<!-- When the selection is completed, the result is then handled by importProgram -->
@@ -219,32 +237,34 @@ export default {
219237
import('vue-prism-component')
220238
},
221239
data: () => ({
222-
223-
settings: null,
224-
snackText: null,
225-
snackbar: false,
226-
drawer: false,
227-
tabs: null,
228-
dialog: false,
229-
dialogCode: false,
230-
CB: process.env.CB_ENDPOINT + process.env.APIv2,
231-
CBv1: process.env.CB_ENDPOINT,
232-
status: null,
233-
code: '',
234-
workspace: null,
235-
generalDialog: false,
236-
generalDialogText: null,
237-
generalDialogTitle: null,
238-
experimental: 0,
239-
execMode: "fullExec", // can be 'fullExec' or 'stepByStep',
240-
carica: false,
241-
programList: '',
242-
salva: false,
243-
programName: '',
244-
newProgramName: '',
245-
unvalidName: false,
246-
del: false,
247-
240+
241+
settings: null,
242+
snackText: null,
243+
snackbar: false,
244+
drawer: false,
245+
tabs: null,
246+
dialog: false,
247+
dialogCode: false,
248+
CB: process.env.CB_ENDPOINT + process.env.APIv2,
249+
CBv1: process.env.CB_ENDPOINT,
250+
status: null,
251+
code: '',
252+
workspace: null,
253+
generalDialog: false,
254+
generalDialogText: null,
255+
generalDialogTitle: null,
256+
experimental: 0,
257+
execMode: "fullExec", // can be 'fullExec' or 'stepByStep',
258+
carica: false,
259+
programList: '',
260+
salva: false,
261+
programName: '',
262+
newProgramName: '',
263+
unvalidName: false,
264+
del: false,
265+
webcamStream: process.env.CB_ENDPOINT + process.env.APIv1 + '/video/stream',
266+
runtimeDialog: false,
267+
248268
}),
249269
computed: {
250270
statusText: function() {
@@ -287,7 +307,7 @@ export default {
287307
var b64Toolbox = toolbox.substring(21).toString()
288308
// Decode it and get the clean serialized XML as plain string
289309
var serializedToolbox = this.$base64.decode(b64Toolbox)
290-
310+
291311
// Initialise Blockly Instance
292312
this.workspace = Blockly.inject(
293313
// Blockly container
@@ -316,7 +336,7 @@ export default {
316336
this.resizeWorkspace()
317337
Blockly.svgResize(this.workspace);
318338
319-
339+
320340
},
321341
toggleSidebar: function() {
322342
let currentStatus = this.$store.getters.drawerStatus
@@ -570,7 +590,8 @@ export default {
570590
axios.post(this.CBv1 + '/program/exec', valuesAsString)
571591
.then(function(response) {
572592
console.log(response)
573-
})
593+
this.runtimeDialog = true;
594+
}.bind(this))
574595
575596
}
576597
},

0 commit comments

Comments
 (0)