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 ===================================================================
32 .fileUpload input.upload {
41 filter: alpha(opacity = 0);
46 display: inline-block;
59 <link rel="stylesheet"
60 href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
61 <script type="text/javascript">
62 function disablefile() {
63 document.getElementById("fileUpload").disabled = true;
65 function disableSVN() {
66 document.getElementById("schemaLocation").disabled = true;
67 document.getElementById("userID").disabled = true;
68 document.getElementById("password").disabled = true;
73 <div id="configure-widgets">
74 <div class="modal-header">
75 <button type="button" class="close" ng-click="close(false)"
76 aria-hidden="true" style="margin-top: -3px">×</button>
77 <h4>Model Properties</h4>
80 <div class="modal-body" style="height: 280px">
81 <i hidden id="ridinSpinners" class="fa fa-spinner fa-spin"
82 style="display: none; margin-bottom: 10px; width: 100%; text-align: center; font-size: 24px; color: black;"></i>
84 <div class="alert alert-danger" role="alert" id='paramsWarn'>
85 <strong>Ooops!</strong> Unable to load properties for <span
86 id='servName'>. Would you like to</span> <a
87 href="javascript:void(0);" class="btn-link" id='paramsRetry'>Retry
88 </a> / <a href="javascript:void(0);" class="btn-link" id='paramsCancel'>Cancel</a>
92 <div class="form-group clearfix">
93 <label for="services" class="col-sm-4 control-label">Services</label>
95 <div class="col-sm-8">
96 <select class="form-control" name="service" id="service"
97 onchange="propChangeAlert(this);">
98 <!-- <option ng-repeat="(key, value) in services" value="{{key}}">{{value}}</option> -->
102 <div class="form-group clearfix">
103 <label for="vf" class="col-sm-4 control-label"> Resource-VF</label>
105 <div class="col-sm-8">
106 <select class="form-control" id="vf" name="vf"
107 onchange="propChangeAlert(this);">
114 <div class="form-group clearfix">
115 <label for="actionSet" class="col-sm-4 control-label">
118 <div class="col-sm-8">
119 <select class="form-control" id="actionSet" name="actionSet"
120 onchange="propChangeAlert(this);">
126 <div class="form-group clearfix">
127 <label for="location" class="col-sm-4 control-label">
130 <div class="col-sm-8">
131 <select class="form-control" id="location" name="location"
144 <div class="alert alert-warning propChangeWarn" style="display: none;">
145 <strong>Warning!</strong> Changing these properties will reset all
146 associated GUI fields.
150 <div class="modal-footer">
151 <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>-->
152 <button id="savePropsBtn" class="btn btn-primary">Save</button>
153 <button ng-click="close(true)" id="close_button"
154 class="btn btn-primary">Cancel</button>
160 //display message only if global was previously saved
165 $("#paramsWarn").hide();
166 /*Below service method is called for checking the service is being loaded or not*/
167 var intialize = intializeService;
168 function intializeService() {
169 $("#service").off('focus').off('change');
170 $("#service").on('change', function() {
171 var chosen = $(this).val();
173 $("#ridinSpinners").show();
174 setTimeout(spinner, 1);
176 loadSharedPropertyByService(chosen, null, intialize);
177 if (elementMap["global"]) {
178 if ($("#vf").val() == oldVf) {
180 if ((!vfDiff) && (!asDiff) && (!serDiff)) {
181 $(".propChangeWarn").hide();
186 $(".propChangeWarn").show();
189 $("#ridinSpinners").hide();
193 loadSharedPropertyByService(undefined, null, intialize);
195 $("#paramsRetry").on('click', function() {
196 //$("#paramsWarn").hide();
197 var currentValue = $("#service").val();
198 $("#ridinSpinners").css("display", "")
199 var bool = loadSharedPropertyByService(currentValue);
200 $("#ridinSpinners").css("display", "none")
202 $("#paramsCancel").on('click', function() {
203 loadSharedPropertyByServiceProperties();
204 $("#paramsWarn").hide();
207 function noRepeats(form) {
209 for (var i = 0; i < form.length; i++) {
210 if (form[i].hasOwnProperty("name")) {
211 if (select[form[i].name] === undefined)
212 select[form[i].name] = []
213 select[form[i].name].push(form[i].value);
221 if (!(s == "service" && f.value == "")) {
228 if (elementMap["global"]) {
229 for (var i = 0; i < elementMap["global"].length; i++) {
230 if (elementMap["global"][i]["name"] == "vf") {
231 oldVf = elementMap["global"][i]["value"];
238 function propChangeAlert(actionset) {
239 //throw warnings only if options were previously chosen
240 if (elementMap["global"]) {
241 loop1: for (var i = 0; i < elementMap["global"].length; i++) {
242 if (elementMap["global"][i]["name"] == actionset.id) {
243 //user did not change properties
244 if (elementMap["global"][i]["value"][0] == actionset.value) {
245 if (elementMap["global"][i]["name"] == "actionSet") {
247 } else if (elementMap["global"][i]["name"] == "service") {
249 } else if (elementMap["global"][i]["name"] == "vf") {
252 if ((!vfDiff) && (!asDiff) && (!serDiff)) {
253 $(".propChangeWarn").hide();
256 //user changed properties
258 if (elementMap["global"][i]["name"] == "actionSet") {
260 } else if (elementMap["global"][i]["name"] == "service") {
262 } else if (elementMap["global"][i]["name"] == "vf") {
266 $(".propChangeWarn").show();
273 $("#saveProps").on('submit', function(event) {
274 saveGlobalProperties(noRepeats($(this).serializeArray()))
275 event.preventDefault();
276 //module reset, based on property updates
277 if (elementMap["global"]) {
278 $.each(Object.keys(elementMap), function(i, v) {
279 if ((v.match(/^Policy/)) && asDiff) {
282 if ((v.match(/^TCA/)) && (vfDiff || serDiff)) {
288 $("#close_button").click();
290 $("#savePropsBtn").click(function(event) {
291 //alert($("#CProp_Target").val())
292 $("#saveProps").submit();