Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions components/Launcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-container class="justify">
<v-row align-content="center" align="center">
<v-col
v-if="!is_captcha_validated"
v-if="!infra_store.is_captcha_validated"
class="align"
cols="12"
align-self="center"
Expand All @@ -21,16 +21,21 @@
<script setup>
import Status from "@/utils/status.js"
const viewer_store = use_viewer_store()
const infra_store = use_infra_store()
const { is_captcha_validated } = storeToRefs(infra_store)
const site_key = useRuntimeConfig().public.RECAPTCHA_SITE_KEY
watch(is_captcha_validated, async (value) => {
if (value === true && process.client) {
watch(
() => infra_store.is_captcha_validated,
async (value, oldValue) => {
if (value && !oldValue && process.client) {
await infra_store.create_backend()
}
},
)
onMounted(async () => {
if (infra_store.is_captcha_validated) {
await infra_store.create_backend()
await viewer_store.ws_connect()
}
})
</script>
6 changes: 3 additions & 3 deletions components/Loading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<v-col cols="12" class="ma-3">
<v-card loading>
<v-card-title class="text-center">
Cloud instance is starting...
Microservices are starting...
</v-card-title>
<v-card-subtitle class="text-center">
Why do you have to wait?
</v-card-subtitle>
<v-card-text class="text-center">
We start our server only on demand... and this takes a few minutes
before you can use our free app.
We start our microservices only on demand... and this takes a few
minutes before you can use our free app.
<br />
This is aligned with our energy sobriety policy. So be patient
<v-icon color="primary" size="20">
Expand Down
9 changes: 6 additions & 3 deletions components/PackagesVersions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@
await Promise.all(array_promise)
}

watch(geode_store.status, (value) => {
if (value == Status.CONNECTED) get_packages_versions()
})
watch(
() => geode_store.status,
(value) => {
if (value == Status.CONNECTED) get_packages_versions()
},
)

await get_packages_versions()
</script>
6 changes: 2 additions & 4 deletions components/Recaptcha.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<ClientOnly>
<vue-recaptcha
ref="recaptcha"
:sitekey="site_key"
:sitekey="props.site_key"
:load-recaptcha-script="true"
align-self="center"
@expired="is_captcha_validated = false"
@expired="infra_store.is_captcha_validated = false"
@verify="submit_recaptcha"
/>
</ClientOnly>
Expand All @@ -14,12 +14,10 @@
<script setup>
import { VueRecaptcha } from "vue-recaptcha"
const infra_store = use_infra_store()
const { is_captcha_validated } = storeToRefs(infra_store)

const props = defineProps({
site_key: { type: String, required: true },
})
const { site_key } = props

onMounted(() => {
if (process.client) {
Expand Down
53 changes: 30 additions & 23 deletions components/RemoteRenderingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"
class="pa-0"
@click="get_x_y"
@keydown.esc="app_store.toggle_picking_mode(false)"
@keydown.esc="viewer_store.toggle_picking_mode(false)"
/>
</div>
</ClientOnly>
Expand All @@ -26,8 +26,12 @@
import viewer_schemas from "@geode/opengeodeweb-viewer/schemas.json"
import Status from "@/utils/status.js"
const props = defineProps({
viewId: { type: String, default: "-1" },
})
const viewer_store = use_viewer_store()
const viewer = ref(null)
const viewer = useTemplateRef("viewer")
const { width, height } = useElementSize(viewer)
const { width: windowWidth, height: windowHeight } = useWindowSize()
Expand All @@ -43,13 +47,7 @@
}
}
const props = defineProps({
viewId: { type: String, default: "-1" },
})
const { viewId } = toRefs(props)
const connected = ref(false)
const view = vtkRemoteView.newInstance({
rpcWheelEvent: "viewport.mouse.zoom.wheel",
})
Expand All @@ -69,33 +67,42 @@
resize()
})
watch(viewer_store.picking_mode, (value) => {
const cursor = value ? "crosshair" : "pointer"
view.getCanvasView().setCursor(cursor)
})
watch(
() => viewer_store.picking_mode,
(value) => {
const cursor = value ? "crosshair" : "pointer"
view.getCanvasView().setCursor(cursor)
},
)
watch([width, height], () => {
resize()
})
watch(viewer_store.client, () => {
connect()
})
watch(viewId, (id) => {
if (connected.value) {
view.setViewId(id)
view.render()
}
})
watch(
() => viewer_store.client,
() => {
connect()
},
)
watch(
() => props.viewId,
(id) => {
if (connected.value) {
view.setViewId(id)
view.render()
}
},
)
function connect() {
if (!viewer_store.status !== Status.CONNECTED) {
return
}
const session = viewer_store.client.value.getConnection().getSession()
view.setSession(session)
view.setViewId(viewId.value)
view.setViewId(props.viewId)
connected.value = true
view.render()
}
Expand Down
3 changes: 2 additions & 1 deletion stores/infra.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
export const use_infra_store = defineStore("infra", {
state: () => ({
ID: useStorage("ID", ""),
is_captcha_validated: false,
is_captcha_validated:
is_cloud() || process.env.NODE_ENV === "development" ? true : false,

Check failure on line 9 in stores/infra.js

View workflow job for this annotation

GitHub Actions / test

test/components/Launcher.nuxt.test.js

ReferenceError: is_cloud is not defined ❯ state stores/infra.js:9:7 ❯ setup node_modules/pinia/dist/pinia.mjs:1229:49 ❯ node_modules/pinia/dist/pinia.mjs:1474:98 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:88 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:54 ❯ runWithContext node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3977:18 ❯ createSetupStore node_modules/pinia/dist/pinia.mjs:1474:24 ❯ createOptionsStore node_modules/pinia/dist/pinia.mjs:1257:13

Check failure on line 9 in stores/infra.js

View workflow job for this annotation

GitHub Actions / test

test/composables/run_function_when_microservices_connected.test.js > run_function_when_microservices_connected > microservices connected

ReferenceError: is_cloud is not defined ❯ state stores/infra.js:9:7 ❯ setup node_modules/pinia/dist/pinia.mjs:1229:49 ❯ node_modules/pinia/dist/pinia.mjs:1474:98 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:88 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:54 ❯ runWithContext node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3977:18 ❯ createSetupStore node_modules/pinia/dist/pinia.mjs:1474:24 ❯ createOptionsStore node_modules/pinia/dist/pinia.mjs:1257:13

Check failure on line 9 in stores/infra.js

View workflow job for this annotation

GitHub Actions / test

test/composables/upload_file.nuxt.test.js

ReferenceError: is_cloud is not defined ❯ state stores/infra.js:9:7 ❯ setup node_modules/pinia/dist/pinia.mjs:1229:49 ❯ node_modules/pinia/dist/pinia.mjs:1474:98 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:88 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:54 ❯ fallbackRunWithContext node_modules/pinia/dist/pinia.mjs:1149:40 ❯ createSetupStore node_modules/pinia/dist/pinia.mjs:1474:24 ❯ createOptionsStore node_modules/pinia/dist/pinia.mjs:1257:13

Check failure on line 9 in stores/infra.js

View workflow job for this annotation

GitHub Actions / test

test/stores/Geode.nuxt.test.js

ReferenceError: is_cloud is not defined ❯ state stores/infra.js:9:7 ❯ setup node_modules/pinia/dist/pinia.mjs:1229:49 ❯ node_modules/pinia/dist/pinia.mjs:1474:98 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:88 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:54 ❯ fallbackRunWithContext node_modules/pinia/dist/pinia.mjs:1149:40 ❯ createSetupStore node_modules/pinia/dist/pinia.mjs:1474:24 ❯ createOptionsStore node_modules/pinia/dist/pinia.mjs:1257:13

Check failure on line 9 in stores/infra.js

View workflow job for this annotation

GitHub Actions / test

test/stores/Infra.nuxt.test.js

ReferenceError: is_cloud is not defined ❯ state stores/infra.js:9:7 ❯ setup node_modules/pinia/dist/pinia.mjs:1229:49 ❯ node_modules/pinia/dist/pinia.mjs:1474:98 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:88 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:54 ❯ fallbackRunWithContext node_modules/pinia/dist/pinia.mjs:1149:40 ❯ createSetupStore node_modules/pinia/dist/pinia.mjs:1474:24 ❯ createOptionsStore node_modules/pinia/dist/pinia.mjs:1257:13

Check failure on line 9 in stores/infra.js

View workflow job for this annotation

GitHub Actions / test

test/stores/Viewer.nuxt.test.js

ReferenceError: is_cloud is not defined ❯ state stores/infra.js:9:7 ❯ setup node_modules/pinia/dist/pinia.mjs:1229:49 ❯ node_modules/pinia/dist/pinia.mjs:1474:98 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:88 ❯ EffectScope.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:81:16 ❯ node_modules/pinia/dist/pinia.mjs:1474:54 ❯ fallbackRunWithContext node_modules/pinia/dist/pinia.mjs:1149:40 ❯ createSetupStore node_modules/pinia/dist/pinia.mjs:1474:24 ❯ createOptionsStore node_modules/pinia/dist/pinia.mjs:1257:13
status: Status.NOT_CREATED,
}),
getters: {
Expand Down
Loading