From 03cc74146657be5fbb61151804c2763e3b64b1a1 Mon Sep 17 00:00:00 2001 From: Pedro Maximino Date: Fri, 21 Jun 2024 11:51:00 +0200 Subject: [PATCH] SwanSpawner: Move analytix cluster to Alma9 platform only --- .../templates/options_form_template.html | 37 ++++--------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/SwanSpawner/swanspawner/templates/options_form_template.html b/SwanSpawner/swanspawner/templates/options_form_template.html index a717b07..9e374ef 100644 --- a/SwanSpawner/swanspawner/templates/options_form_template.html +++ b/SwanSpawner/swanspawner/templates/options_form_template.html @@ -144,10 +144,6 @@ for( var i = 0 ; i < lcgData.clusters.length ; i++ ){ var lcgCluster = lcgData.clusters[i]; - if (lcgCluster.value === "k8s" || lcgCluster.value === "hadoop-qa") { - continue; - } - var selectClusterOption = document.createElement("option"); selectClusterOption.value = lcgCluster.value; selectClusterOption.text = lcgCluster.text; @@ -174,43 +170,26 @@ selectCondor.add(selectCondorOption); } + + adjust_spark(); } + /** * Modifies the selection of Spark clusters depending on the chosen platform */ function adjust_spark() { var platformOptions = document.getElementById('platformOptions'); - - function removeCluster(cluster) { - var clusterOptions = document.getElementById('clusterOptions'); - for (var i = 0; i < clusterOptions.options.length; i++) { - if (clusterOptions.options[i].value === cluster) { - clusterOptions.remove(i); - break; - } - } - } - - function addCluster(clusterValue, clusterName) { - var selectClusterOption = document.createElement("option"); - selectClusterOption.value = clusterValue; - selectClusterOption.text = clusterName; - clusterOptions.add(selectClusterOption); - } + var clusterOptions = document.getElementById('clusterOptions'); var isAlma = platformOptions.selectedOptions[0].text.startsWith('AlmaLinux 9'); if (isAlma) { + // On Alma9, make sure cluster selection is enabled + clusterOptions.removeAttribute('disabled'); + } else { + clusterOptions.setAttribute('disabled', ''); clusterOptions.selectedIndex = 0; - removeCluster("analytix") - addCluster("k8s", "Cloud Containers (K8s)") - addCluster("hadoop-qa", "QA") - } - else { - addCluster("analytix", "General Purpose (Analytix)") - removeCluster("k8s") - removeCluster("hadoop-qa") } }