diff options
author | Sébastien Determe <sebastien.determe@intl.att.com> | 2019-05-09 11:39:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-09 11:39:17 +0000 |
commit | 7f3d8621b45178bc8d0683f444c301d74c924f84 (patch) | |
tree | 2c686fae11ba28d33d80fe15b8eed9ef371afe28 | |
parent | d44558eaee3cff15f9798ccc14b1642636b77cb0 (diff) | |
parent | bc753dfd1a7eeccecd34763674653d319b822f2b (diff) |
Merge "Fix the loop log issue"
4 files changed, 32 insertions, 22 deletions
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 38cdc9388..a75326de1 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -51,10 +51,10 @@ app def.resolve(data); alertService.alertMessage("Action Successful: " + svcAction, 1) // update deploymentID, lastUpdatedStatus - setLastUpdatedStatus(data.lastUpdatedStatus); + setLastComputedState(data.lastComputedState); setDeploymentStatusURL(data.dcaeDeploymentStatusUrl); setDeploymentID(data.dcaeDeploymentId); - setStatus(); + setStatus(data.lastComputedState); enableDisableMenuOptions(); }).error( function(data) { @@ -70,6 +70,7 @@ app var svcUrl = "/restservices/clds/v2/loop/" + modelName; $http.get(svcUrl).success(function(data) { cl_props = data; + setStatus(data.lastComputedState); def.resolve(data); }).error(function(data) { def.reject("Open Model not successful"); @@ -100,11 +101,9 @@ app def.resolve(data); alertService.alertMessage("Action Successful: " + svcAction, 1) // update deploymentID, lastUpdatedStatus - setLastUpdatedStatus(data.lastUpdatedStatus); + setLastComputedState(data.lastComputedState); setDeploymentStatusURL(data.dcaeDeploymentStatusUrl); setDeploymentID(data.dcaeDeploymentId); - setStatus(); - enableDisableMenuOptions(); }).error( function(data) { def.resolve(data); @@ -139,23 +138,30 @@ app this.processActionResponse = function(modelName) { // populate control name (prefix and uuid here) $("#loop_name").text(getLoopName()); - setStatus(); manageCLImage(modelName); enableDisableMenuOptions(); }; - this.processRefresh = function() { - setStatus(); + this.refreshStatus = function(modelName) { + var def = $q.defer(); + var sets = []; + var svcUrl = "/restservices/clds/v2/loop/getstatus/" + modelName; + $http.get(svcUrl).success(function(data) { + setStatus(data.lastComputedState); + def.resolve(data); + }).error(function(data) { + def.reject("Refresh Status not successful"); + }); + return def.promise; enableDisableMenuOptions(); } - function setStatus() { - var status = getLastUpdatedStatus(); + function setStatus(status) { // apply color to status var statusColor = 'white'; if (status.trim() === "DESIGN") { statusColor = 'gray' } else if (status.trim() === "DISTRIBUTED") { statusColor = 'blue' - } else if (status.trim() === "ACTIVE") { + } else if (status.trim() === "SUBMITTED") { statusColor = 'green' } else if (status.trim() === "STOPPED") { statusColor = 'red' @@ -180,7 +186,6 @@ app '<span id="status_clds" style="position: absolute; left: 61%;top: 151px; font-size:20px;">Status: ' + statusMsg + '</span>'); } - function manageCLImage(modelName) { getModelImage(modelName).then(function(pars) { var svg = pars; @@ -200,8 +205,6 @@ app } enableDisableMenuOptions = function() { enableDefaultMenu(); - //var status = getStatus(); - //enableActionMenu(status); enableAllActionMenu(); } getModelImage = function(modelName) { 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 323cffc1e..5597bd992 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -505,17 +505,18 @@ function($scope, $rootScope, $timeout, dialogs) { cldsModelService.processAction(uiAction, modelName).then(function(pars) { console.log("cldsPerformAction: pars=" + pars); - $rootScope.refreshLoopLog(); + cldsModelService.getModel(modelName).then(function(pars) { + $rootScope.refreshLoopLog(); + }, function(data) { + }); }, function(data) { - }); }; $scope.refreshStatus = function() { var modelName = selected_model; console.log("refreStatus modelName=" + modelName); - cldsModelService.getModel(modelName).then(function(pars) { + cldsModelService.refreshStatus(modelName).then(function(pars) { console.log("refreStatus: pars=" + pars); - cldsModelService.processRefresh(); }, function(data) { }); @@ -566,9 +567,13 @@ function($scope, $rootScope, $timeout, dialogs) { + selected_model); cldsModelService.toggleDeploy(uiAction, selected_model).then( function(pars) { + cldsModelService.getModel(selected_model).then(function(pars) { + $rootScope.refreshLoopLog(); + }, function(data) { + }); }, function(data) { - }); + } $scope.ToscaModelWindow = function (tosca_model) { 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 ee602b993..994e4a765 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js +++ b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js @@ -94,7 +94,7 @@ function getLastUpdatedStatus() { return cl_props["lastComputedState"]; } -function setLastUpdatedStatus(status) { +function setLastComputedState(status) { cl_props["lastComputedState"] = status; } diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index 1883145d7..7e0c891ee 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -605,8 +605,6 @@ <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" /> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> @@ -621,6 +619,10 @@ <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> + <doFinally> + <to + uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" /> + </doFinally> </doTry> </route> </get> |