X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetstack%2Ftemplates%2Fadmin%2Fcore%2Fslice%2Fchange_form.html;h=e97364b2e74500a4dce085283250d1a34f3b6984;hb=7283fdfaefe3542d1349e0971d224c0d0c0aefbb;hp=c94b5804c8d2c3c90ac7d24897c0a2d745505000;hpb=01ef649428b0452c059b679928f324470342bc18;p=plstackapi.git diff --git a/planetstack/templates/admin/core/slice/change_form.html b/planetstack/templates/admin/core/slice/change_form.html index c94b580..e97364b 100644 --- a/planetstack/templates/admin/core/slice/change_form.html +++ b/planetstack/templates/admin/core/slice/change_form.html @@ -8,6 +8,13 @@ deployment_nodes = [ {% endfor %} ]; +sites = [ +{% for s in sites %} + [{{ s.0 }}, {{ s.1 }}], +{% endfor %} +]; + + function update_nodes(deployment_select, node_select_id) { deployment_id = $(deployment_select).val(); html = "\n"; @@ -20,6 +27,15 @@ function update_nodes(deployment_select, node_select_id) { //console.log(html); $("#"+node_select_id).empty().append(html); } + +function update_slice_prefix(site_select, slice_name_id) { + site_id = $(site_select).val(); + slice_prefix=""; + if (site_id in sites) { + slice_prefix=sites[site_id]+"_"; + } + $("#"+slice_name_id).val(slice_prefix); +} {% endblock %}