diff options
author | Sébastien Determe <sd378r@intl.att.com> | 2018-04-19 16:39:56 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-19 16:39:56 +0000 |
commit | e803fb7f42efb66cb2fb05cc568c80ab818798f4 (patch) | |
tree | 89fbfb2b89e26bf2c53f4ec93b9db38f40c44362 /src/main/resources | |
parent | 1ed00c10c10e743348fae994743821e3413c19c1 (diff) | |
parent | ab284ec6e60c48eb9550c8fae16cc34ec9c3aeae (diff) |
Merge "Fix CsarInstaller"
Diffstat (limited to 'src/main/resources')
3 files changed, 21 insertions, 10 deletions
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/deploy_parameters.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/deploy_parameters.html index c0cd6c953..ecb0af42f 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/deploy_parameters.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/deploy_parameters.html @@ -30,7 +30,7 @@ <div style="height: 30px"> Deployment parameters as JSON. </div> - <textarea class="form-control" focus="true" name="deployProperties" id="deployProperties" /> + <textarea class="form-control" focus="true" name="deployProperties" id="deployProperties" ng-init="load_deploy_parameters()"/> </div> <div class="modal-footer"> <button ng-click="deploy()" class="btn btn-primary">Deploy</button> diff --git a/src/main/resources/META-INF/resources/designer/scripts/DeploymentCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/DeploymentCtrl.js index 04ba83a78..4259e66ec 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/DeploymentCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/DeploymentCtrl.js @@ -25,6 +25,16 @@ app.controller('DeploymentCtrl', ['$scope','$rootScope','$modalInstance','data','dialogs', 'cldsModelService', function( $scope, $rootScope, $modalInstance, data, dialogs, cldsModelService) { + function validate_and_set_deploy_parameters () { + var parameters = $("#deployProperties").val(); + try { + parameters = JSON.parse(parameters); + set_deploy_parameters(parameters); + } catch (e) { + console.error("Couldn't parse deploy parameters json"); + } + } + function set_deploy_parameters(parameters) { if (!'global' in elementMap) { elementMap["global"] = []; @@ -38,15 +48,16 @@ app.controller('DeploymentCtrl', } } - $scope.deploy = function() { - var parameters = $("#deployProperties").val(); - try { - parameters = JSON.parse(parameters); - set_deploy_parameters(parameters); - $modalInstance.close(); - } catch (e) { - console.error("Couldn't parse deploy parameters json"); + $scope.load_deploy_parameters = function () { + var index = elementMap["global"].findIndex(function (e) { return (typeof e == "object" && !(e instanceof Array)) && "deployParameters" == e["name"]; }); + if (index != -1) { + $('#deployProperties').val(JSON.stringify(elementMap["global"][index]["value"])) } + } + + $scope.deploy = function() { + validate_and_set_deploy_parameters (); + $modalInstance.close(); }; $scope.close = function() { diff --git a/src/main/resources/clds/templates/dcae-template.json b/src/main/resources/clds/templates/dcae-template.json index 33162971d..b76baf2d4 100644 --- a/src/main/resources/clds/templates/dcae-template.json +++ b/src/main/resources/clds/templates/dcae-template.json @@ -16,7 +16,7 @@ "closedLoopControlName": "", "closedLoopEventClient": "configuration.dcae.microservice.tca.xml", "policyName": "", - "policyScope": "CLAMP", + "policyScope": "DCAE", "policyVersion": "v0.0.1", "serviceConfigurations": { } |