- <!-- <select id="vUSP_vfc" disabled hidden></select>
- <select id="vUSP_location" disabled hidden></select>
- <select id="vUSP_recipe" disabled hidden></select>
- <select id="vUSP_vf" disabled hidden></select>
-
- <select id="Trinity_vfc" disabled hidden></select>
- <select id="Trinity_location" disabled hidden></select>
- <select id="Trinity_recipe" disabled hidden></select>
- <select id="Trinity_vf" disabled hidden></select>
-
-
- <select id="vSCP_vfc" disabled hidden></select>
- <select id="vSCP_location" disabled hidden></select>
- <select id="vSCP_recipe" disabled hidden></select>
- <select id="vSCP_vf" disabled hidden></select>
-
- <select id="vProbes_vfc" disabled hidden></select>
- <select id="vProbes_location" disabled hidden></select>
- <select id="vProbes_recipe" disabled hidden></select>
- <select id="vProbes_vf" disabled hidden></select> -->
-
-
- <script>
-// $.ajax({
-// async:false,
-// dataType: "json",
-// url: '/restservices/clds/v1/clds/asdc/services/',
-// success: function(data){
-// vf_Services=data;
-// },
-// error:function(s,a,err){
-// console.log(err)
-// console.log(s)
-// console.log(a)
-// },
-// timeout:100000
-// });
-// var services=vf_Services.service
-// console.log(elementMap["global"])
-// for(k in services){
-// console.log("lol")
-// $("#service").append("<option value="+k+">"+services[k]+"</option>")
-// }
-// loadSharedPropertyByService()
-// var el = elementMap["global"];
-// $("#status").val($("#activity_modeler").text())
-// if (el !== undefined) {
-// for (var i = 0; i < el.length; i++) {
-// $("#" + el[i].name).val(el[i].value);
-// }
-// }
-
- //display message only if global was previously saved
- serDiff = false;
- vfDiff = false;
- asDiff = false;
-
- (function () {
- $("#paramsWarn").hide();
- /*Below service method is called for checking the service is being loaded or not*/
-
- var intialize = intializeService;
-
- function intializeService() {
- $("#service").off('focus').off('change');
-
- $("#service").on('change', function(){
- var chosen = $(this).val();
- (function(spinner){
- $("#ridinSpinners").show();
- setTimeout(spinner, 1);
- })(function(){
- loadSharedPropertyByService(chosen, null, intialize);
- if (elementMap["global"]){
- if ($("#vf").val() == oldVf){
- vfDiff = false;
- if ((!vfDiff)&&(!asDiff)&&(!serDiff)){
- $(".propChangeWarn").hide();
- };
- } else {
- vfDiff = true;
- $(".propChangeWarn").show();
- }
- }
- $("#ridinSpinners").hide();
- });
- });
- }
-
- loadSharedPropertyByService(undefined, null, intialize);
- intializeService();
-
- $("#paramsRetry").on('click', function () {
- //$("#paramsWarn").hide();
- var currentValue = $("#service").val();
- $("#ridinSpinners").css("display","")
- var bool=loadSharedPropertyByService(currentValue);
- $("#ridinSpinners").css("display","none")
- });
- $("#paramsCancel").on('click', function () {
- loadSharedPropertyByServiceProperties();
- $("#paramsWarn").hide();
-
- });
-
- })();
-
- function noRepeats(form){
- var select={};
- for(var i=0;i<form.length;i++){
- if(form[i].hasOwnProperty("name")){
- if(select[form[i].name]===undefined)
- select[form[i].name]=[]
- select[form[i].name].push(form[i].value);
- }
- }
- var arr=[]
- for(s in select){
- var f={}
- f.name=s
- f.value=select[s]
- if (!(s=="service" && f.value=="")){
- arr.push(f)
- }
- }
- return arr
- }
-
- $(function(){
- if (elementMap["global"]){
- for (var i=0; i< elementMap["global"].length; i++){
- if (elementMap["global"][i]["name"]=="vf"){
- oldVf = elementMap["global"][i]["value"];
- }
- }
- } else {
- oldVf = "";
- }
- });
-
- function propChangeAlert(actionset){
- //throw warnings only if options were previously chosen
- if (elementMap["global"]){
- loop1:
- for (var i=0; i< elementMap["global"].length; i++){
- if (elementMap["global"][i]["name"] == actionset.id){
- //user did not change properties
- if (elementMap["global"][i]["value"][0] == actionset.value){
- if (elementMap["global"][i]["name"] == "actionSet"){
- asDiff = false;
- } else if (elementMap["global"][i]["name"] == "service"){
- serDiff = false;
- } else if (elementMap["global"][i]["name"] == "vf"){
- vfDiff = false;
- }
- if ((!vfDiff)&&(!asDiff)&&(!serDiff)){
- $(".propChangeWarn").hide();
- };
- //user changed properties
- } else {
- if (elementMap["global"][i]["name"] == "actionSet"){
- asDiff = true;
- } else if (elementMap["global"][i]["name"] == "service"){
- serDiff = true;
- } else if (elementMap["global"][i]["name"] == "vf"){
- vfDiff = true;
- };
- $(".propChangeWarn").show();
- }
- break loop1;
- }
- }
- }
- }
-
- $("#saveProps").on('submit', function(event) {
- saveGlobalProperties(noRepeats($(this).serializeArray()))
- event.preventDefault();
-
- //module reset, based on property updates
- if (elementMap["global"]){
- $.each(Object.keys(elementMap), function(i,v){
- if ((v.match(/^Policy/)) && asDiff){
- elementMap[v]={};
- }
- if ((v.match(/^TCA/)) && (vfDiff || serDiff)){
- elementMap[v]={};
- }
- });
- };
-
- $("#close_button").click();
- })
-
- $("#savePropsBtn").click(function(event) {
- //alert($("#CProp_Target").val())
- $("#saveProps").submit();
- })