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 ===================================================================
31 <div id="configure-widgets">
32 <div class="modal-header">
33 <button type="button" class="close" ng-click="close(false)"
34 aria-hidden="true" style="margin-top: -3px">×</button>
35 <h4>Model Properties</h4>
38 <div class="modal-body" style="height: 280px">
39 <i hidden id="ridinSpinners" class="fa fa-spinner fa-spin"
40 style="display: none; margin-bottom: 10px; width: 100%; text-align: center; font-size: 24px; color: black;"></i>
42 <div class="alert alert-danger" role="alert" id='paramsWarn'>
43 <strong>Ooops!</strong> Unable to load properties for <span
44 id='servName'>. Would you like to</span> <a
45 href="javascript:void(0);" class="btn-link" id='paramsRetry'>Retry
46 </a> / <a href="javascript:void(0);" class="btn-link" id='paramsCancel'>Cancel</a>
50 <div class="form-group clearfix">
51 <label for="services" class="col-sm-4 control-label">Services</label>
53 <div class="col-sm-8">
54 <select class="form-control" name="service" id="service"
55 onchange="propChangeAlert(this);">
56 <!-- <option ng-repeat="(key, value) in services" value="{{key}}">{{value}}</option> -->
60 <div class="form-group clearfix">
61 <label for="vf" class="col-sm-4 control-label"> Resource-VF</label>
63 <div class="col-sm-8">
64 <select class="form-control" id="vf" name="vf"
65 onchange="propChangeAlert(this);">
72 <div class="form-group clearfix">
73 <label for="actionSet" class="col-sm-4 control-label">
76 <div class="col-sm-8">
77 <select class="form-control" id="actionSet" name="actionSet"
78 onchange="propChangeAlert(this);">
84 <div class="form-group clearfix">
85 <label for="location" class="col-sm-4 control-label">
88 <div class="col-sm-8">
89 <select class="form-control" id="location" name="location"
96 <div class="form-group clearfix">
97 <label for="deployParameters" class="col-sm-4 control-label">
98 Deploy Parameters</label>
100 <div class="col-sm-8">
101 <textarea class="form-control" id="deployParameters"
102 name="deployParameters" rows="3">
112 <div class="alert alert-warning propChangeWarn" style="display: none;">
113 <strong>Warning!</strong> Changing these properties will reset all
114 associated GUI fields.
118 <div class="modal-footer">
119 <button id="savePropsBtn" class="btn btn-primary" ng-click="submitForm()">Save</button>
120 <button ng-click="close(true)" id="close_button"
121 class="btn btn-primary">Cancel</button>
127 //display message only if global was previously saved
132 $("#paramsWarn").hide();
133 /*Below service method is called for checking the service is being loaded or not*/
134 var intialize = intializeService;
135 function intializeService() {
136 $("#service").off('focus').off('change');
137 $("#service").on('change', function() {
138 var chosen = $(this).val();
140 $("#ridinSpinners").show();
141 setTimeout(spinner, 1);
143 loadSharedPropertyByService(chosen, null, intialize);
144 if (elementMap["global"]) {
145 if ($("#vf").val() == oldVf) {
147 if ((!vfDiff) && (!asDiff) && (!serDiff)) {
148 $(".propChangeWarn").hide();
153 $(".propChangeWarn").show();
156 $("#ridinSpinners").hide();
160 loadSharedPropertyByService(undefined, null, intialize);
162 $("#paramsRetry").on('click', function() {
163 //$("#paramsWarn").hide();
164 var currentValue = $("#service").val();
165 $("#ridinSpinners").css("display", "")
166 var bool = loadSharedPropertyByService(currentValue);
167 $("#ridinSpinners").css("display", "none")
169 $("#paramsCancel").on('click', function() {
170 loadSharedPropertyByServiceProperties();
171 $("#paramsWarn").hide();
175 if (elementMap["global"]) {
176 for (var i = 0; i < elementMap["global"].length; i++) {
177 if (elementMap["global"][i]["name"] == "vf") {
178 oldVf = elementMap["global"][i]["value"];
185 function propChangeAlert(actionset) {
186 //throw warnings only if options were previously chosen
187 if (elementMap["global"]) {
188 loop1: for (var i = 0; i < elementMap["global"].length; i++) {
189 if (elementMap["global"][i]["name"] == actionset.id) {
190 //user did not change properties
191 if (elementMap["global"][i]["value"][0] == actionset.value) {
192 if (elementMap["global"][i]["name"] == "actionSet") {
194 } else if (elementMap["global"][i]["name"] == "service") {
196 } else if (elementMap["global"][i]["name"] == "vf") {
199 if ((!vfDiff) && (!asDiff) && (!serDiff)) {
200 $(".propChangeWarn").hide();
203 //user changed properties
205 if (elementMap["global"][i]["name"] == "actionSet") {
207 } else if (elementMap["global"][i]["name"] == "service") {
209 } else if (elementMap["global"][i]["name"] == "vf") {
213 $(".propChangeWarn").show();