From f516f8cd6fd94325347b1d023d1bb55b7a1171e0 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 16 May 2024 11:03:13 +0200 Subject: [PATCH 1/5] Implements: #550 --- app/templates/advanced_config.html | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/app/templates/advanced_config.html b/app/templates/advanced_config.html index 15c361d3e..2efda5f7a 100644 --- a/app/templates/advanced_config.html +++ b/app/templates/advanced_config.html @@ -209,6 +209,28 @@
Cloud Provider:
}); } + function selectedSiteImageChanged() { + // disable the other select of AppDB images + var selected = $("#selectedSiteImage option:selected" ).text(); + if (selected == " - Select one image - ") { + $("#selectedImage").prop('disabled', false); + } else { + $("#selectedImage").prop('disabled', true); + } + activateSubmit() + } + + function selectedImageChanged() { + // disable the other select of site images + var selected = $("#selectedImage option:selected" ).text(); + if (selected == " - Select one image - ") { + $("#selectedSiteImage").prop('disabled', false); + } else { + $("#selectedSiteImage").prop('disabled', true); + } + activateSubmit() + } + function activateSubmit() { $(".submitBtn").attr("disabled", false); } @@ -252,7 +274,7 @@
Cloud Provider:

- @@ -260,7 +282,7 @@
Cloud Provider:
From 537ab87b10962701b9be3b5b9e730ee17a45c121 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 16 May 2024 11:23:02 +0200 Subject: [PATCH 2/5] Fix error #550 --- app/templates/advanced_config.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/templates/advanced_config.html b/app/templates/advanced_config.html index 2efda5f7a..ff8febc30 100644 --- a/app/templates/advanced_config.html +++ b/app/templates/advanced_config.html @@ -130,6 +130,7 @@
Cloud Provider:
$('#siteImages').hide(); $('#fedcloudUsage').hide(); } + $("#selectedImage").prop('disabled', false); } function loadImages() { From 1315fb1c21eec9352ffe6998ed1b920b41a64821 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 16 May 2024 11:44:12 +0200 Subject: [PATCH 3/5] Fix error #550 --- app/templates/advanced_config.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/templates/advanced_config.html b/app/templates/advanced_config.html index ff8febc30..10d5375ed 100644 --- a/app/templates/advanced_config.html +++ b/app/templates/advanced_config.html @@ -131,6 +131,7 @@
Cloud Provider:
$('#fedcloudUsage').hide(); } $("#selectedImage").prop('disabled', false); + $("#selectedSiteImage").prop('disabled', false); } function loadImages() { From 59c9b01b7fe0bfd60a884bba984a026270c361c5 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 16 May 2024 13:41:20 +0200 Subject: [PATCH 4/5] Fix error #550 --- app/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 8bd680a02..1890b4438 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1004,9 +1004,9 @@ def createdep(): if "public" in site["networks"][vo]: pub_network_id = site["networks"][vo]["public"] - if form_data['extra_opts.selectedImage'] != "" and 'name' in site: + if form_data.get('extra_opts.selectedImage') not in ["", None] and 'name' in site: image = "appdb://%s/%s?%s" % (site['name'], form_data['extra_opts.selectedImage'], vo) - elif form_data['extra_opts.selectedSiteImage'] != "": + elif form_data.get('extra_opts.selectedSiteImage') not in ["", None]: image = form_data['extra_opts.selectedSiteImage'] else: image_id = form_data['extra_opts.imageID'] From 1ef468efb3037ce0797f7edc7b7665d56b7d1a31 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 16 May 2024 13:42:32 +0200 Subject: [PATCH 5/5] Fix error #550 --- app/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 1890b4438..dfd525547 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1004,9 +1004,9 @@ def createdep(): if "public" in site["networks"][vo]: pub_network_id = site["networks"][vo]["public"] - if form_data.get('extra_opts.selectedImage') not in ["", None] and 'name' in site: + if form_data.get('extra_opts.selectedImage', "") != "" and 'name' in site: image = "appdb://%s/%s?%s" % (site['name'], form_data['extra_opts.selectedImage'], vo) - elif form_data.get('extra_opts.selectedSiteImage') not in ["", None]: + elif form_data.get('extra_opts.selectedSiteImage', "") != "": image = form_data['extra_opts.selectedSiteImage'] else: image_id = form_data['extra_opts.imageID']