diff --git a/client/cat3/main.html b/client/cat3/main.html index 747bfcd47..cbae61cdf 100644 --- a/client/cat3/main.html +++ b/client/cat3/main.html @@ -67,7 +67,7 @@ -
'+
+ '
'+
+ '
'+
+ '
',cellTooltip: true},
{ name: 'BOT Name',displayName: 'BOT Name',field:'auditTrailConfig.name'},
{ name: 'Status',field:'status',
cellTemplate:'
' +
@@ -51,7 +57,7 @@
keyboard: false,
resolve: {
items: function() {
- return hist
+ return hist;
}
}
});
@@ -64,10 +70,12 @@
audit.init =function(){
audit.gridOptions.data=[];
- var url = '/audit-trail?filterBy=auditType:BOTs';
- $http.get(url).then(function (data) {
- angular.forEach(data,function () {
- audit.gridOptions.data=data.data.auditTrails;
+ var param={
+ url:'/audit-trail?filterBy=auditType:BOTs'
+ };
+ genSevs.promiseGet(param).then(function (response) {
+ angular.forEach(response,function () {
+ audit.gridOptions.data=response.auditTrails;
});
});
};
diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/botLogsCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/botLogsCtrl.js
index 7802b2c20..57d1ca9f3 100644
--- a/client/cat3/src/partials/sections/dashboard/bots/controller/botLogsCtrl.js
+++ b/client/cat3/src/partials/sections/dashboard/bots/controller/botLogsCtrl.js
@@ -8,7 +8,7 @@
(function (angular) {
"use strict";
angular.module('library.bots',[])
- .controller('botLogsCtrl',['$scope', '$rootScope', '$http', 'genericServices', 'workzoneServices', 'toastr', '$modalInstance', 'items', '$timeout', function ($scope, $rootScope, $http, genSevs, workzoneServices, toastr, $modalInstance, items, $timeout) {
+ .controller('botLogsCtrl',['$scope', '$rootScope', 'genericServices', 'workzoneServices', 'toastr', '$modalInstance', 'items', '$timeout', function ($scope, $rootScope, genSevs, workzoneServices, toastr, $modalInstance, items, $timeout) {
$scope.botName = items.auditTrailConfig.name;
$scope.nodeIds = items.auditTrailConfig.nodeIds;
$scope.taskType = items.auditTrailConfig.executionType;
@@ -34,9 +34,11 @@
};
$scope.instanceChange =function(){
$scope.botLogs=[];
- var url = '/audit-trail/' + $scope.selectedInstance.actionLogId + '/logs';
- $http.get(url).then(function (result) {
- $scope.botLogs = result.data;
+ var param={
+ url:'/audit-trail/' + $scope.selectedInstance.actionLogId + '/logs'
+ };
+ genSevs.promiseGet(param).then(function (response) {
+ $scope.botLogs = response;
$scope.isBotLogsLoading = false;
});
};
@@ -45,14 +47,12 @@
var requestObj = {
"instanceIds": nodeIds
};
- var bluePrintJob = false;
workzoneServices.postRetrieveDetailsForInstanceNames(requestObj).then(function (response) {
var _jobInstances = response.data;
for (var k = 0; k < $scope.nodeIdsWithActionLog.length; k++) {
for (var l = 0; l < _jobInstances.length; l++) {
if ($scope.nodeIdsWithActionLog[k].nodeId === _jobInstances[l]._id) {
$scope.nodeIdsWithActionLog[k].uiNodeName = _jobInstances[l].name;
- console.log($scope.nodeIdsWithActionLog[k].uiNodeName);
}
}
}
@@ -64,13 +64,15 @@
console.log(error);
});
if($scope.taskType === 'jenkins') {
- var url = '/jenkins/' + $scope.jenkinsActionLogId + '/jobs/testmail/builds/' + $scope.jenkinsBuildNumber + '/output';
- $http.get(url).then(function (result) {
- if (result.data) {
- $scope.jenkinsLogs = helper.formatLogs(result.data.output);
+ var param={
+ url:'/jenkins/' + $scope.jenkinsActionLogId + '/jobs/testmail/builds/' + $scope.jenkinsBuildNumber + '/output'
+ };
+ genSevs.promiseGet(param).then(function (response) {
+ if (response.data) {
+ $scope.jenkinsLogs = helper.formatLogs(response.data.output);
$scope.isBotLogsLoading = false;
} else {
- $scope.jenkinsLogs = helper.formatLogs(result.output);
+ $scope.jenkinsLogs = helper.formatLogs(response.output);
$scope.isBotLogsLoading = false;
}
});
@@ -78,6 +80,6 @@
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
- }
+ };
}]);
})(angular);
\ No newline at end of file
diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js
index 8d8895967..1454f81c4 100644
--- a/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js
+++ b/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js
@@ -70,7 +70,6 @@
$scope.jenkinsparams = items.taskConfig.parameterized;
$scope.scriptparams = items.taskConfig.scriptDetails;
$scope.parameters=[''];
- var taskData={};
var cookbookAttributes = [];
var scriptParams = [];
var choiceParam = {};
diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js
index 7465e3e7f..dd78cb560 100644
--- a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js
+++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js
@@ -8,10 +8,11 @@
(function (angular) {
"use strict";
angular.module('dashboard.bots')
- .controller('libraryCtrl',['$scope', '$rootScope', '$http', '$state', 'genericServices', 'confirmbox', 'workzoneServices', 'toastr', 'workzoneUIUtils', function ($scope, $rootScope, $http, $state, genSevs, confirmbox, workzoneServices, toastr, workzoneUIUtils) {
+ .controller('libraryCtrl',['$scope', '$rootScope', '$state', 'genericServices', 'confirmbox', 'toastr', 'workzoneUIUtils', function ($scope, $rootScope, $state, genSevs, confirmbox, toastr, workzoneUIUtils) {
var treeNames = ['Bots','Library'];
$rootScope.$emit('treeNameUpdate', treeNames);
var lib=this;
+ $scope.totalBotsSelected = true;
lib.gridOptions={
gridOption:{
paginationPageSizes: [10, 25, 50, 75],
@@ -37,7 +38,7 @@
],
data:[]
};
- var gridBottomSpace = 210;
+ var gridBottomSpace = 190;
$scope.gridHeight = workzoneUIUtils.makeTabScrollable('botLibraryPage') - gridBottomSpace;
$scope.launchInstance = function(launch){
if(launch.launcType === 'task'){
@@ -49,7 +50,7 @@
$scope.botLogs = function(bot){
genSevs.botHistory(bot);
};
- $scope.deleteBotTask = function(bot) {
+ $scope.deleteBotTask = function(task) {
var modalOptions = {
closeButtonText: 'Cancel',
actionButtonText: 'Delete',
@@ -58,7 +59,10 @@
bodyText: 'Are you sure you want to delete this bot?'
};
confirmbox.showModal({}, modalOptions).then(function() {
- workzoneServices.deleteBotTask(bot._id).then(function(response) {
+ var param={
+ url:'/tasks/serviceDelivery/' + task._id
+ };
+ genSevs.promiseDelete(param).then(function (response) {
if (response) {
toastr.success('Successfully deleted');
lib.init();
@@ -68,7 +72,7 @@
});
});
};
- $scope.deleteBotBP = function(bot) {
+ $scope.deleteBotBP = function(blueprint) {
var modalOptions = {
closeButtonText: 'Cancel',
actionButtonText: 'Delete',
@@ -77,7 +81,10 @@
bodyText: 'Are you sure you want to delete this bot?'
};
confirmbox.showModal({}, modalOptions).then(function() {
- workzoneServices.deleteBotBP(bot._id).then(function(response) {
+ var param={
+ url:'/blueprints/serviceDelivery/' + blueprint._id
+ };
+ genSevs.promiseDelete(param).then(function (response) {
if (response) {
toastr.success('Successfully deleted');
lib.init();
@@ -90,20 +97,56 @@
$rootScope.$on('BOTS_LIBRARY_REFRESH', function() {
lib.init();
});
+ $scope.RefreshBotsLibrary = function() {
+ $scope.totalBotsSelected = true;
+ $scope.runningBotsselected = false;
+ $scope.failedBotsselected = false;
+ lib.init();
+ };
+ $scope.showBotsRunning = function() {
+ $scope.runningBotsselected = true;
+ $scope.totalBotsSelected = false;
+ $scope.failedBotsselected = false;
+ lib.gridOptions.data=[];
+ var param={
+ url:'/tasks?serviceDeliveryCheck=true&actionStatus=running'
+ };
+ genSevs.promiseGet(param).then(function (result) {
+ angular.forEach(result,function (val) {
+ lib.gridOptions.data.push(val);
+ });
+ });
+ lib.summary();
+ };
+ $scope.showFailedBots = function() {
+ $scope.failedBotsselected = true;
+ $scope.runningBotsselected = false;
+ $scope.totalBotsSelected = false;
+ lib.gridOptions.data=[];
+ var param={
+ url:'/tasks?serviceDeliveryCheck=true&actionStatus=failed'
+ };
+ genSevs.promiseGet(param).then(function (result) {
+ angular.forEach(result,function (val) {
+ lib.gridOptions.data.push(val);
+ });
+ });
+ lib.summary();
+ };
lib.summary = function() {
$scope.botSummary=[];
- var url = '/audit-trail/bot-summary';
- $http.get(url).then(function (response) {
- $scope.botSummary = response.data;
- console.log($scope.botSummary);
+ var param={
+ url:'/audit-trail/bot-summary'
+ };
+ genSevs.promiseGet(param).then(function (response) {
+ $scope.botSummary = response;
});
- }
+ };
lib.summary();
lib.init =function(){
lib.gridOptions.data=[];
var param={
- url:'/blueprints/serviceDelivery/?serviceDeliveryCheck=true'
- //url:'src/partials/sections/dashboard/bots/data/bp.json'
+ url:'/blueprints?serviceDeliveryCheck=true'
};
genSevs.promiseGet(param).then(function (result) {
angular.forEach(result,function (val) {
@@ -112,8 +155,7 @@
});
});
var param2={
- url:'/tasks/serviceDelivery/?serviceDeliveryCheck=true'
- // url:'src/partials/sections/dashboard/bots/data/t.json'
+ url:'/tasks?serviceDeliveryCheck=true'
};
genSevs.promiseGet(param2).then(function (resultTask) {
angular.forEach(resultTask,function (val) {
diff --git a/client/cat3/src/partials/sections/dashboard/bots/view/library.html b/client/cat3/src/partials/sections/dashboard/bots/view/library.html
index 526c3be29..460bf2417 100644
--- a/client/cat3/src/partials/sections/dashboard/bots/view/library.html
+++ b/client/cat3/src/partials/sections/dashboard/bots/view/library.html
@@ -1,58 +1,57 @@
Total
Number of BOTs
Total
Number of BOTs running
Total
Time saved
Total
Number of failed runs
{{bp.name}}
{{selectedp.name}}
+
+
+
+ {{(+createCBP.SelectedBPList.indexOf(selectedp)) +1}}
{{selectedp.name}}
| {{jobLink}} | +{{jobLink}} |