Skip to content

Commit

Permalink
Merge branch 'devel' into egi_brand_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed May 17, 2024
2 parents 8c10ab0 + 1ef468e commit 016cb10
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', "") != "" 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', "") != "":
image = form_data['extra_opts.selectedSiteImage']
else:
image_id = form_data['extra_opts.imageID']
Expand Down
28 changes: 26 additions & 2 deletions app/templates/advanced_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ <h5>Cloud Provider:</h5>
$('#siteImages').hide();
$('#fedcloudUsage').hide();
}
$("#selectedImage").prop('disabled', false);
$("#selectedSiteImage").prop('disabled', false);
}

function loadImages() {
Expand Down Expand Up @@ -209,6 +211,28 @@ <h5>Cloud Provider:</h5>
});
}

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);
}
Expand Down Expand Up @@ -252,15 +276,15 @@ <h5>Cloud Provider:</h5>
<label>Select only one of this options AppDB or Site image:</label>
<br/>
<label>Select AppDB image:</label>
<select class="js-example-basic-single js-states form-control" id="selectedImage" name="extra_opts.selectedImage" onchange="activateSubmit()">
<select class="js-example-basic-single js-states form-control" id="selectedImage" name="extra_opts.selectedImage" onchange="selectedImageChanged()">
<option name="selectedImage" value="">Select provider</option>
</select>
</div>

<div id="siteImages" style="display: none;">
<br/>
<label>Select Site image:</label>
<select class="js-example-basic-single js-states form-control" id="selectedSiteImage" name="extra_opts.selectedSiteImage" onchange="activateSubmit()">
<select class="js-example-basic-single js-states form-control" id="selectedSiteImage" name="extra_opts.selectedSiteImage" onchange="selectedSiteImageChanged()">
<option name="selectedSiteImage" value="">Select provider</option>
</select>
</div>
Expand Down

0 comments on commit 016cb10

Please sign in to comment.