diff options
Diffstat (limited to 'src/main/resources/META-INF/resources/designer')
7 files changed, 8 insertions, 414 deletions
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html index 811f6b71..c47e90a4 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html @@ -48,28 +48,6 @@ <div> <div class="form-group clearfix"> - <label for="services" class="col-sm-4 control-label">Services</label> - - <div class="col-sm-8"> - <select class="form-control" name="service" id="service" - onchange="propChangeAlert(this);"> - <!-- <option ng-repeat="(key, value) in services" value="{{key}}">{{value}}</option> --> - </select> - </div> - </div> - <div class="form-group clearfix"> - <label for="vf" class="col-sm-4 control-label"> Resource-VF</label> - - <div class="col-sm-8"> - <select class="form-control" id="vf" name="vf" - onchange="propChangeAlert(this);"> - - </select> - - </div> - </div> - - <div class="form-group clearfix"> <label for="actionSet" class="col-sm-4 control-label"> Action Set</label> @@ -125,63 +103,8 @@ <script> //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() { - 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"]) { @@ -191,12 +114,8 @@ 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)) { + if (!asDiff) { $(".propChangeWarn").hide(); } ; @@ -204,12 +123,7 @@ } 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; diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html deleted file mode 100644 index 441766d4..00000000 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/refresh_asdc.html +++ /dev/null @@ -1,146 +0,0 @@ -<!-- - ============LICENSE_START======================================================= - ONAP CLAMP - ================================================================================ - Copyright (C) 2017 AT&T Intellectual Property. All rights - reserved. - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END============================================ - =================================================================== - - --> - -<style> -#paramsWarnrefresh { - display: none; -} - -</style> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -<div attribute-test="refreshasdc" id="configure-widgets"> - <div attribute-test="refreshasdch" class="modal-header"> - <button type="button" class="close" ng-click="close(false)" - aria-hidden="true" style="margin-top: -3px">×</button> - <h4>Model Properties</h4> - </div> - <div class="modal-body" style="height: 280px"> - <div style="height: 10px"></div> - <div class="alert alert-danger refreshASDC" role="alert" id='paramsWarnrefresh'> - <strong>Ooops!</strong> Unable to load properties for <span id='servName'>. Would you like to</span> - <a href="javascript:void(0);" ng-click="paramsRetry();" class="btn-link" id='paramsRetry'>Retry </a> / - <a href="javascript:void(0);" ng-click="paramsCancel();" class="btn-link" id='paramsCancel'>Cancel</a> - </div> - <form id="saveProps" > - <div> - - <div class="form-group"> - <label for="services" class="col-sm-4 control-label" >Refresh ASDC services?</label> - - - </div> - - </div> - - </form> - <i hidden id="ridinSpinners" class="fa fa-spinner fa-spin" style="display:none;width:100%;text-align:center;font-size:24px;color:black;"></i> - - </div> - <div attribute-test="refreshasdcf" class="modal-footer"> - <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>--> - <button ng-click="refreshASDC()" class="btn btn-primary">refresh</button> - <button ng-click="close(true)" id="close_button" - class="btn btn-primary">Cancel</button> - - </div> - <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); -// } -// } - var previous; - (function () { - - $("#service").on('focus', function () { - // Store the current value on focus and on change - previous = this.value; - console.log("hello") - }).change(function(){ - $("#ridinSpinners").css("display","") - var bool=loadSharedPropertyByService($(this).val()) - $("#ridinSpinners").css("display","none") - if(!bool) - $(this).val(previous) - }); - - })(); -// $("#service").on("change",function(){ -// $("#ridinSpinners").css("display","") -// loadSharedPropertyByService($(this).val()) -// $("#ridinSpinners").css("display","none") -// }) - function noRepeats(form){ - var select={}; - for(var i=0;i<form.length;i++){ - 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] - arr.push(f) - } - return arr - } - - $("#saveProps").on('submit', function(event) { - saveGlobalProperties(noRepeats($(this).serializeArray())) - event.preventDefault(); - - $("#close_button").click(); - - }) - $("#savePropsBtn").click(function(event) { - //alert($("#CProp_Target").val()) - $("#saveProps").submit(); - }) - </script> -</div> - diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js index 9d4598b8..0e44aec1 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -117,34 +117,6 @@ app handleQueryToBackend(def, action, deployUrl, requestData); return def.promise; }; - this.getASDCServices = function() { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/sdc/services/"; - $http.get(svcUrl).success(function(data) { - - def.resolve(data); - }).error(function(data) { - - def.reject("sdc Services not found"); - }); - return def.promise; - }; - this.getASDCService = function(uuid) { - - var def = $q.defer(); - var sets = []; - var svcUrl = "/restservices/clds/v1/clds/sdc/services/" + uuid; - $http.get(svcUrl).success(function(data) { - - def.resolve(data); - }).error(function(data) { - - def.reject("SDC service not found"); - }); - return def.promise; - }; this.getModel = function(modelName) { var def = $q.defer(); @@ -373,8 +345,6 @@ app .remove('ThisLink'); document.getElementById('Refresh Status').classList .remove('ThisLink'); - document.getElementById('Refresh ASDC').classList - .remove('ThisLink'); } // enable/disable menu options based on permittedActionCd // list @@ -392,10 +362,4 @@ app this.checkPermittedActionCd(permittedActionCd, 'UnDeploy', 'UNDEPLOY'); } - this.getASDCServices().then(function(pars) { - - var obj = JSON.parse(pars); - var services = obj.service; - asdc_Services = services - }); } ]); diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js index a64af746..2b7c6258 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsOpenModelCtrl.js @@ -51,8 +51,6 @@ function($scope, $rootScope, $modalInstance, $window, $uibModalInstance, cldsMod }); $scope.paramsRetry = function() { // $("#paramsWarn").hide(); - var currentValue = $("#service").val() == null ? previous : $( - "#service").val(); $("#ridinSpinners").css("display", "") loadSharedPropertyByService(currentValue, true, callBack); $("#ridinSpinners").css("display", "none") @@ -71,11 +69,6 @@ function($scope, $rootScope, $modalInstance, $window, $uibModalInstance, cldsMod $scope.close(); } } - $scope.refreshASDC = function() { - $("#ridinSpinners").css("display", "") - var bool = loadSharedPropertyByService(undefined, true, callBack); - $("#ridinSpinners").css("display", "none"); - } cldsTemplateService.getSavedTemplate().then(function(pars) { $scope.templateNamel = [] for (var i = 0; i < pars.length; i++) { diff --git a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js index f4c658ce..21572a5f 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js @@ -31,15 +31,9 @@ app.controller('GlobalPropertiesCtrl', [ function($scope, $rootScope, $uibModalInstance, cldsModelService, $location, dialogs, cldsTemplateService) { $scope.$watch('name', function(newValue, oldValue) { - var services = asdc_Services + setASDCFields() - // add blank service item as the default service, to force user chose - // the correct service by themselves - $("#service").append("<option></option>") - for (k in services) { - $("#service").append( - "<option value=" + k + ">" + services[k] + "</option>") - } + var el = elementMap["global"]; if (el !== undefined) { for (var i = 0; i < el.length; i++) { diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js index b69cfea0..11ad5fa9 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js +++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js @@ -142,56 +142,7 @@ function setMultiSelect() { } function loadSharedPropertyByService(onChangeUUID, refresh, callBack) { - var uuid = onChangeUUID; - if (uuid === undefined) { - uuid = elementMap["global"] && elementMap["global"].length > 0 ? - elementMap["global"][0].value : ""; - } - var share = null, - serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid; - if (refresh) { - serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid + '?refresh=true'; - } - - $.ajax({ - async: false, - dataType: "json", - url: serviceUrl, - success: function(data) { - vf_Services = JSON.parse(data); setASDCFields() - if (refresh) { - $("#paramsWarnrefresh").hide(); - } - if ($("#paramsWarn")) { - $("#paramsWarn").hide(); - } - if (callBack && _.isFunction(callBack)) { - callBack(true); - } - }, - error: function(s, a, err) { - if (refresh) { - $("#paramsWarnrefresh").show(); - } - if ($("#paramsWarn")) { - $("#paramsWarn").show(); - } - - $('#servName').text($("#service option:selected").text()); - if (callBack && _.isFunction(callBack)) { - callBack(false); - } - console.log(err) - console.log(s) - console.log(a) - }, - timeout: 100000 - - }); - - //vf_Services=share['shared']['byService'][uuid]; - //location_values = share['global']['location']; } function loadSharedPropertyByServiceProperties(callBack) { @@ -218,45 +169,8 @@ function loadSharedPropertyByServiceProperties(callBack) { } function setASDCFields() { - if (vf_Services === null || vf_Services === undefined) { - loadSharedPropertyByService() - } else { try { - $("#vf").empty().multiselect("refresh"); - $("#location").empty().multiselect("refresh"); - $("#actionSet").empty().multiselect("refresh"); - $("#vfc").empty().multiselect("refresh"); - $("#paramsWarn").hide(); - var uuid = Object.keys(vf_Services['shared']['byService'])[0]; - - var vf_values = vf_Services['shared']['byService'][uuid] && - vf_Services['shared']['byService'][uuid]['vf'] && - _.keys(vf_Services['shared']['byService'][uuid]['vf']).length > 0 ? - vf_Services['shared']['byService'][uuid]['vf'] : null; - - var selectedVF = {} - for (let e in elementMap["global"]) { - if (elementMap['global'][e].name === "vf") { - selectedVF = elementMap['global'][e].value[0] - } - } - - var vfc_values2 = selectedVF && - vf_Services['shared']['byVf'][selectedVF] && - vf_Services['shared']['byVf'][selectedVF]['vfc'] && - _.keys(vf_Services['shared']['byVf'][selectedVF]['vfc']).length > 0 ? - vf_Services['shared']['byVf'][selectedVF]['vfc'] : null; - - if (vf_values) { - for (key in vf_values) { - if ($("#vf").length > 0) { - $("#vf").append("<option value=\"" + key + "\">" + vf_values[key] + "</opton>") - } - } - $("#vf").multiselect("rebuild"); - } - - var location_values = vf_Services['global']['location']; + var location_values = defaults_props['global']['location']; if (location_values) { for (key in location_values) { if ($("#location").length > 0) { @@ -266,7 +180,7 @@ function setASDCFields() { $("#location").multiselect("rebuild"); } - var actionSet_values = vf_Services['global']['actionSet']; + var actionSet_values = defaults_props['global']['actionSet']; if (actionSet_values) { for (key in actionSet_values) { if ($("#actionSet").length > 0) { @@ -275,22 +189,6 @@ function setASDCFields() { } $("#actionSet").multiselect("rebuild"); } - - if (vfc_values2) { - $("#vfc").append("<option value=\"\"></opton>"); - for (key in vfc_values2) { - if ($("#vfc").length > 0) { - $("#vfc").append("<option value=\"" + key.split("\"").join("") + "\">" + vfc_values2[key] + "</opton>") - } - } - $("#vfc").multiselect("rebuild"); - } - if ($("#vfc").length > 0 && !vfc_values2) { - showWarn(); - } - if ($("#vf").length > 0 && !vf_values) { - showWarn(); - } if ($("#location").length > 0 && !location_values) { showWarn(); } @@ -302,7 +200,7 @@ function setASDCFields() { } catch (e) { console.log(e) } - } + } //Typically used when opening a new model/template diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index c9bb9e3a..54475688 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -264,8 +264,6 @@ function($scope, $rootScope, $timeout, dialogs) { $scope.cldsRevertModel(); } else if (name == "Close Model") { $scope.cldsClose(); - } else if (name == "Refresh ASDC") { - $scope.cldsRefreshASDC(); } else if (name == "Open CL") { $scope.cldsOpenModel(); } else if (name == "Save CL") { @@ -351,9 +349,6 @@ function($scope, $rootScope, $timeout, dialogs) { "View" : [ { link : "/refreshStatus", name : "Refresh Status" - }, { - link : "/cldsRefreshASDC", - name : "Refresh ASDC" } ], "Help" : [ { link : "http://wiki.onap.org", @@ -520,24 +515,6 @@ function($scope, $rootScope, $timeout, dialogs) { callBack(null); }); }; - $scope.cldsRefreshASDC = function() { - - var dlg = dialogs.create('partials/portfolios/refresh_asdc.html', - 'CldsOpenModelCtrl', { - closable : true, - draggable : true - }, { - size : 'lg', - keyboard : true, - backdrop : 'static', - windowClass : 'my-class' - }); - dlg.result.then(function(name) { - - }, function() { - - }); - } $scope.cldsRevertModel = function() { var dlg = dialogs.create( |