X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fresources%2FMETA-INF%2Fresources%2Fdesigner%2Fscripts%2FpropertyController.js;h=0323529eeb274ea821512e1f9d60a2e264546253;hb=09bc8450b2b0c4f60eb4a241efc548d13c5c9912;hp=f1ab1e1957680fc41dc5cca232c10b078ede402f;hpb=da09b9285c8f4ffe6bfd563285580ccce70cdd20;p=clamp.git diff --git a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js index f1ab1e19..0323529e 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js +++ b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js @@ -22,10 +22,11 @@ */ function updateMsProperties(type, newMsProperties) { - var newMsProperties = cl_props["microServicePolicies"]; - for (p in newMsProperties) { - if (newMsProperties[p]["name"] == type) { - cl_props["microServicePolicies"][p] = newMsProperties; + if (newMsProperties["name"] == type) { + for (p in cl_props["microServicePolicies"]) { + if (cl_props["microServicePolicies"][p]["name"] == type) { + cl_props["microServicePolicies"][p] = newMsProperties; + } } } } @@ -43,22 +44,26 @@ function getLoopName() { } function getOperationalPolicyProperty() { - return cl_props["operationalPolicies"]["0"]["configurationsJson"]; + return JSON.parse(JSON.stringify(cl_props["operationalPolicies"]["0"]["configurationsJson"])); } function getOperationalPolicies() { - return cl_props["operationalPolicies"]; + return JSON.parse(JSON.stringify(cl_props["operationalPolicies"])); } function getGlobalProperty() { - return cl_props["globalPropertiesJson"]; + return JSON.parse(JSON.stringify(cl_props["globalPropertiesJson"])); +} + +function getDeploymentProperties() { + return JSON.parse(JSON.stringify(cl_props["globalPropertiesJson"]["dcaeDeployParameters"])); } function getMsJson(type) { var msProperties = cl_props["microServicePolicies"]; for (p in msProperties) { if (msProperties[p]["name"] == type) { - return msProperties[p]; + return JSON.parse(JSON.stringify(msProperties[p])); } } return null; @@ -68,7 +73,9 @@ function getMsProperty(type) { var msProperties = cl_props["microServicePolicies"]; for (p in msProperties) { if (msProperties[p]["name"] == type) { - return msProperties[p]["properties"]; + if (msProperties[p]["properties"] !== null && msProperties[p]["properties"] !== undefined) { + return JSON.parse(JSON.stringify(msProperties[p]["properties"])); + } } } return null; @@ -78,21 +85,26 @@ function getMsUI(type) { var msProperties = cl_props["microServicePolicies"]; for (p in msProperties) { if (msProperties[p]["name"] == type) { - return msProperties[p]["jsonRepresentation"]; + return JSON.parse(JSON.stringify(msProperties[p]["jsonRepresentation"])); } } return null; } -function getStatus() { - return cl_props["lastComputedState"]; +function getResourceDetailsVfProperty() { + return cl_props["modelPropertiesJson"]["resourceDetails"]["VF"]; } -function getDeploymentID() { - return cl_props["dcaeDeploymentId"]; +function getResourceDetailsVfModuleProperty() { + return cl_props["modelPropertiesJson"]["resourceDetails"]["VFModule"]; } -function getDeploymentStatusURL() { - return cl_props["dcaeDeploymentStatusUrl"]; +function getLoopLogsArray() { + return cl_props.loopLogs; } -module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getStatus,getDeploymentID,getDeploymentStatusURL }; \ No newline at end of file + +function getComponentStates() { + return cl_props.components; +} + +module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getResourceDetailsVfProperty,getResourceDetailsVfModuleProperty };