From 84d76f2b6fc22773a9314b8983e1962a4fd07576 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 25 Oct 2023 22:01:54 +0200 Subject: [PATCH] Fix UDP loading with authentication --- src/Page.vue | 6 +++++- src/components/ConnectForm.vue | 3 +++ src/components/wizards/SpectralIndices.vue | 2 +- src/components/wizards/UDP.vue | 6 +++++- .../wizards/tabs/ChooseProcessParameters.vue | 9 ++++++++- src/utils.js | 18 ++++++++++++++---- 6 files changed, 36 insertions(+), 8 deletions(-) diff --git a/src/Page.vue b/src/Page.vue index d79eead96..a1bbea05b 100644 --- a/src/Page.vue +++ b/src/Page.vue @@ -78,9 +78,13 @@ export default { }); } - if (Utils.param('discover') || resultUrl) { + const discover = Utils.param('discover'); + if (discover === "1" || resultUrl) { this.skipLogin = true; } + else if (discover === "0") { + this.skipLogin = false; + } // Count active requests axios.interceptors.request.use(config => { diff --git a/src/components/ConnectForm.vue b/src/components/ConnectForm.vue index 8fab30b58..01e2c9bba 100644 --- a/src/components/ConnectForm.vue +++ b/src/components/ConnectForm.vue @@ -406,6 +406,9 @@ export default { if (discover && !this.$config.skipLogin) { params.set('discover', 1); } + else if (!discover && this.$config.skipLogin) { + params.set('discover', 0); + } else { params.delete('discover'); } diff --git a/src/components/wizards/SpectralIndices.vue b/src/components/wizards/SpectralIndices.vue index 895b3bd29..2f197889e 100644 --- a/src/components/wizards/SpectralIndices.vue +++ b/src/components/wizards/SpectralIndices.vue @@ -90,7 +90,7 @@ export default { temporal_extent: null }; }, - created() { + beforeMount() { this.scale = this.processes.has('apply') && this.processes.has('linear_scale_range') ? false : null; }, computed: { diff --git a/src/components/wizards/UDP.vue b/src/components/wizards/UDP.vue index 4f0a0db2b..b1da29374 100644 --- a/src/components/wizards/UDP.vue +++ b/src/components/wizards/UDP.vue @@ -57,8 +57,12 @@ export default { }; } }, - async created() { + async beforeMount() { this.loading = true; + if (typeof this.process !== 'string' || this.process.length === 0) { + this.$emit('close', `Sorry, no process specified.`); + return; + } let [id, namespace] = Utils.extractUDPParams(this.process); try { this.processSpec = await this.loadProcess({id, namespace}); diff --git a/src/components/wizards/tabs/ChooseProcessParameters.vue b/src/components/wizards/tabs/ChooseProcessParameters.vue index f8f43909d..116845aab 100644 --- a/src/components/wizards/tabs/ChooseProcessParameters.vue +++ b/src/components/wizards/tabs/ChooseProcessParameters.vue @@ -1,6 +1,9 @@ @@ -8,6 +11,7 @@