From dbb89d268568df210e542de1e45a69a57d5fa438 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Mon, 4 Nov 2024 14:55:51 -0800 Subject: [PATCH 1/2] Open in Datalab button, datalab config url --- public/config/config.json | 1 + src/App.vue | 1 + src/components/Images/MyGallery.vue | 9 +++++++++ src/stores/configuration.js | 3 ++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/public/config/config.json b/public/config/config.json index bd054ee..7590503 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,5 +4,6 @@ "rtiBridgeUrl": "https://lco-edu-rti-bridge.lco.earth/", "targetNameUrl": "https://simbad2k.lco.global/", "configdbUrl": "http://configdb.lco.gtn/", + "datalabUrl": "https://datalab.lco.earth/", "demo": false } diff --git a/src/App.vue b/src/App.vue index 6862eef..3d56384 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,6 +34,7 @@ onMounted(async () => { configurationStore.thumbnailArchiveUrl = config.thumbnailArchiveUrl configurationStore.targetNameUrl = config.targetNameUrl configurationStore.configdbUrl = config.configdbUrl + configurationStore.datalabUrl = config.datalabUrl configurationStore.demo = config.demo configurationStore.isConfigLoaded = true } diff --git a/src/components/Images/MyGallery.vue b/src/components/Images/MyGallery.vue index bd9f902..839a866 100644 --- a/src/components/Images/MyGallery.vue +++ b/src/components/Images/MyGallery.vue @@ -55,6 +55,14 @@ const sessionsWithThumbnails = computed(() => { return sessions }) +function openDatalab (observationId, startDate, proposalId = null) { + // Links to Observation in Datalab Projects tab + let datalabQueryUrl = configurationStore.datalabUrl + 'projects/' + `?observationId=${observationId}` + if (startDate) datalabQueryUrl += `&startDate=${startDate}` + if (proposalId) datalabQueryUrl += `&proposalId=${proposalId}` + window.open(datalabQueryUrl, 'datalabWindow') // Avoids opening a new tab every time +} +