aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-05-23 17:55:32 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-05-23 18:43:07 +0300
commitdaa1cf9ca3d60c5e5c0313a2cb42778d3934e1dc (patch)
tree9b510f5fe37be84f00171fce6c3ebadea0f4bbf8 /vid-app-common/src/main/webapp/app
parent910d67051377e37a592f9db17a69c4e469f05369 (diff)
Scale out fixes
Change-Id: I189e563641d267fa082ccab726c9df7d0402c112 Issue-ID: VID-188 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js19
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html9
2 files changed, 18 insertions, 10 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index 90d158af9..f76a64b06 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -60,14 +60,21 @@
_.each(response.data.vnfs, function (vnf) {
if (newVNFName["invariant-id"] === vnf.invariantUuid) {
availableVersions.push(extractVNFModel(vnf, response.data.service, newVNFName));
- newVNFName.vfModules = vnf.vfModules;
//for scale out screen
- newVNFName.category = response.data.service.category;
- newVNFName.groupModules = _.groupBy(newVNFName.vfModules, "customizationUuid");
- _.forEach(newVNFName.vfModules, function(mdl, key){
- mdl.scale = false; //defaults to not scale unless user changes it
- });
+ if(service.uuid === newVNFName["service-instance-node"][0].properties["model-version-id"]) {
+ newVNFName.vfModules = vnf.vfModules;
+ newVNFName.category = response.data.service.category;
+ newVNFName.groupModules = _.groupBy(newVNFName.vfModules, "customizationUuid");
+ _.forEach(newVNFName.vfModules, function (mdl, key) {
+ mdl.scale = false; //defaults to not scale unless user changes it
+ if(mdl.properties && mdl.properties.max_vf_module_instances) {
+ mdl.scalable = mdl.properties.max_vf_module_instances.value - newVNFName.groupModules[mdl.customizationUuid].length > 0;
+ }else{
+ mdl.scalable = false;
+ }
+ });
+ }
}
});
var versions = _.uniqBy(availableVersions, 'modelInfo.modelVersion');
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
index 6a47de0a0..9954d5aee 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
@@ -107,7 +107,7 @@
</div>
<div class="table-row" ng-repeat-start="vnf in vm.changeManagement.vnfNames" ng-click="vnf.isOpen=!!!vnf.isOpen">
- <div>+</div>
+ <div>{{vnf.isOpen ? '-' : '+'}}</div>
<div>{{vnf['service-instance-node'][0].properties['service-instance-name']}}</div>
<div>{{vnf.name}}</div>
<div>{{vnf['availableVersions'][0].modelInfo.modelVersion}}</div>
@@ -127,12 +127,13 @@
<div class="table-row" ng-repeat="(custUUID, moduleArr) in vnf.groupModules">
<div>{{moduleArr[0].modelCustomizationName}}</div>
<div>{{moduleArr.length}}</div>
- <div ng-if="!(moduleArr[0].properties.maxCountInstances - moduleArr.length > 0)">N/A</div>
- <div ng-if="moduleArr[0].properties.maxCountInstances - moduleArr.length > 0">
+ <div ng-if="!moduleArr[0].scalable">N/A</div>
+ <div ng-if="moduleArr[0].scalable">
<input type="checkbox" ng-model="moduleArr[0].scale" />
</div>
<div>{{moduleArr[0].uuid}}</div>
- <div>
+ <div ng-if="!moduleArr[0].scalable">N/A</div>
+ <div ng-if="moduleArr[0].scalable">
<input type="file" accept="application/json" onchange="angular.element(this).scope().setPreload(this)" />
</div>
</div>