diff --git a/client/cat3/bower.json b/client/cat3/bower.json index 01d8209e5..8b234a313 100644 --- a/client/cat3/bower.json +++ b/client/cat3/bower.json @@ -29,7 +29,9 @@ "angular-ui-grid": "^3.1.1", "lodash": "^4.11.2", "ng-file-upload": "^12.0.4", - "angular-nvd3": "^1.0.7" + "angular-nvd3": "^1.0.7", + "angularMultipleSelect": "angular-multiple-select#^1.1.2", + "glyphicons-halflings": "*" }, "exportsOverride": { "font-awesome": { diff --git a/client/cat3/main.html b/client/cat3/main.html index dce92b810..64a33c60e 100644 --- a/client/cat3/main.html +++ b/client/cat3/main.html @@ -16,6 +16,7 @@ + @@ -41,6 +42,7 @@ +
'+
+ .controller('libraryCtrl',['$scope', '$rootScope', '$state', 'genericServices', 'confirmbox', 'toastr', 'workzoneUIUtils', '$modal', 'uiGridOptionsService', '$timeout', function ($scope, $rootScope, $state, genSevs, confirmbox, toastr, workzoneUIUtils, $modal, uiGridOptionsService, $timeout) {
+ var treeNames = ['BOTs','Library'];
+ $rootScope.$emit('treeNameUpdate', treeNames);
+ var lib=this;
+ $scope.totalBotsSelected = true;
+ var botLibraryUIGridDefaults = uiGridOptionsService.options();
+ $scope.paginationParams = botLibraryUIGridDefaults.pagination;
+ $scope.paginationParams=[];
+ $scope.paginationParams.sortBy = 'createdOn';
+ $scope.paginationParams.sortOrder = 'desc';
+ console.log($scope.paginationParams.sortBy);
+
+ $scope.initGrids = function(){
+ $scope.botLibGridOptions={
+ enableFiltering: false
+ };
+ $scope.botLibGridOptions.columnDefs= [
+ { name:'Task Type', field:'botLinkedSubCategory' ,cellTemplate:'
'+
'
'+
'
'+
'
',cellTooltip: true},
- { name: 'BOT Type',displayName: 'BOT Type',field:'botLinkedCategory',cellTooltip: true},
- { name: 'BOT Name',displayName: 'BOT Name',field:'botName',cellTooltip: true},
- { name: 'Category',field:'botCategory',cellTooltip: true},
- { name: 'description',field:'botDesc',cellTooltip: true},
- { name: 'Org',field:'masterDetails.orgName',cellTooltip: true},
- { name: 'Total Runs',field:'executionCount'},
- { name: 'BOT History',displayName: 'BOT History',cellTemplate:'NA'+
+ { name: 'BOT Type',displayName: 'BOT Type',field:'botLinkedCategory',cellTooltip: true},
+ { name: 'BOT Name',displayName: 'BOT Name',field:'botName',cellTooltip: true},
+ { name: 'Category',field:'botCategory',cellTooltip: true},
+ { name: 'description',field:'botDesc',cellTooltip: true},
+ { name: 'Org',field:'masterDetails.orgName',cellTooltip: true},
+ { name: 'Total Runs',field:'executionCount'},
+ { name: 'BOT History',displayName: 'BOT History',cellTemplate:'NA'+
''},
- { name: 'BOT Info',displayName: 'BOT Info',cellTemplate:
- ''},
- { name: 'BOT Action',displayName: 'BOT Action',cellTemplate:
+ { name: 'BOT Info',displayName: 'BOT Info',cellTemplate:
+ ''},
+ { name: 'BOT Action',displayName: 'BOT Action',cellTemplate:
'' +
'' +
''
- }
- ]
- $scope.botLibGridOptions.data=[];
- angular.extend($scope.botLibGridOptions,botLibraryUIGridDefaults.gridOption);
- };
- $scope.initGrids();
- /*APIs registered are triggered as ui-grid is configured
- for server side(external) pagination.*/
- angular.extend($scope.botLibGridOptions,botLibraryUIGridDefaults.gridOption, {
- onRegisterApi :function(gridApi) {
- $scope.gridApi = gridApi;
- gridApi.core.on.sortChanged($scope, function(grid, sortColumns) {
- if (sortColumns[0] && sortColumns[0].field && sortColumns[0].sort && sortColumns[0].sort.direction) {
- $scope.paginationParams.sortBy = sortColumns[0].field;
- $scope.paginationParams.sortOrder = sortColumns[0].sort.direction;
- $scope.botLibraryGridView();
}
+ ]
+ $scope.botLibGridOptions.data=[];
+ angular.extend($scope.botLibGridOptions,botLibraryUIGridDefaults.gridOption);
+ };
+ $scope.initGrids();
+ /*APIs registered are triggered as ui-grid is configured
+ for server side(external) pagination.*/
+ angular.extend($scope.botLibGridOptions,botLibraryUIGridDefaults.gridOption, {
+ onRegisterApi :function(gridApi) {
+ $scope.gridApi = gridApi;
+ gridApi.core.on.sortChanged($scope, function(grid, sortColumns) {
+ if (sortColumns[0] && sortColumns[0].field && sortColumns[0].sort && sortColumns[0].sort.direction) {
+ $scope.paginationParams.sortBy = sortColumns[0].field;
+ $scope.paginationParams.sortOrder = sortColumns[0].sort.direction;
+ $scope.botLibraryGridView();
+ }
+ });
+ //Pagination for page and pageSize
+ gridApi.pagination.on.paginationChanged($scope, function(newPage, pageSize) {
+ $scope.paginationParams.page = newPage;
+ $scope.paginationParams.pageSize = pageSize;
+ $scope.botLibraryGridView();
+ });
+ },
+ });
+ $scope.setPaginationDefaults = function() {
+ $scope.paginationParams.sortBy = 'createdOn';
+ $scope.paginationParams.sortOrder = 'desc';
+ /*if($scope.paginationParams.page !== 1){
+ $scope.setFirstPageView();//if current page is not 1, then ui grid will trigger a call when set to 1.
+ }else{
+ $scope.botLibraryGridView();
+ }*/
+ };
+ $scope.setPaginationDefaults();
+ $scope.botLibraryGridView = function() {
+ lib.gridOptions=[];
+ var param={
+ url:'/bots?page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
+ };
+ genSevs.promiseGet(param).then(function (result) {
+ $timeout(function() {
+ console.log(result);
+ $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
+ $scope.botLibGridOptions.data=result.bots;
+ }, 100);
+ $scope.isBotLibraryPageLoading = false;
+ }, function(error) {
+ $scope.isBotLibraryPageLoading = false;
+ console.log(error);
+ $scope.errorMessage = "No Records found";
});
- //Pagination for page and pageSize
- gridApi.pagination.on.paginationChanged($scope, function(newPage, pageSize) {
- $scope.paginationParams.page = newPage;
- $scope.paginationParams.pageSize = pageSize;
- $scope.botLibraryGridView();
+ };
+ $scope.botLibraryGridView();
+ $scope.searchBotNameCategory = function() {
+ $scope.searchString = $scope.botLibrarySearch;
+ console.log($scope.searchString);
+ lib.gridOptions=[];
+ var param={
+ url:'/bots?page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
+ };
+ genSevs.promiseGet(param).then(function (result) {
+ $timeout(function() {
+ console.log(result);
+ $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
+ $scope.botLibGridOptions.data=result.bots;
+ }, 100);
+ $scope.isBotLibraryPageLoading = false;
+ }, function(error) {
+ $scope.isBotLibraryPageLoading = false;
+ console.log(error);
+ $scope.errorMessage = "No Records found";
});
- },
- });
- $scope.setPaginationDefaults = function() {
- $scope.paginationParams.sortBy = 'createdOn';
- $scope.paginationParams.sortOrder = 'desc';
- /*if($scope.paginationParams.page !== 1){
- $scope.setFirstPageView();//if current page is not 1, then ui grid will trigger a call when set to 1.
- }else{
- $scope.botLibraryGridView();
- }*/
- };
- $scope.setPaginationDefaults();
- $scope.botLibraryGridView = function() {
- lib.gridOptions=[];
- var param={
- url:'/bots?page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
};
- genSevs.promiseGet(param).then(function (result) {
- $timeout(function() {
- console.log(result);
- $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
- $scope.botLibGridOptions.data=result.bots;
- }, 100);
- $scope.isBotLibraryPageLoading = false;
- }, function(error) {
- $scope.isBotLibraryPageLoading = false;
- console.log(error);
- $scope.errorMessage = "No Records found";
- });
- };
- $scope.botLibraryGridView();
- $scope.searchBotNameCategory = function() {
- $scope.searchString = $scope.botLibrarySearch;
- console.log($scope.searchString);
- lib.gridOptions=[];
- var param={
- url:'/bots?page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
+ var gridBottomSpace = 190;
+ $scope.gridHeight = workzoneUIUtils.makeTabScrollable('botLibraryPage') - gridBottomSpace;
+ $scope.launchInstance = function(launch){
+ console.log(launch.botLinkedCategory);
+ /*if(launch.launcType === 'task'){
+ genSevs.executeTask(launch);
+ } else if(launch.launcType === 'bp') {
+ genSevs.launchBlueprint(launch);
+ }*/
+ if(launch.botLinkedCategory === 'Task'){
+ genSevs.executeTask(launch);
+ } else if(launch.botLinkedCategory === 'Blueprint') {
+ genSevs.launchBlueprint(launch);
+ }
};
- genSevs.promiseGet(param).then(function (result) {
- $timeout(function() {
- console.log(result);
- $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
- $scope.botLibGridOptions.data=result.bots;
- }, 100);
- $scope.isBotLibraryPageLoading = false;
- }, function(error) {
- $scope.isBotLibraryPageLoading = false;
- console.log(error);
- $scope.errorMessage = "No Records found";
- });
- };
- var gridBottomSpace = 190;
- $scope.gridHeight = workzoneUIUtils.makeTabScrollable('botLibraryPage') - gridBottomSpace;
- $scope.launchInstance = function(launch){
- console.log(launch.botLinkedCategory);
- /*if(launch.launcType === 'task'){
- genSevs.executeTask(launch);
- } else if(launch.launcType === 'bp') {
- genSevs.launchBlueprint(launch);
- }*/
- if(launch.botLinkedCategory === 'Task'){
- genSevs.executeTask(launch);
- } else if(launch.botLinkedCategory === 'Blueprint') {
- genSevs.launchBlueprint(launch);
- }
- };
- /*$scope.botLogs = function(bot){
- genSevs.botHistory(bot);
- };*/
- $scope.botHistory=function(bot) {
- var modalInstance = $modal.open({
- animation: true,
- templateUrl: 'src/partials/sections/dashboard/bots/view/botHistory.html',
- controller: 'botHistoryCtrl',
- backdrop : 'static',
- size: 'lg',
- keyboard: false,
- resolve: {
- items: function() {
- return bot;
+ /*$scope.botLogs = function(bot){
+ genSevs.botHistory(bot);
+ };*/
+ $scope.botHistory=function(bot) {
+ var modalInstance = $modal.open({
+ animation: true,
+ templateUrl: 'src/partials/sections/dashboard/bots/view/botHistory.html',
+ controller: 'botHistoryCtrl',
+ backdrop : 'static',
+ size: 'lg',
+ keyboard: false,
+ resolve: {
+ items: function() {
+ return bot;
+ }
}
- }
- });
- modalInstance.result.then(function(selectedItem) {
- $scope.selected = selectedItem;
- }, function() {
- console.log('Modal Dismissed at ' + new Date());
- });
- };
- $scope.botInfo=function(bot) {
- var modalInstance = $modal.open({
- animation: true,
- templateUrl: 'src/partials/sections/dashboard/bots/view/botInfo.html',
- controller: 'botInfoCtrl',
- backdrop : 'static',
- keyboard: false,
- resolve: {
- items: function() {
- return bot;
+ });
+ modalInstance.result.then(function(selectedItem) {
+ $scope.selected = selectedItem;
+ }, function() {
+ console.log('Modal Dismissed at ' + new Date());
+ });
+ };
+ $scope.botInfo=function(bot) {
+ var modalInstance = $modal.open({
+ animation: true,
+ templateUrl: 'src/partials/sections/dashboard/bots/view/botInfo.html',
+ controller: 'botInfoCtrl',
+ backdrop : 'static',
+ keyboard: false,
+ resolve: {
+ items: function() {
+ return bot;
+ }
}
- }
- });
- modalInstance.result.then(function(selectedItem) {
- $scope.selected = selectedItem;
- }, function() {
- console.log('Modal Dismissed at ' + new Date());
- });
- };
- $scope.botSchedule = function(bot) {
- $modal.open({
- templateUrl: 'src/partials/sections/dashboard/bots/view/botSchedule.html',
- controller: 'botScheduleCtrl',
- backdrop: 'static',
- keyboard: false,
- resolve: {
- items: function () {
- return bot
+ });
+ modalInstance.result.then(function(selectedItem) {
+ $scope.selected = selectedItem;
+ }, function() {
+ console.log('Modal Dismissed at ' + new Date());
+ });
+ };
+ $scope.botSchedule = function(bot) {
+ $modal.open({
+ templateUrl: 'src/partials/sections/dashboard/bots/view/botSchedule.html',
+ controller: 'botScheduleCtrl',
+ backdrop: 'static',
+ keyboard: false,
+ resolve: {
+ items: function () {
+ return bot
+ }
}
- }
- }).result.then(function (chefEventDetails) {
- $scope.isEventAvailable = true;
- $scope.chefJenkScriptTaskObj = chefEventDetails;
- var startTimeMinute,startTimeHour,dayOfWeek,selectedDayOfTheMonth,selectedMonth;
- startTimeMinute = $scope.chefJenkScriptTaskObj.startTimeMinute;
- startTimeHour = $scope.chefJenkScriptTaskObj.startTime;
- dayOfWeek = $scope.chefJenkScriptTaskObj.dayOfWeek;
- selectedDayOfTheMonth = $scope.chefJenkScriptTaskObj.selectedDayOfTheMonth;
- selectedMonth = $scope.chefJenkScriptTaskObj.monthOfYear;
- $scope.type = 'edit';
- $scope._isEventSelected = true;
-
- $scope.repeatPattern = 'Repeat Every -' + $scope.chefJenkScriptTaskObj.repeats;
- $scope.cronDetails = {
- cronStartOn : $scope.chefJenkScriptTaskObj.cronStart,
- cronEndOn : $scope.chefJenkScriptTaskObj.cronEnd,
- cronRepeatEvery : $scope.chefJenkScriptTaskObj.repeatBy,
- cronFrequency: $scope.chefJenkScriptTaskObj.repeats,
- cronTime: typeof startTimeHour !=='undefined'? startTimeHour : new Date().getHours() + ':' + typeof startTimeMinute !=='undefined'? startTimeMinute:new Date().getMinutes(),
- cronDays: $scope.chefJenkScriptTaskObj.dayOfWeek,
- cronMonth: $scope.chefJenkScriptTaskObj.monthOfYear
- }
- }, function () {
- console.log('Dismiss time is ' + new Date());
- });
- };
- $scope.deleteBot = function(bot) {
- var modalOptions = {
- closeButtonText: 'Cancel',
- actionButtonText: 'Delete',
- actionButtonStyle: 'cat-btn-delete',
- headerText: 'Delete Bot',
- bodyText: 'Are you sure you want to delete this bots?'
+ }).result.then(function (chefEventDetails) {
+ $scope.isEventAvailable = true;
+ $scope.chefJenkScriptTaskObj = chefEventDetails;
+ var startTimeMinute,startTimeHour,dayOfWeek,selectedDayOfTheMonth,selectedMonth;
+ startTimeMinute = $scope.chefJenkScriptTaskObj.startTimeMinute;
+ startTimeHour = $scope.chefJenkScriptTaskObj.startTime;
+ dayOfWeek = $scope.chefJenkScriptTaskObj.dayOfWeek;
+ selectedDayOfTheMonth = $scope.chefJenkScriptTaskObj.selectedDayOfTheMonth;
+ selectedMonth = $scope.chefJenkScriptTaskObj.monthOfYear;
+ $scope.type = 'edit';
+ $scope._isEventSelected = true;
+
+ $scope.repeatPattern = 'Repeat Every -' + $scope.chefJenkScriptTaskObj.repeats;
+ $scope.cronDetails = {
+ cronStartOn : $scope.chefJenkScriptTaskObj.cronStart,
+ cronEndOn : $scope.chefJenkScriptTaskObj.cronEnd,
+ cronRepeatEvery : $scope.chefJenkScriptTaskObj.repeatBy,
+ cronFrequency: $scope.chefJenkScriptTaskObj.repeats,
+ cronTime: typeof startTimeHour !=='undefined'? startTimeHour : new Date().getHours() + ':' + typeof startTimeMinute !=='undefined'? startTimeMinute:new Date().getMinutes(),
+ cronDays: $scope.chefJenkScriptTaskObj.dayOfWeek,
+ cronMonth: $scope.chefJenkScriptTaskObj.monthOfYear
+ }
+ }, function () {
+ console.log('Dismiss time is ' + new Date());
+ });
};
- confirmbox.showModal({}, modalOptions).then(function() {
- var param={
- url:'/bots/' + bot.botId
+ $scope.deleteBot = function(bot) {
+ var modalOptions = {
+ closeButtonText: 'Cancel',
+ actionButtonText: 'Delete',
+ actionButtonStyle: 'cat-btn-delete',
+ headerText: 'Delete Bot',
+ bodyText: 'Are you sure you want to delete this bots?'
};
- genSevs.promiseDelete(param).then(function (response) {
- if (response) {
- toastr.success('Successfully deleted');
- if($scope.totalBotsSelected) {
- $scope.botLibraryGridView();
- } else if($scope.runningBotsselected) {
- $scope.showBotsRunning();
- } else if($scope.failedBotsselected) {
- $scope.showFailedBots();
- } else {
- $scope.botLibraryGridView();
+ confirmbox.showModal({}, modalOptions).then(function() {
+ var param={
+ url:'/bots/' + bot.botId
+ };
+ genSevs.promiseDelete(param).then(function (response) {
+ if (response) {
+ toastr.success('Successfully deleted');
+ if($scope.totalBotsSelected) {
+ $scope.botLibraryGridView();
+ } else if($scope.runningBotsselected) {
+ $scope.showBotsRunning();
+ } else if($scope.failedBotsselected) {
+ $scope.showFailedBots();
+ } else {
+ $scope.botLibraryGridView();
+ }
+ lib.summary();
}
- lib.summary();
- }
- }, function(data) {
- toastr.error('error:: ' + data.toString());
+ }, function(data) {
+ toastr.error('error:: ' + data.toString());
+ });
});
- });
- };
- $rootScope.$on('BOTS_LIBRARY_REFRESH', function() {
- lib.summary();
- $scope.botLibraryGridView();
- });
- $scope.RefreshBotsLibrary = function() {
- $scope.totalBotsSelected = true;
- $scope.runningBotsselected = false;
- $scope.failedBotsselected = false;
- lib.summary();
- $scope.botLibraryGridView();
- };
- $scope.showBotsRunning = function() {
- $scope.runningBotsselected = true;
- $scope.totalBotsSelected = false;
- $scope.failedBotsselected = false;
- lib.gridOptions.data=[];
- var param={
- url:'/bots?actionStatus=running&page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
};
- genSevs.promiseGet(param).then(function (result) {
- $timeout(function() {
- $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
- $scope.botLibGridOptions.data=result.bots;
- }, 100);
+ $rootScope.$on('BOTS_LIBRARY_REFRESH', function() {
+ lib.summary();
+ $scope.botLibraryGridView();
});
- lib.summary();
- };
- $scope.showFailedBots = function() {
- $scope.failedBotsselected = true;
- $scope.runningBotsselected = false;
- $scope.totalBotsSelected = false;
- lib.gridOptions.data=[];
- var param={
- url:'/bots?actionStatus=failed&page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
+ $scope.RefreshBotsLibrary = function() {
+ $scope.totalBotsSelected = true;
+ $scope.runningBotsselected = false;
+ $scope.failedBotsselected = false;
+ lib.summary();
+ $scope.botLibraryGridView();
};
- genSevs.promiseGet(param).then(function (result) {
- $timeout(function() {
- $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
- $scope.botLibGridOptions.data=result.bots;
- }, 100);
- });
- lib.summary();
- };
- lib.summary = function() {
- $scope.botSummary=[];
- var param={
- url:'/audit-trail/bots-summary'
+ $scope.showBotsRunning = function() {
+ $scope.runningBotsselected = true;
+ $scope.totalBotsSelected = false;
+ $scope.failedBotsselected = false;
+ lib.gridOptions.data=[];
+ var param={
+ url:'/bots?actionStatus=running&page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
+ };
+ genSevs.promiseGet(param).then(function (result) {
+ $timeout(function() {
+ $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
+ $scope.botLibGridOptions.data=result.bots;
+ }, 100);
+ });
+ lib.summary();
};
- genSevs.promiseGet(param).then(function (response) {
- $scope.botSummary = response;
- $scope.totalSavedTimeForBots = parseInt($scope.botSummary.totalSavedTimeForBots);
- });
- };
- lib.summary();
- }]).controller('botInfoCtrl',['$scope', 'items', '$modalInstance', function ($scope, items, $modalInstance) {
+ $scope.showFailedBots = function() {
+ $scope.failedBotsselected = true;
+ $scope.runningBotsselected = false;
+ $scope.totalBotsSelected = false;
+ lib.gridOptions.data=[];
+ var param={
+ url:'/bots?actionStatus=failed&page=1&pageSize=10&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder
+ };
+ genSevs.promiseGet(param).then(function (result) {
+ $timeout(function() {
+ $scope.botLibGridOptions.totalItems = result.metaData.totalRecords;
+ $scope.botLibGridOptions.data=result.bots;
+ }, 100);
+ });
+ lib.summary();
+ };
+ lib.summary = function() {
+ $scope.botSummary=[];
+ var param={
+ url:'/audit-trail/bots-summary'
+ };
+ genSevs.promiseGet(param).then(function (response) {
+ $scope.botSummary = response;
+ $scope.totalSavedTimeForBots = parseInt($scope.botSummary.totalSavedTimeForBots);
+ });
+ };
+ lib.summary();
+ }]).controller('botInfoCtrl',['$scope', 'items', '$modalInstance', function ($scope, items, $modalInstance) {
$scope.botInfo = items;
console.log(items);
@@ -321,15 +321,15 @@
var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2];
$scope.schedulerStartOn = newdate;
var newEndOn = parseInt(items.chefJenkScriptTaskObj.cronEndOn);
- var newEndData = new Date(newEndOn).toLocaleDateString();
+ var newEndData = new Date(newEndOn).toLocaleDateString();
var datearrayNew = newEndData.split("/");
var newdateEnd = datearrayNew[1] + '/' + datearrayNew[0] + '/' + datearrayNew[2];
$scope.schedulerEndOn = newdateEnd;
} else {
$scope.schedulerStartOn = items.chefJenkScriptTaskObj.cronStart;
- $scope.schedulerEndOn = items.chefJenkScriptTaskObj.cronEnd;
+ $scope.schedulerEndOn = items.chefJenkScriptTaskObj.cronEnd;
}
-
+
$scope.repeatBy = items.chefJenkScriptTaskObj.repeatBy || items.chefJenkScriptTaskObj.cronRepeatEvery.toString();
$scope.repeatsType = items.chefJenkScriptTaskObj.repeats || items.chefJenkScriptTaskObj.cronFrequency;
$scope.timeEventType = items.chefJenkScriptTaskObj.startTime;
@@ -353,7 +353,7 @@
} else {
$scope.validDateRange=false;
}
-
+
};
$scope.repeatCount = function(max, step) {
@@ -367,30 +367,36 @@
$scope.isDaySelected = {
flag:true
}
-
+
$scope.daysOfWeek = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ];
$scope.monthOfYear = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ];
$scope.ok=function(){
$scope.eventParams = {
- repeats: $scope.repeatsType,
- repeatBy: $scope.repeatBy,
- cronStart: $scope.schedulerStartOn,
- cronEnd: $scope.schedulerEndOn,
- startTime: $scope.timeEventType,
- startTimeMinute: $scope.timeEventMinute,
- dayOfWeek: $scope.weekOfTheDay,
- selectedDayOfTheMonth: $scope.selectedDayOfTheMonth,
- monthOfYear: $scope.selectedMonth
+ cronFrequency: $scope.repeatsType,
+ cronRepeatEvery: $scope.repeatBy,
+ cronStartOn: $scope.schedulerStartOn,
+ cronEndOn: $scope.schedulerEndOn,
+ cronHour: $scope.timeEventType,
+ cronMinute: $scope.timeEventMinute,
+ cronWeekDay: $scope.weekOfTheDay,
+ cronDate: $scope.selectedDayOfTheMonth,
+ cronMonth: $scope.selectedMonth
};
+ var reqBody = {
+ botScheduler:$scope.eventParams,
+ isBotScheduled:true
+ }
var param={
url:'/bots/' + $scope.botId + '/scheduler',
- reqBody: $scope.eventParams
+ data: reqBody
};
genSevs.promisePut(param).then(function (response) {
- $scope.botSummary = response;
- $scope.totalSavedTimeForBots = parseInt($scope.botSummary.totalSavedTimeForBots);
+ if(response){
+ toastr.success('BOTs Scheduler successfully updated');
+ $modalInstance.dismiss('cancel');
+ }
});
};
@@ -410,15 +416,15 @@
$scope.initChefGrids = function(){
$scope.taskHistoryChefGridOptions.data='taskHistoryChefData';
$scope.taskHistoryChefGridOptions.columnDefs = [
- { name:'Status',field:'status',cellTemplate:'