Skip to content

Commit 314f614

Browse files
Merge pull request #36 from Geode-solutions/next
Next
2 parents 28c3ff7 + a6a56d3 commit 314f614

File tree

6 files changed

+31
-33
lines changed

6 files changed

+31
-33
lines changed

components/Launcher.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ const websocket_store = use_websocket_store()
2222
const cloud_store = use_cloud_store()
2323
const { is_cloud_running, is_captcha_validated, is_connexion_launched } = storeToRefs(cloud_store)
2424
25-
const props = defineProps({
26-
site_key: { type: String, required: true }
27-
})
28-
29-
const { site_key } = toRefs(props)
25+
const site_key = useRuntimeConfig().public.RECAPTCHA_SITE_KEY
3026
3127
watch(is_captcha_validated, async (value) => {
3228
if (value === true && process.client) {
@@ -44,7 +40,7 @@ onMounted(() => {
4440
}
4541
})
4642
47-
async function submit_recaptcha(token) {
43+
async function submit_recaptcha (token) {
4844
try {
4945
const response = await $fetch.raw(`/.netlify/functions/recaptcha?token=${token}`)
5046
cloud_store.$patch({ is_captcha_validated: response.status == 200 })

components/RemoteRenderingView.client.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div style="position: relative; ">
2+
<div style="position: relative; width: 100%; height: 100%;">
33
<view-toolbar />
44
<v-col style="overflow: hidden; position: relative; z-index: 0; height: 100%; width: 100%" ref="viewer"
55
@click="get_x_y" @keydown.esc="app_store.toggle_picking_mode(false)" class="pa-0">

components/ViewToolbar.vue

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
<template>
2-
<v-row dense :class="[$style.floatToolbar, 'flex-column']">
3-
<v-col>
4-
<v-tooltip location="left">
5-
Reset camera
6-
<template #activator="{ props }">
7-
<v-btn @click.stop=reset_camera icon="mdi-crop-free" density="comfortable" v-bind="props" />
8-
</template>
9-
</v-tooltip>
10-
</v-col>
11-
</v-row>
2+
<v-row dense :class="[$style.floatToolbar, 'flex-column']">
3+
<v-col>
4+
<v-tooltip location="left">
5+
Reset camera
6+
<template #activator="{ props }">
7+
<v-btn @click.stop=reset_camera density="comfortable" v-bind="props" icon>
8+
<v-icon size="32">
9+
mdi-cube-scan
10+
</v-icon>
11+
</v-btn>
12+
</template>
13+
</v-tooltip>
14+
</v-col>
15+
</v-row>
1216
</template>
1317

1418
<script setup>
1519
const viewer_store = use_viewer_store()
16-
function reset_camera() {
17-
viewer_store.reset_camera()
20+
function reset_camera () {
21+
viewer_store.reset_camera()
1822
}
1923
</script>
2024

2125
<style module>
2226
.floatToolbar {
23-
position: absolute;
24-
z-index: 2;
25-
right: 20px;
26-
top: 20px;
27-
background-color: rgba(0, 0, 0, 0.4);
28-
border-radius: 16px;
27+
position: absolute;
28+
z-index: 2;
29+
right: 20px;
30+
top: 20px;
31+
background-color: rgba(0, 0, 0, 0.4);
32+
border-radius: 16px;
2933
}
3034
</style>

components/Wrapper.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Header :tool_name="tool_name" :cards_list="cards_list" />
66
</v-col>
77
<v-col v-if="!is_cloud_running">
8-
<Launcher :site_key="site_key" />
8+
<Launcher />
99
</v-col>
1010
<v-col v-if="is_cloud_running">
1111
<Stepper />
@@ -23,9 +23,8 @@ const { is_cloud_running } = storeToRefs(cloud_store)
2323
2424
const props = defineProps({
2525
cards_list: { type: Array, required: true },
26-
site_key: { type: String, required: true }
2726
})
28-
const { cards_list, site_key } = props
27+
const { cards_list } = props
2928
3029
const stepper_tree = inject('stepper_tree')
3130
const { tool_name, route_prefix } = stepper_tree

stores/cloud.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { defineStore } from 'pinia'
2+
import { useStorage } from '@vueuse/core'
23

34
export const use_cloud_store = defineStore('cloud', {
45
state: () => ({
5-
ID: '',
6+
ID: useStorage('ID', ''),
67
is_captcha_validated: false,
78
is_cloud_running: false,
89
is_connexion_launched: false,
@@ -31,14 +32,12 @@ export const use_cloud_store = defineStore('cloud', {
3132
async create_connexion () {
3233
if (this.is_connexion_launched) { return }
3334
this.is_connexion_launched = true
34-
const ID = localStorage.getItem('ID')
35-
if (ID === null || typeof ID === 'undefined') {
35+
if (this.ID === '' || this.ID === null || typeof this.ID === 'undefined') {
3636
return this.create_backend()
3737
} else {
3838
const { data, error } = await useFetch(`${this.geode_url}/ping`, { method: 'POST' })
3939
console.log("error", error)
4040
if (data.value !== null) {
41-
this.ID = ID
4241
this.is_cloud_running = true
4342
return this.ping_task()
4443
} else {

stores/viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const use_viewer_store = defineStore('viewer', {
1010
this.picking_mode = value
1111
},
1212
async set_picked_point (x, y) {
13-
const response = await get_point_position({ x, y })
13+
const response = await this.get_point_position({ x, y })
1414
const { x: world_x, y: world_y } = response
1515
this.picked_point.x = world_x
1616
this.picked_point.y = world_y

0 commit comments

Comments
 (0)