Skip to content

Commit 0eac20a

Browse files
committed
wip #73
1 parent c79d901 commit 0eac20a

File tree

3 files changed

+74
-25
lines changed

3 files changed

+74
-25
lines changed

src/components/Activity.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ export default {
849849
CB
850850
} = this;
851851
// POST /program/save
852+
const options = this.activity;
852853
const xml_code = Blockly.Xml.workspaceToDom(this.workspace);
853854
const dom_code = Blockly.Xml.domToText(xml_code);
854855
window.LoopTrap = 1000;
@@ -860,6 +861,7 @@ export default {
860861
name: 'run program',
861862
dom_code,
862863
code,
864+
options,
863865
}).then((response) => {
864866
console.log(response);
865867
this.runtimeDialog = true;

src/components/Control.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
</template>
9898
<template v-else>
9999
<br>
100-
{{ $t("message.coderbot_offline_1") }}<br>
100+
{{ $t("message.coderbot_status_offline_1") }}<br>
101101
<v-icon large>signal_wifi_off</v-icon>
102102
</template>
103103
</v-main>

src/components/Gallery.vue

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,61 @@
1414
<h3>{{ $t("message.gallery_empty") }}</h3>
1515
</template>
1616
<template v-else>
17-
<v-card>
18-
<v-container grid-list-sm fluid>
19-
<v-layout row wrap>
20-
<v-flex v-for="n in photos.length" :key="n" xs3 d-flex>
21-
<v-card text tile class="d-flex">
22-
<v-layout column>
23-
<div class="subheading">{{ photos[n-1].name }} <v-btn
24-
v-on:click="deletePhoto(photos[n-1].name)" text icon color="red lighten-2">
25-
<v-icon>delete</v-icon>
26-
</v-btn>
27-
</div>
28-
<a :href="CBv1+'/photos/'+photos[n-1].name" target="_blank">
29-
<v-img :src="CBv1+'/photos/'+photos[n-1].name" aspect-ratio="1" class="grey lighten-2">
30-
<v-layout slot="placeholder" fill-height align-center justify-center ma-0>
31-
<v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular>
32-
</v-layout>
33-
</v-img>
34-
</a>
17+
<v-container grid-list-sm fluid>
18+
<v-layout row wrap>
19+
<v-flex v-for="n in photos.length" :key="n" xs3 d-flex>
20+
<v-card
21+
class="mx-auto my-12"
22+
max-width="256"
23+
>
24+
<a class="text-decoration-none" @click="photo=photos[n-1]; gallery_detail=true">
25+
<v-img v-if="photos[n-1].type=='jpg'" :src="CBv1+'/photos/'+photos[n-1].thumbName" class="grey lighten-2">
26+
<v-layout slot="placeholder" fill-height align-center justify-center ma-2>
27+
<v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular>
3528
</v-layout>
36-
</v-card>
37-
</v-flex>
38-
</v-layout>
39-
</v-container>
40-
</v-card>
29+
</v-img>
30+
<v-img v-else-if="photos[n-1].type=='mp4'" :src="CBv1+'/photos/'+photos[n-1].thumbName" class="grey lighten-2">
31+
<v-layout slot="placeholder" fill-height align-center justify-center ma-0>
32+
<v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular>
33+
</v-layout>
34+
</v-img>
35+
<v-card-title class="subheading">
36+
{{ photos[n-1].name }}
37+
</v-card-title>
38+
</a>
39+
<v-card-actions>
40+
<v-btn
41+
v-on:click="deletePhoto(photos[n-1].fileName)" text icon color="red lighten-2">
42+
<v-icon>delete</v-icon>
43+
</v-btn>
44+
</v-card-actions>
45+
</v-card>
46+
</v-flex>
47+
</v-layout>
48+
</v-container>
49+
<v-dialog v-model="gallery_detail">
50+
<v-card class="mx-auto my-12" max-width="640">
51+
<v-card-title class="text-h5 grey lighten-2">
52+
{{ photo.name }}
53+
</v-card-title>
54+
<v-img v-if="photo.type=='jpg'" :src="CBv1+'/photos/'+photo.fileName" aspect-ratio="1" class="grey lighten-2">
55+
<v-layout slot="placeholder" fill-height align-center justify-center ma-0>
56+
<v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular>
57+
</v-layout>
58+
</v-img>
59+
<video v-else-if="photo.type=='mp4'" controls autoplay :src="CBv1+'/photos/'+photo.fileName"/>
60+
<v-card-actions>
61+
<v-spacer></v-spacer>
62+
<v-btn
63+
color="primary"
64+
text
65+
@click="gallery_detail = false"
66+
>
67+
{{ $t("message.close") }}
68+
</v-btn>
69+
</v-card-actions>
70+
</v-card>
71+
</v-dialog>
4172
</template>
4273
</v-flex>
4374
</v-layout>
@@ -62,9 +93,20 @@ export default {
6293
const {
6394
CBv1
6495
} = this;
96+
this.photos = [];
6597
axios.get(`${CBv1}/photos`)
6698
.then((response) => {
67-
this.photos = response.data;
99+
response.data.forEach((element) => {
100+
this.photos.push(
101+
{
102+
name: element.name.substring(0, element.name.indexOf('.')),
103+
type: element.name.substring(element.name.indexOf('.') + 1),
104+
thumbName: `${element.name.substring(0, element.name.indexOf('.'))}_thumb.jpg`,
105+
fileName: element.name
106+
}
107+
);
108+
});
109+
this.photo = {};
68110
});
69111
},
70112
deletePhoto(name) {
@@ -89,8 +131,13 @@ export default {
89131
photos: [],
90132
drawer: null,
91133
l: null,
134+
photo: null,
135+
gallery_detail: null
92136
};
93137
},
138+
computed: {
139+
140+
}
94141
};
95142
</script>
96143
<style scoped>

0 commit comments

Comments
 (0)