Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

$scope.RefreshBotsAuditTrail = function() {
$scope.botAuditTrailGridView();
$scope.botAuditTrailSearch = '';
};

$scope.botAuditTrailGridView =function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(function (angular) {
"use strict";
angular.module('dashboard.bots')
.controller('chefLogCtrl', ['$q', '$scope', 'workzoneServices', '$timeout', 'orchestrationSetting', 'toastr','items', function ($q, $scope, workzoneServices, $timeout, orchestrationSetting, toastr,items) {
.controller('chefLogCtrl', ['$q', '$scope', 'workzoneServices', '$timeout', 'orchestrationSetting', 'toastr', function ($q, $scope, workzoneServices, $timeout, orchestrationSetting, toastr) {
/*This controller can be invoked from either of two flows - Chef Log History Item Logs OR Chef Task Execute
items object will contain only taskId and historyId. */
//var items = $scope.parentItemDetail;
Expand Down Expand Up @@ -232,11 +232,11 @@
};
init();
// on task change event in the parent controller
$scope.$on('parentChangeCompTask', function (event, args) {
/*$scope.$on('parentChangeCompTask', function (event, args) {
items = args;
resetAll();
init();
});
});*/
return chefLogData;
}
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{ 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: 'Organization',field:'masterDetails.orgName',cellTooltip: true},
{ name: 'Total Runs',field:'executionCount'},
{ name: 'BOT History',displayName: 'BOT History',cellTemplate:'<span ng-show="row.entity.blueprintType">NA</span>'+
'<span class="btn cat-btn-update control-panel-button" title="History" ng-show="row.entity.botLinkedSubCategory" ng-click="grid.appScope.botHistory(row.entity);"><i class="fa fa-header white"></i></span>'},
Expand Down Expand Up @@ -175,6 +175,7 @@
console.log('Modal Dismissed at ' + new Date());
});
};

$scope.botSchedule = function(bot) {
$modal.open({
templateUrl: 'src/partials/sections/dashboard/bots/view/botSchedule.html',
Expand All @@ -192,6 +193,7 @@
console.log('Dismiss time is ' + new Date());
});
};

$scope.deleteBot = function(bot) {
var modalOptions = {
closeButtonText: 'Cancel',
Expand Down Expand Up @@ -285,44 +287,43 @@
$modalInstance.dismiss('cancel');
};
}]).controller('botScheduleCtrl',['$scope', '$rootScope', 'genericServices', 'workzoneServices', 'toastr', '$modalInstance', 'items', '$timeout', function ($scope, $rootScope, genSevs, workzoneServices, toastr, $modalInstance, items, $timeout) {
$scope.scheduleDeatils = items;
$scope.botId = items.botId;
$scope.defaultSelection = function() {
$scope.repeatsType = 'Minutes';//default selection.
$scope.schedulerStartOn=moment(new Date()).format('MM/DD/YYYY');
$scope.schedulerEndOn=moment(new Date()).format('MM/DD/YYYY');
};
if(items.type !== 'new'){
if(items.chefJenkScriptTaskObj !==undefined){
if(items.chefJenkScriptTaskObj.cronStartOn && items.chefJenkScriptTaskObj.cronEndOn) {
var newStartOn = parseInt(items.chefJenkScriptTaskObj.cronStartOn);
var newDate = new Date(newStartOn).toLocaleDateString();
var datearray = newDate.split("/");
var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2];
$scope.schedulerStartOn = newdate;
var newEndOn = parseInt(items.chefJenkScriptTaskObj.cronEndOn);
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.repeatBy = items.chefJenkScriptTaskObj.repeatBy || items.chefJenkScriptTaskObj.cronRepeatEvery.toString();
$scope.repeatsType = items.chefJenkScriptTaskObj.repeats || items.chefJenkScriptTaskObj.cronFrequency;
$scope.timeEventType = items.chefJenkScriptTaskObj.startTime;
$scope.timeEventMinute = items.chefJenkScriptTaskObj.startTimeMinute;
$scope.weekOfTheDay = items.chefJenkScriptTaskObj.dayOfWeek;
$scope.currentDate = items.chefJenkScriptTaskObj.startDate;
$scope.selectedDayOfTheMonth = items.chefJenkScriptTaskObj.selectedDayOfTheMonth;
$scope.selectedMonth = items.chefJenkScriptTaskObj.monthOfYear;

if(items.botScheduler){
if(items.botScheduler.cronStartOn && items.botScheduler.cronEndOn) {
var newStartOn = parseInt(items.botScheduler.cronStartOn);
var newDate = new Date(newStartOn).toLocaleDateString();
var datearray = newDate.split("/");
var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2];
$scope.schedulerStartOn = newdate;
var newEndOn = parseInt(items.botScheduler.cronEndOn);
var newEndData = new Date(newEndOn).toLocaleDateString();
var datearrayNew = newEndData.split("/");
var newdateEnd = datearrayNew[1] + '/' + datearrayNew[0] + '/' + datearrayNew[2];
$scope.schedulerEndOn = newdateEnd;
} else {
$scope.defaultSelection();
$scope.schedulerStartOn = items.botScheduler.cronStartOn;
$scope.schedulerEndOn = items.botScheduler.cronEndOn;
}

$scope.repeatBy = items.botScheduler.repeatBy || items.botScheduler.cronRepeatEvery.toString();
$scope.repeatsType = items.botScheduler.repeats || items.botScheduler.cronFrequency;
$scope.timeEventType = items.botScheduler.timeEventHour || (items.botScheduler.cronHour && items.botScheduler.cronHour !==null) ? items.botScheduler.cronHour.toString() : '';
$scope.timeEventMinute = items.botScheduler.timeEventMinute || (items.botScheduler.cronMinute && items.botScheduler.cronMinute !==null) ? items.botScheduler.cronMinute.toString() : '';
$scope.weekOfTheDay = items.botScheduler.weekOfTheDay || (items.botScheduler.cronWeekDay && items.botScheduler.cronWeekDay !==null) ?items.botScheduler.cronWeekDay.toString(): '';
$scope.selectedDayOfTheMonth = items.botScheduler.selectedDayOfTheMonth || (items.botScheduler.cronDate && items.botScheduler.cronDate !==null) ?items.botScheduler.cronDate.toString() : '';
$scope.selectedMonth = items.botScheduler.selectedMonth || (items.botScheduler.cronMonth && items.botScheduler.cronMonth !==null) ? items.botScheduler.cronMonth.toString() : '';
/*$scope.currentDate = items.botScheduler.startDate;*/
} else {
$scope.defaultSelection();
}


$scope.dateChange= function () {
var startDate = Date.parse($scope.schedulerStartOn);
Expand Down Expand Up @@ -374,6 +375,7 @@
genSevs.promisePut(param).then(function (response) {
if(response){
toastr.success('BOTs Scheduler successfully updated');
$rootScope.$emit('BOTS_LIBRARY_REFRESH');
$modalInstance.dismiss('cancel');
}
});
Expand Down Expand Up @@ -479,6 +481,7 @@
$scope.isjenkinsTaskHistoryPageLoading = false;
}else if(response){
$scope.taskHistoryJenkinsData = response;
console.log($scope.taskHistoryJenkinsData);
$scope.isjenkinsTaskHistoryPageLoading = false;
}
},100);
Expand Down
30 changes: 24 additions & 6 deletions client/cat3/src/partials/sections/dashboard/bots/view/botInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,17 @@ <h4 class="modal-title">
<tr>
<td class="td-padding">Runlist</td>
<td>
<input class="form-control" disabled="disabled" ng-model="botInfo.botConfig.runlist[0]">
<input class="form-control" disabled="disabled" ng-model="botInfo.botConfig.runlist">
</td>
</tr>
<tr ng-show="botInfo.botConfig && botInfo.botConfig.attributes && botInfo.botConfig.attributes.length">
<td class="td-padding">Attributes</td>
<tr ng-show="botInfo.botConfig && botInfo.botConfig.attributes && botInfo.botConfig.attributes.length > 1" ng-repeat="attribs in botInfo.botConfig.attributes">
<td class="td-padding">Attribute{{$index+1}}</td>
<td>
<input class="form-control" disabled="disabled" ng-model="attribs.name">
</td>
</tr>
<tr ng-show="botInfo.botConfig && botInfo.botConfig.attributes && botInfo.botConfig.attributes.length === 1">
<td class="td-padding">Attribute</td>
<td>
<input class="form-control" disabled="disabled" ng-model="botInfo.botConfig.attributes[0].name">
</td>
Expand Down Expand Up @@ -106,8 +112,14 @@ <h4 class="modal-title">
<input disabled="disabled" class="form-control" ng-model="botInfo.botConfig.parameterized[0].name">
</td>
</tr>
<tr ng-show="botInfo.botConfig && botInfo.botConfig.parameterized && botInfo.botConfig.parameterized.length">
<td class="td-padding">Bot Parameter Value</td>
<!-- <tr ng-show="botInfo.botConfig && botInfo.botConfig.parameterized && botInfo.botConfig.parameterized.length > 1" ng-repeat="paramval in botInfo.botConfig.parameterized">
<td class="td-padding">Bot Parameter Values</td>
<td>
<input disabled="disabled" class="form-control" ng-model="paramval.defaultValue">
</td>
</tr> -->
<tr ng-show="botInfo.botConfig && botInfo.botConfig.parameterized && botInfo.botConfig.parameterized.length === 1">
<td class="td-padding">Bot Parameter Values</td>
<td>
<input disabled="disabled" class="form-control" ng-model="botInfo.botConfig.parameterized[0].defaultValue">
</td>
Expand All @@ -126,12 +138,18 @@ <h4 class="modal-title">
<input class="form-control" disabled="disabled" ng-model="botInfo.botConfig.scriptTypeName">
</td>
</tr>
<tr ng-show="botInfo.botConfig.scriptDetails.length">
<tr ng-show="botInfo.botConfig && botInfo.botConfig.scriptDetails && botInfo.botConfig.scriptDetails[0].scriptParameters.length === 1">
<td class="td-padding">Script Parameter Description</td>
<td>
<input class="form-control" disabled="disabled" ng-model="botInfo.botConfig.scriptDetails[0].scriptParameters[0].paramDesc">
</td>
</tr>
<tr ng-show="botInfo.botConfig && botInfo.botConfig.scriptDetails && botInfo.botConfig.scriptDetails[0].scriptParameters.length > 1" ng-repeat="desc in botInfo.botConfig.scriptDetails[0].scriptParameters">
<td class="td-padding">Script Parameter{{$index+1}} Description</td>
<td>
<input class="form-control" disabled="disabled" ng-model="desc.paramDesc">
</td>
</tr>
</tbody>
</table>
</fieldset>
Expand Down