diff options
author | 2020-08-21 08:40:37 -0400 | |
---|---|---|
committer | 2020-08-21 08:52:29 -0400 | |
commit | 47b65efd69c5158d958261846803d2e15adfb448 (patch) | |
tree | d0f3752b551a31cf39a36cbee16392bbcc36c72b /ccsdk-app-overlay/src/main/webapp/app | |
parent | c32511155acad5b70dcc3cf29e9bfa36276f3894 (diff) |
java 11 upgrade and sonar scan fixes
Recompile java source code using jdk11
Run in ojdk11 JRE
tomcat container upgrade
alpine base image
Issue-ID: DCAEGEN2-2298
Change-Id: Ic4bf2626e5805508589cafe52b7c4e91d7ae3580
Signed-off-by: Kotagiri, Ramprasad (rp5662) <rp5662@att.com>
Diffstat (limited to 'ccsdk-app-overlay/src/main/webapp/app')
5 files changed, 246 insertions, 26 deletions
diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/deployment_table.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/deployment_table.html index 211d17d..6ecfaac 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/deployment_table.html +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/deployment_table.html @@ -54,7 +54,7 @@ </div> <div class="menu-filters" ng-show="ecdapp.showingMoreFilters"> <div class="group"> - <label class="col-sm-3 control-label">Service IDs: </label> + <label class="col-sm-3 control-label">Deployment IDs: </label> <ui-select multiple ng-model="ecdapp.selectedServices" ng-disabled="ecdapp.usingAafFilter || ecdapp.usingDcaeTargetTypeFilter" theme="bootstrap" close-on-select="false" title="Service ID"> @@ -269,6 +269,7 @@ href="">View executions</a> </div> </li> + <!-- <li> <div ng-show="rowData.canDeploy && rowData.lastExecution.status === 'terminated'" @@ -277,6 +278,7 @@ href="">Update deployment</a> </div> </li> + --> <li> <div ng-show="rowData.canDeploy && rowData.lastExecution.status != ''" @@ -311,14 +313,6 @@ href="">Helm Rollback</a> </div> </li> - <li> - <div - ng-click="ecdapp.reconfigDeploymentModalPopup(rowData);"> - <i - class="icon-datanetwork-contentdelivery ecd-icon-action"></i><a - href="">Reconfigure</a> - </div> - </li> </ul> </div> <!-- .btn-group --> </td> diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/blueprint-controllers.js b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/blueprint-controllers.js index b474348..878f2e3 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/blueprint-controllers.js +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/blueprint-controllers.js @@ -1109,6 +1109,242 @@ appDS2.directive('json', function() { } }; }); + +/*************************************************************************/ + + +appDS2.controller('inventoryDeploymentExecutionsViewCtrl', function( + $scope, $rootScope, $interval, $log, $modalInstance, message, modalService, InventoryExecutionService, ExecutionService) { + + 'use strict'; + + var debug = false; + + if (debug) + $log.debug("inventoryDeploymentsExecutionsViewCtrl.message: " + JSON.stringify(message)); + + // this object holds all app data and functions + $scope.ecdapp = {}; + // models for controls on screen + $scope.ecdapp.label = 'Deployment ' + message.deployment.id + ' Executions'; + $scope.ecdapp.tableData = []; + $scope.ecdapp.logTableData = []; + $scope.ecdapp.currentPageNum = 1; + $scope.ecdapp.viewPerPage = 10; + $scope.ecdapp.currentLogPageNum = 1; + $scope.ecdapp.selectedRow = null; + + // other + $scope.ecdapp.errMsg = null; + $scope.ecdapp.isDataLoading = true; + $scope.ecdapp.isEventLogQuery = false; + $scope.ecdapp.isRequestFailed = false; + $scope.ecdapp.isLastExecution = message.deployment.onlyLatest; + $scope.ecdapp.isLogType = true; + $scope.ecdapp.refresh_switch = { + value: true + }; + $scope.ecdapp.options = { + "on":"On", + "off":"Off" + } + var selTenant = message.deployment.tenant; + + $scope.ecdapp.ui_tenant = selTenant; + $scope.ecdapp.tenant = selTenant; + $scope.ecdapp.execId = ""; + $scope.ecdapp.deplRef = message.deployment.deploymentRef; + var stop; + /** + * Loads the table. Interprets the remote controller's response and copies + * to scope variables. The response is either a list to be assigned to + * tableData, or an error to be shown. + */ + $scope.ecdapp.loadTable = function() { + $scope.ecdapp.isDataLoading = true; + InventoryExecutionService.getExecutionsByDeployment($scope.ecdapp.deplRef, + $scope.ecdapp.tenant, + $scope.ecdapp.currentPageNum, + $scope.ecdapp.viewPerPage).then( + function(jsonObj) { + if (jsonObj.error) { + $log.error("deploymentExecutionsViewCtrl.loadTable failed: " + + jsonObj.error); + $scope.ecdapp.isRequestFailed = true; + if (jsonObj.error.includes("404")) { + $scope.ecdapp.errMsg = "404 - Deployment " + message.deployment.deploymentRef + " Not Found!"; + } + $scope.ecdapp.tableData = []; + $scope.ecdapp.stopLoading(); + } else { + $scope.ecdapp.isRequestFailed = false; + $scope.ecdapp.errMsg = null; + $scope.ecdapp.totalPages = jsonObj.totalPages; + var resultLen = jsonObj.items.length; + if (resultLen != undefined && resultLen > 0) { + var exec_id = jsonObj.items[resultLen-1].id; + $scope.ecdapp.execId = exec_id; + $scope.ecdapp.selectedRow = resultLen-1; + if ($scope.ecdapp.isLastExecution) { + $scope.ecdapp.tableData = []; + $scope.ecdapp.tableData.push(jsonObj.items[resultLen-1]); + } else { + $scope.ecdapp.tableData = jsonObj.items; + } + $scope.ecdapp.getExecutionLogs($scope.ecdapp.selectedRow, exec_id, $scope.ecdapp.tenant); + } + } + $scope.ecdapp.isDataLoading = false; + }, + function(error) { + $log.error("inventoryDeploymentExecutionsViewCtrl.loadTable failed: " + + error); + $scope.ecdapp.isRequestFailed = true; + $scope.ecdapp.errMsg = error; + $scope.ecdapp.tableData = []; + $scope.ecdapp.isDataLoading = false; + $scope.ecdapp.stopLoading(); + }); + }; + $scope.$watch('ecdapp.refresh_switch["value"]', function(newValue,oldValue,scope) { + if (newValue != oldValue) { + if (newValue === true) { + $scope.ecdapp.loadTable(); + stop = $interval( function(){ $scope.ecdapp.loadTable(); }, 30000, 100, false); + } else { + $scope.ecdapp.stopLoading(); + } + } + }, true); + + if ($scope.ecdapp.refresh_switch.value === true) { + stop = $interval( function(){ $scope.ecdapp.loadTable(); }, 30000, 100, false); + } + + $scope.ecdapp.stopLoading = function() { + if (angular.isDefined(stop)) { + $interval.cancel(stop); + stop = undefined; + } + }; + + $scope.ecdapp.copyStringToClipboard = function(str) { + // Create new element + var el = document.createElement('textarea'); + // Set value (string to be copied) + el.value = str; + // Set non-editable to avoid focus and move outside of view + el.setAttribute('readonly', ''); + el.style = {position: 'absolute', left: '-9999px'}; + document.body.appendChild(el); + // Select text inside element + el.select(); + // Copy text to clipboard + document.execCommand('copy'); + // Remove temporary element + document.body.removeChild(el); + }; + + $scope.ecdapp.cancelExecutionModalPopup = function(execution, tenant) { + modalService.popupConfirmWin("Confirm", "Cancel execution with ID '" + + execution.id + "'?", function() { + $scope.ecdapp.isCancelOn = true; + // TODO: gather action from user + InventoryExecutionService.cancelExecution(execution.id, execution.deployment_id, "force-cancel", tenant).then( + function(response) { + if (debug) + $log.debug("Controller.cancelExecutionModalPopup: " + JSON.stringify(response)); + if (response && response.error) { + // $log.error('cancelExectuion failed: ' + response.error); + alert('Failed to cancel execution:\n' + response.error); + $scope.ecdapp.isCancelOn = false; + } + else { + // No response body on success. + $scope.ecdapp.isCancelOn = false; + $scope.ecdapp.loadTable(); + } + }, + function(error) { + $scope.ecdapp.isCancelOn = false; + $log.error('ExecutionService.cancelExecution failed: ' + error); + alert('Service failed to cancel execution:\n' + error); + }); + }) + }; + + /** + * Invoked at first page load AND when + * user clicks on the B2B pagination control. + */ + $scope.pageChangeHandler = function(page) { + if (debug) + console.log('pageChangeHandler: current is ' + $scope.ecdapp.currentPageNum + ' new is ' + page); + $scope.ecdapp.currentPageNum = page; + $scope.ecdapp.loadTable(); + + } + $scope.pageChangeHandlerEvent = function(page) { + if (debug) + console.log('pageChangeHandlerEvent: current is ' + $scope.ecdapp.currentLogPageNum + ' new is ' + page); + if (page != $scope.ecdapp.currentLogPageNum ) { + $scope.ecdapp.currentLogPageNum = page; + $scope.ecdapp.getExecutionLogs($scope.ecdapp.selectedRow, $scope.ecdapp.execId, $scope.ecdapp.tenant); + } + } + + $scope.ecdapp.setClickedRow = function(index){ //function that sets the value of selectedRow to current index + $scope.ecdapp.selectedRow = index; + } + $scope.ecdapp.selected = false; + $scope.ecdapp.toggleStatusDefinitions = function() { + $scope.ecdapp.selected = $scope.ecdapp.selected ? false :true; + } + + /** + * Shows a modal pop-up with the error. + */ + $scope.ecdapp.viewErrorModalPopup = function(row) { + $modalInstance.dismiss('cancel'); + modalService.showFailure('Error Details', row.error, function() { } ); + }; + + $scope.ecdapp.getExecutionLogs = function(rowIdx, id, tenant) { + $scope.ecdapp.setClickedRow(rowIdx); + $scope.ecdapp.execId = id; + $scope.ecdapp.isEventLogQuery = false; + InventoryExecutionService.getEventsByExecution(id , $scope.ecdapp.isLogType, tenant, + $scope.ecdapp.currentLogPageNum, $scope.ecdapp.viewPerPage ).then( + function(jsonObj) { + if (jsonObj.error) { + $log.error("inventoryDeploymentExecutionsViewCtrl.getExecutionLogs failed: " + + jsonObj.error); + $scope.ecdapp.isEventLogQuery = false; + $scope.ecdapp.evtErrMsg = jsonObj.error; + $scope.ecdapp.logTableData = []; + } else { + $scope.ecdapp.isEventLogQuery = true; + $scope.ecdapp.evtErrMsg = null; + $scope.ecdapp.totalLogPages = jsonObj.totalPages; + $scope.ecdapp.logTableData = jsonObj.items; + } + $scope.ecdapp.isDataLoading = false; + }, + function(error) { + $log.error("inventoryDeploymentExecutionsViewCtrl.getExecutionLogs failed: " + + error); + $scope.ecdapp.evtErrMsg = error; + $scope.ecdapp.logTableData = []; + $scope.ecdapp.isDataLoading = false; + }); + } + + $scope.$on('$destroy', function() { + // Make sure that the interval is destroyed too + $scope.ecdapp.stopLoading(); + }); +}); + /*************************************************************************/ appDS2.controller('inventoryBlueprintDeployCtrl', function( @@ -1254,7 +1490,7 @@ appDS2.controller('inventoryBlueprintDeployCtrl', function( $scope.ecdapp.viewDeploymentExecutionsModalPopup = function(deployment) { var modalInstance = $modal.open({ templateUrl : 'inventory_execution_view_popup.html', - controller : 'inventoryDeploymentExecutionsViewCtrl', + controller : 'inventoryDeploymentExecutionsViewCtrl', windowClass: 'modal-docked', sizeClass: 'modal-jumbo', resolve : { diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_blueprint_popups.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_blueprint_popups.html index d17c065..bcae7c7 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_blueprint_popups.html +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_blueprint_popups.html @@ -595,7 +595,7 @@ <div class="helpertext" tabindex="-1" role="tooltip" id="tooltiptext1"> <div class="popover-title">Component - a required field</div> <div class="popover-content"> - <p>Value is set to the component name that blueprint belongs. Component name is a sub-string of the application namespace in AAF. User role is associated with that same namespace.</p> + <p>Value is set to the component name that blueprint belongs. User roles could be associated with component names.</p> <strong class="hidden-spoken">Double tap to close help message.</strong> </div> </div> @@ -617,7 +617,7 @@ <div class="helpertext" tabindex="-1" role="tooltip" id="tooltiptext1"> <div class="popover-title">Deployment Tag - a required input</div> <div class="popover-content"> - <p>Default value set to the blueprint name. An editable field for the deployment reference, can be used to identify the purpose of the deployment. Deployment ID [<component>_<deployment tag>] is generated from component and deployment tag fields.</p> + <p>Default value set to the blueprint name. An editable field for the deployment reference, can be used to identify the purpose of the deployment. Deployment ID is generated from component and deployment tag fields.</p> <strong class="hidden-spoken">Double tap to close help message.</strong> </div> </div> diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_deployment_popups.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_deployment_popups.html index 41c3115..f52f1ff 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_deployment_popups.html +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_deployment_popups.html @@ -205,12 +205,6 @@ <input id="deploymentRef" class="span12" type="text" disabled="disabled" data-ng-model="ecdapp.deploymentRef" /> </div> - <div class="span12"> - <label for="serviceId">Service ID</label> - <!--not editable--> - <input id="serviceId" class="span12" type="text" - disabled="disabled" data-ng-model="ecdapp.serviceId" /> - </div> </div> <div class="row-nowrap"> <div class="span12"> @@ -561,12 +555,6 @@ disabled="disabled" data-ng-model="ecdapp.deploymentRef" /> </div> <div class="span12"> - <label for="serviceId">Service ID</label> - <!--not editable--> - <input id="serviceId" class="span12" type="text" - disabled="disabled" data-ng-model="ecdapp.serviceId" /> - </div> - <div class="span12"> <label for="tenantName">Tenant Name</label> <!--not editable--> <input id="tenantName" class="span12" type="text" diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_execution_popups.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_execution_popups.html index 6277207..ae9df8a 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_execution_popups.html +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/inventory/inventory_execution_popups.html @@ -233,8 +233,10 @@ </thead> <tbody b2b-table-row type="body" row-repeat="rowData in ecdapp.logTableData"> - <tr id="tr-rowData" ng-style="{'background-color':rowData.event_type === 'task_failed' - || rowData.event_type === 'workflow_failed' ? '#fbbbbb' : '#ffffff'}"> + <tr id="tr-rowData" ng-style="{ + 'color':rowData.event_type === 'task_failed' || rowData.event_type === 'workflow_failed' ? '#ff0000' : '#000000', + 'font-weight':rowData.event_type === 'task_failed' || rowData.event_type === 'workflow_failed' ? 'bolder' : 'normal' + }"> <td b2b-table-body ng-bind="rowData.reported_timestamp" /> <td b2b-table-body ng-bind="rowData.type" /> <td b2b-table-body ng-bind="rowData.event_type" /> |