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 @@ -287,14 +287,27 @@
$modalInstance.dismiss('cancel');
};
}]).controller('botScheduleCtrl',['$scope', '$rootScope', 'genericServices', 'workzoneServices', 'toastr', '$modalInstance', 'items', '$timeout', function ($scope, $rootScope, genSevs, workzoneServices, toastr, $modalInstance, items, $timeout) {
if(items.isBotScheduled === true){
$scope._isEventSelected = true;
$scope.isScheduled = true;
}else{
$scope._isEventSelected = false;
$scope.isScheduled = false;
}
$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');
};

$scope.selectBotCheckbox = function(){
if($scope.isScheduled === true || $scope.isScheduled === 'true') {
$scope._isEventSelected = true;
}else{
$scope._isEventSelected = false;
}
}
if(items.botScheduler){
if(items.botScheduler.cronStartOn && items.botScheduler.cronEndOn) {
var newStartOn = parseInt(items.botScheduler.cronStartOn);
Expand Down Expand Up @@ -364,9 +377,17 @@
cronDate: $scope.selectedDayOfTheMonth,
cronMonth: $scope.selectedMonth
};
var reqBody = {
botScheduler:$scope.eventParams,
isBotScheduled:true
var reqBody = null;
if($scope.isScheduled === true || $scope.isScheduled === 'true'){
reqBody = {
botScheduler:$scope.eventParams,
isBotScheduled:true
}
}else{
reqBody = {
botScheduler:{},
isBotScheduled:false
}
}
var param={
url:'/bots/' + $scope.botId + '/scheduler',
Expand Down Expand Up @@ -457,7 +478,7 @@
$scope.taskHistoryJenkinsGridOptions.data='taskHistoryJenkinsData';
$scope.taskHistoryJenkinsGridOptions.columnDefs = [
{ name:'Job Number',field:'auditTrailConfig.jenkinsBuildNumber',cellTemplate:'<a target="_blank" title="Jenkins" ng-href="{{grid.appScope.task.taskConfig.jobURL}}/{{row.entity.auditTrailConfig.jenkinsBuildNumber}}">{{row.entity.auditTrailConfig.jenkinsBuildNumber}}</a>', sort:{ direction: 'desc'}, cellTooltip: true},
{ name:'Job Output',cellTemplate:'<span><a target="_blank" title="{{jobResultUrlName}}" class="fa fa-file-text bigger-120 btn cat-btn-update btn-sg tableactionbutton marginbottomright3" ng-repeat="jobResultUrlName in row.entity.jobResultURL" ng-href="{{jobResultUrlName}}"></a></span>',cellTooltip: true},
{ name:'Job Output',cellTemplate:'<span><a target="_blank" title="{{jobResultUrlName}}" class="fa fa-file-text bigger-120 btn cat-btn-update btn-sg tableactionbutton marginbottomright3" ng-repeat="jobResultUrlName in row.entity.auditTrailConfig.jobResultURL" ng-href="{{jobResultUrlName}}"></a></span>',cellTooltip: true},
{ name:'Log Info',width: 90,cellTemplate:'<span title="Jenkins Log" class="fa fa-list bigger-120 btn cat-btn-update btn-sg tableactionbutton" ng-click="grid.appScope.historyLogs(row.entity);"></span>',cellTooltip: true},
{ name:'Status',field:'status',cellTemplate:'<div class="{{row.entity.status.toUpperCase()}}">{{row.entity.status.toUpperCase()}}</div>'},
{ name:'Start Time',field:'startedOn',cellTemplate:'<span title="{{row.entity.startedOn | timestampToLocaleTime}}">{{row.entity.startedOn | timestampToLocaleTime}}</span>',cellTooltip: true},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,34 @@
<span class="close" ng-click="cancel()">×</span>
<h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h4>
</div>

<div class="modal-body">
<div class="col-lg-6 col-md-6 margintop15">
<label>Do you want to Schedule BOTs? </label>
</div>
<div class="col-lg-6 col-md-6 margintop15">
<input type="radio" ng-value="true" ng-model="isScheduled" name="isScheduled" ng-click="selectBotCheckbox()" />
<label for="isScheduled" class="paddingright15">Yes</label>
<input type="radio" ng-value="false" ng-model="isScheduled" name="isScheduled" ng-click="selectBotCheckbox()" />
<label for="isScheduled" class="paddingright15">No</label>
</div>

<!--dropdown for selecting the repeat type-->
<div class="col-lg-6 col-md-6 ">

<div class="col-lg-6 col-md-6 " ng-show="_isEventSelected">
<label>Starts on: <span class="red">*</span>
</label>
<input id="date-start" ng-change="dateChange()" required type="text" ng-model="schedulerStartOn" class="form-control-date" >
<input id="date-start" ng-change="dateChange()" type="text" ng-model="schedulerStartOn" class="form-control-date" >
</div>
<div class="col-lg-6 col-md-6 ">
<div class="col-lg-6 col-md-6 " ng-show="_isEventSelected">
<label>Ends on: <span class="red">*</span>
</label>
<input ng-change="dateChange()" type="text" id="date-end" ng-model="schedulerEndOn" class="form-control-date" required >
<input ng-change="dateChange()" type="text" id="date-end" ng-model="schedulerEndOn" class="form-control-date" >
<span class="error red" ng-show="validDateRange">Start Date should be less than End date !</span>
</div>
<div class="clearfix margintop15 "></div>
<div class="clearfix margintop15"></div>
<div class="clearfix margintop15"></div>
<div ng-show="_isEventSelected">
<fieldset class="repo-job-details-wrapper">
<legend class="repo-job-details-wrapper-inner"><i class="fa fa-hourglass-start" ></i> Interval </legend>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
Expand All @@ -33,10 +46,10 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<label>Repeat By: <span class="red">*</span>
<span ng-show="newSchedule.repeatBy.$touched && newSchedule.repeatBy.$invalid" class="inputValidationMsg">required
<span ng-show="newSchedule.repeatBy.$touched && newSchedule.repeatBy.$invalid" class="inputValidationMsg">
</span>
</label>
<select name="repeatBy" class="form-control-date" ng-model="repeatBy" required>
<select name="repeatBy" class="form-control-date" ng-model="repeatBy" >
<option value="" selected="selected">Choose</option>
<option ng-repeat="repeatBy in repeatCount(30)" value="{{repeatBy}}" title="Repeat Every {{repeatBy}}">{{repeatBy}}</option>
</select>
Expand All @@ -60,7 +73,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 margintop10" ng-show="repeatsType!=='Minutes'">
<label>Time(Hrs):
<span class="red">&nbsp;*</span>
<span ng-show="newSchedule.timeEventHour.$touched && newSchedule.timeEventHour.$invalid" class="inputValidationMsg">required
<span ng-show="newSchedule.timeEventHour.$touched && newSchedule.timeEventHour.$invalid" class="inputValidationMsg">
</span>
</label>
<select name="timeEventHour" class="form-control-date" ng-model="timeEventType">
Expand All @@ -71,7 +84,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 margintop10" ng-show="repeatsType!=='Minutes'">
<label>Time(Mins):
<span class="red">&nbsp;*</span>
<span ng-show="newSchedule.timeEventMinute.$touched && newSchedule.timeEventMinute.$invalid" class="inputValidationMsg">required
<span ng-show="newSchedule.timeEventMinute.$touched && newSchedule.timeEventMinute.$invalid" class="inputValidationMsg">
</span>
</label>
<select name="timeEventMinute" class="form-control-date" ng-model="timeEventMinute">
Expand All @@ -83,7 +96,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 margintop10" ng-show="repeatsType==='Weekly'">
<label>Repeat On:
<span class="control-label red">&nbsp;*</span>
<span ng-show="newSchedule.weekOfTheDay.$touched && newSchedule.weekOfTheDay.$invalid" class="inputValidationMsg">required
<span ng-show="newSchedule.weekOfTheDay.$touched && newSchedule.weekOfTheDay.$invalid" class="inputValidationMsg">
</span>
</label>
<select name="weekOfTheDay" class="form-control-date" ng-model="weekOfTheDay">
Expand All @@ -96,7 +109,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 margintop10" ng-show="repeatsType==='Monthly'">
<label>Choose Date:
<span class="control-label red">&nbsp;*</span>
<span ng-show="newSchedule.selectedDayOfTheMonth.$touched && newSchedule.selectedDayOfTheMonth.$invalid" class="inputValidationMsg">required
<span ng-show="newSchedule.selectedDayOfTheMonth.$touched && newSchedule.selectedDayOfTheMonth.$invalid" class="inputValidationMsg">
</span>
</label>
<select name="selectedDayOfTheMonth" class="form-control-date" ng-model="selectedDayOfTheMonth">
Expand All @@ -108,6 +121,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Bot</h
<!--starts at dropdown ends here-->
<!--dropdown ends here-->
</fieldset>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn cat-btn-close" ng-click="cancel()">
Expand Down
4 changes: 4 additions & 0 deletions server/app/model/audit-trail/bot-audit-trail.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ var BotAuditTrailSchema = new BaseAuditTrail({
type: String,
trim:true
},
jobResultURL:{
type: [String],
trim:true
},
manualExecutionTime:{
type: Number,
required: false
Expand Down
Loading