2 ============LICENSE_START=======================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property. All rights
7 ================================================================================
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END============================================
20 ===================================================================
21 ECOMP is a trademark and service mark of AT&T Intellectual Property.
32 .fileUpload input.upload {
41 filter: alpha(opacity = 0);
46 display: inline-block;
58 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
59 <script type="text/javascript">
60 function disablefile() {
62 document.getElementById("fileUpload").disabled = true;
66 function disableSVN() {
68 document.getElementById("schemaLocation").disabled = true;
69 document.getElementById("userID").disabled = true;
70 document.getElementById("password").disabled = true;
77 <div id="configure-widgets">
78 <div class="modal-header">
79 <button type="button" class="close" ng-click="close(false)"
80 aria-hidden="true" style="margin-top: -3px">×</button>
81 <h4>Model Properties</h4>
84 <div class="modal-body" style="height: 280px">
85 <i hidden id="ridinSpinners" class="fa fa-spinner fa-spin" style="display:none;margin-bottom:10px;width:100%;text-align:center;font-size:24px;color:black;"></i>
86 <form id="saveProps" >
87 <div class="alert alert-danger" role="alert" id='paramsWarn'>
88 <strong>Ooops!</strong> Unable to load properties for <span id='servName'>. Would you like to</span>
89 <a href="javascript:void(0);" class="btn-link" id='paramsRetry'>Retry </a> /
90 <a href="javascript:void(0);" class="btn-link" id='paramsCancel'>Cancel</a>
94 <div class="form-group clearfix">
95 <label for="services" class="col-sm-4 control-label" >Services</label>
97 <div class="col-sm-8">
98 <select class="form-control"
99 name="service" id="service" onchange="propChangeAlert(this);">
100 <!-- <option ng-repeat="(key, value) in services" value="{{key}}">{{value}}</option> -->
104 <div class="form-group clearfix">
105 <label for="vf" class="col-sm-4 control-label">
108 <div class="col-sm-8">
109 <select class="form-control" id="vf" name="vf" onchange="propChangeAlert(this);">
116 <div class="form-group clearfix">
117 <label for="actionSet" class="col-sm-4 control-label">
120 <div class="col-sm-8">
121 <select class="form-control" id="actionSet" name="actionSet" onchange="propChangeAlert(this);">
127 <div class="form-group clearfix">
128 <label for="location" class="col-sm-4 control-label">
131 <div class="col-sm-8">
132 <select class="form-control" id="location" name="location" multiple size=2>
144 <div class="alert alert-warning propChangeWarn" style="display:none;">
145 <strong>Warning!</strong> Changing these properties will reset all associated GUI fields.
149 <div class="modal-footer">
150 <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>-->
151 <button id="savePropsBtn" class="btn btn-primary">Save</button>
152 <button ng-click="close(true)" id="close_button"
153 class="btn btn-primary">Cancel</button>
156 <!-- <select id="vUSP_vfc" disabled hidden></select>
157 <select id="vUSP_location" disabled hidden></select>
158 <select id="vUSP_recipe" disabled hidden></select>
159 <select id="vUSP_vf" disabled hidden></select>
161 <select id="Trinity_vfc" disabled hidden></select>
162 <select id="Trinity_location" disabled hidden></select>
163 <select id="Trinity_recipe" disabled hidden></select>
164 <select id="Trinity_vf" disabled hidden></select>
167 <select id="vSCP_vfc" disabled hidden></select>
168 <select id="vSCP_location" disabled hidden></select>
169 <select id="vSCP_recipe" disabled hidden></select>
170 <select id="vSCP_vf" disabled hidden></select>
172 <select id="vProbes_vfc" disabled hidden></select>
173 <select id="vProbes_location" disabled hidden></select>
174 <select id="vProbes_recipe" disabled hidden></select>
175 <select id="vProbes_vf" disabled hidden></select> -->
182 // url: '/restservices/clds/v1/clds/asdc/services/',
183 // success: function(data){
186 // error:function(s,a,err){
193 // var services=vf_Services.service
194 // console.log(elementMap["global"])
195 // for(k in services){
196 // console.log("lol")
197 // $("#service").append("<option value="+k+">"+services[k]+"</option>")
199 // loadSharedPropertyByService()
200 // var el = elementMap["global"];
201 // $("#status").val($("#activity_modeler").text())
202 // if (el !== undefined) {
203 // for (var i = 0; i < el.length; i++) {
204 // $("#" + el[i].name).val(el[i].value);
208 //display message only if global was previously saved
214 $("#paramsWarn").hide();
215 /*Below service method is called for checking the service is being loaded or not*/
217 var intialize = intializeService;
219 function intializeService() {
220 $("#service").off('focus').off('change');
222 $("#service").on('change', function(){
223 var chosen = $(this).val();
225 $("#ridinSpinners").show();
226 setTimeout(spinner, 1);
228 loadSharedPropertyByService(chosen, null, intialize);
229 if (elementMap["global"]){
230 if ($("#vf").val() == oldVf){
232 if ((!vfDiff)&&(!asDiff)&&(!serDiff)){
233 $(".propChangeWarn").hide();
237 $(".propChangeWarn").show();
240 $("#ridinSpinners").hide();
245 loadSharedPropertyByService(undefined, null, intialize);
248 $("#paramsRetry").on('click', function () {
249 //$("#paramsWarn").hide();
250 var currentValue = $("#service").val();
251 $("#ridinSpinners").css("display","")
252 var bool=loadSharedPropertyByService(currentValue);
253 $("#ridinSpinners").css("display","none")
255 $("#paramsCancel").on('click', function () {
256 loadSharedPropertyByServiceProperties();
257 $("#paramsWarn").hide();
263 function noRepeats(form){
265 for(var i=0;i<form.length;i++){
266 if(form[i].hasOwnProperty("name")){
267 if(select[form[i].name]===undefined)
268 select[form[i].name]=[]
269 select[form[i].name].push(form[i].value);
277 if (!(s=="service" && f.value=="")){
285 if (elementMap["global"]){
286 for (var i=0; i< elementMap["global"].length; i++){
287 if (elementMap["global"][i]["name"]=="vf"){
288 oldVf = elementMap["global"][i]["value"];
296 function propChangeAlert(actionset){
297 //throw warnings only if options were previously chosen
298 if (elementMap["global"]){
300 for (var i=0; i< elementMap["global"].length; i++){
301 if (elementMap["global"][i]["name"] == actionset.id){
302 //user did not change properties
303 if (elementMap["global"][i]["value"][0] == actionset.value){
304 if (elementMap["global"][i]["name"] == "actionSet"){
306 } else if (elementMap["global"][i]["name"] == "service"){
308 } else if (elementMap["global"][i]["name"] == "vf"){
311 if ((!vfDiff)&&(!asDiff)&&(!serDiff)){
312 $(".propChangeWarn").hide();
314 //user changed properties
316 if (elementMap["global"][i]["name"] == "actionSet"){
318 } else if (elementMap["global"][i]["name"] == "service"){
320 } else if (elementMap["global"][i]["name"] == "vf"){
323 $(".propChangeWarn").show();
331 $("#saveProps").on('submit', function(event) {
332 saveGlobalProperties(noRepeats($(this).serializeArray()))
333 event.preventDefault();
335 //module reset, based on property updates
336 if (elementMap["global"]){
337 $.each(Object.keys(elementMap), function(i,v){
338 if ((v.match(/^Policy/)) && asDiff){
341 if ((v.match(/^TCA/)) && (vfDiff || serDiff)){
347 $("#close_button").click();
350 $("#savePropsBtn").click(function(event) {
351 //alert($("#CProp_Target").val())
352 $("#saveProps").submit();