Skip to content

Commit

Permalink
Merge pull request #74 from LCOGT/feature/open-in-datalab
Browse files Browse the repository at this point in the history
Open in Datalab
  • Loading branch information
LTDakin authored Nov 4, 2024
2 parents 2eac46b + 16668b1 commit 4be2b7f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 10 additions & 0 deletions src/components/Images/MyGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ const sessionsWithThumbnails = computed(() => {
return sessions
})
function openDatalab (observationId, startDate, proposalId) {
if (!observationId || !startDate || !proposalId) {
console.error('Missing required parameters:', { observationId, startDate, proposalId })
return
}
const datalabQueryUrl = `${configurationStore.datalabUrl}projects/?observationId=${observationId}&startDate=${startDate}&proposalId=${proposalId}`
window.open(datalabQueryUrl, 'datalabWindow')
}
</script>

<template>
Expand All @@ -64,6 +73,7 @@ const sessionsWithThumbnails = computed(() => {
<div class="container">
<div v-for="obs in sessionsWithThumbnails" :key="obs.id">
<h3 class="startTime">{{ formatDate(obs.start) }}</h3>
<v-btn @click="openDatalab(obs.id, obs.start, obs.proposal)">Open in Datalab</v-btn>
<div class="columns is-multiline">
<div
class="column is-one-quarter-desktop is-half-tablet"
Expand Down
3 changes: 2 additions & 1 deletion src/stores/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const useConfigurationStore = defineStore('configuration', {
thumbnailArchiveUrl: '',
rtiBridgeUrl: '',
targetNameUrl: '',
configdbUrl: ''
configdbUrl: '',
datalabUrl: ''
}
},
persist: true
Expand Down

0 comments on commit 4be2b7f

Please sign in to comment.