mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Merge pull request #995 from leigh-johnson/MgmtJobsSchd
Hook up Management Jobs to new Scheduler module
This commit is contained in:
commit
0cab5ac2e2
@ -214,19 +214,18 @@ export default
|
||||
return function(params) {
|
||||
var scope = params.scope,
|
||||
callback= params.callback,
|
||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||
base = params.base || $location.path().replace(/^\//, '').split('/')[0],
|
||||
url = GetBasePath(base),
|
||||
scheduler;
|
||||
|
||||
if (!Empty($stateParams.template_id)) {
|
||||
url += $stateParams.template_id + '/schedules/';
|
||||
}
|
||||
else if (!Empty($stateParams.id)) {
|
||||
else if (!Empty($stateParams.id) && base != 'system_job_templates') {
|
||||
url += $stateParams.id + '/schedules/';
|
||||
}
|
||||
else if (!Empty($stateParams.management_job)) {
|
||||
url += $stateParams.management_job + '/schedules/';
|
||||
if(scope.management_job.id === 4){
|
||||
else if (base == 'system_job_templates') {
|
||||
url += $stateParams.id + '/schedules/';
|
||||
if($stateParams.id == 4){
|
||||
scope.isFactCleanup = true;
|
||||
scope.keep_unit_choices = [{
|
||||
"label" : "Days",
|
||||
@ -538,7 +537,7 @@ export default
|
||||
var scope = params.scope,
|
||||
parent_scope = params.parent_scope,
|
||||
iterator = (params.iterator) ? params.iterator : scope.iterator,
|
||||
base = $location.path().replace(/^\//, '').split('/')[0];
|
||||
base = params.base || $location.path().replace(/^\//, '').split('/')[0];
|
||||
|
||||
scope.toggleSchedule = function(event, id) {
|
||||
try {
|
||||
|
||||
@ -238,10 +238,9 @@ export default
|
||||
}
|
||||
};
|
||||
|
||||
$scope.configureSchedule = function() {
|
||||
$state.transitionTo('managementJobsSchedule', {
|
||||
management_job: this.job_type,
|
||||
management_job_id: this.card.id
|
||||
$scope.configureSchedule = function(id) {
|
||||
$state.transitionTo('managementJobSchedules', {
|
||||
id: id
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<i class="MgmtCards-actionItemIcon fa fa-rocket"></i>
|
||||
</button>
|
||||
<button class="MgmtCards-actionItem List-actionButton"
|
||||
ng-click='configureSchedule()'>
|
||||
ng-click='configureSchedule(card.id)'>
|
||||
<i class="MgmtCards-actionItemIcon fa fa-calendar"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import managementJobsCard from './card/main';
|
||||
import managementJobsSchedule from './schedule/main';
|
||||
import managementJobsScheduler from './scheduler/main';
|
||||
import list from './management-jobs.list';
|
||||
|
||||
export default
|
||||
angular.module('managementJobs', [
|
||||
managementJobsCard.name,
|
||||
managementJobsSchedule.name
|
||||
managementJobsScheduler.name
|
||||
])
|
||||
.factory('managementJobsListObject', list);
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import route from './schedule.route';
|
||||
import controller from './schedule.controller';
|
||||
|
||||
export default
|
||||
angular.module('managementJobsSchedule', [])
|
||||
.controller('managementJobsScheduleController', controller)
|
||||
.run(['$stateExtender', function($stateExtender) {
|
||||
$stateExtender.addState(route);
|
||||
}]);
|
||||
@ -1,89 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name controllers.function:Schedules
|
||||
* @description This controller's for schedules
|
||||
*/
|
||||
|
||||
export default [
|
||||
'$scope', '$location', '$stateParams', 'SchedulesList', 'Rest',
|
||||
'ProcessErrors', 'GetBasePath', 'Wait','LoadSchedulesScope', 'GetChoices',
|
||||
'management_job', '$rootScope',
|
||||
function($scope, $location, $stateParams, SchedulesList, Rest,
|
||||
ProcessErrors, GetBasePath, Wait, LoadSchedulesScope, GetChoices,
|
||||
management_job, $rootScope) {
|
||||
var base, id, url, parentObject;
|
||||
$scope.management_job = management_job;
|
||||
base = $location.path().replace(/^\//, '').split('/')[0];
|
||||
|
||||
// GetBasePath('management_job') must map to 'system_job_templates'
|
||||
// to match the api syntax
|
||||
$rootScope.defaultUrls.management_jobs = 'api/v1/system_job_templates/';
|
||||
|
||||
if ($scope.removePostRefresh) {
|
||||
$scope.removePostRefresh();
|
||||
}
|
||||
$scope.removePostRefresh = $scope.$on('PostRefresh', function() {
|
||||
var list = $scope.schedules;
|
||||
list.forEach(function(element, idx) {
|
||||
list[idx].play_tip = (element.enabled) ? 'Schedule is Active.'+
|
||||
' Click to temporarily stop.' : 'Schedule is temporarily '+
|
||||
'stopped. Click to activate.';
|
||||
});
|
||||
});
|
||||
|
||||
if ($scope.removeParentLoaded) {
|
||||
$scope.removeParentLoaded();
|
||||
}
|
||||
$scope.removeParentLoaded = $scope.$on('ParentLoaded', function() {
|
||||
url += "schedules/";
|
||||
SchedulesList.well = true;
|
||||
LoadSchedulesScope({
|
||||
parent_scope: $scope,
|
||||
scope: $scope,
|
||||
list: SchedulesList,
|
||||
id: 'management_jobs_schedule',
|
||||
url: url,
|
||||
pageSize: 20
|
||||
});
|
||||
});
|
||||
|
||||
if ($scope.removeChoicesReady) {
|
||||
$scope.removeChocesReady();
|
||||
}
|
||||
$scope.removeChoicesReady = $scope.$on('choicesReady', function() {
|
||||
// Load the parent object
|
||||
id = $stateParams.management_job_id;
|
||||
url = GetBasePath('system_job_templates') + id + '/';
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
parentObject = data;
|
||||
$scope.$emit('ParentLoaded');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + ' failed. GET returned: ' + status });
|
||||
});
|
||||
});
|
||||
|
||||
$scope.refreshJobs = function() {
|
||||
$scope.search(SchedulesList.iterator);
|
||||
};
|
||||
|
||||
Wait('start');
|
||||
|
||||
GetChoices({
|
||||
scope: $scope,
|
||||
url: GetBasePath('system_jobs'),
|
||||
field: 'type',
|
||||
variable: 'type_choices',
|
||||
callback: 'choicesReady'
|
||||
});
|
||||
}
|
||||
];
|
||||
@ -1,6 +0,0 @@
|
||||
<div class="tab-pane" id="management_jobs_schedule">
|
||||
<div ng-cloak id="htmlTemplate"></div>
|
||||
</div>
|
||||
|
||||
<div ng-include="'/static/partials/logviewer.html'"></div>
|
||||
<div ng-include="'/static/partials/schedule_dialog.html'"></div>
|
||||
@ -1,51 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import {templateUrl} from '../../shared/template-url/template-url.factory';
|
||||
|
||||
export default {
|
||||
name: 'managementJobsSchedule',
|
||||
route: '/management_jobs/:management_job_id/schedules',
|
||||
templateUrl: templateUrl('management-jobs/schedule/schedule'),
|
||||
controller: 'managementJobsScheduleController',
|
||||
data: {
|
||||
activityStream: true,
|
||||
activityStreamTarget: 'schedule'
|
||||
},
|
||||
params: {management_job: null},
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
return FeaturesService.get();
|
||||
}],
|
||||
management_job:
|
||||
[ '$stateParams',
|
||||
'$q',
|
||||
'Rest',
|
||||
'GetBasePath',
|
||||
'ProcessErrors',
|
||||
function($stateParams, $q, rest, getBasePath, ProcessErrors) {
|
||||
if ($stateParams.management_job) {
|
||||
return $q.when($stateParams.management_job);
|
||||
}
|
||||
|
||||
var managementJobId = $stateParams.management_job_id;
|
||||
|
||||
var url = getBasePath('system_job_templates') + managementJobId + '/';
|
||||
rest.setUrl(url);
|
||||
return rest.get()
|
||||
.then(function(data) {
|
||||
return data.data;
|
||||
}).catch(function (response) {
|
||||
ProcessErrors(null, response.data, response.status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to get inventory script info. GET returned status: ' +
|
||||
response.status
|
||||
});
|
||||
});
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
52
awx/ui/client/src/management-jobs/scheduler/main.js
Normal file
52
awx/ui/client/src/management-jobs/scheduler/main.js
Normal file
@ -0,0 +1,52 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
|
||||
import {templateUrl} from '../../shared/template-url/template-url.factory';
|
||||
import controller from '../../scheduler/scheduler.controller';
|
||||
import addController from '../../scheduler/schedulerAdd.controller';
|
||||
import editController from '../../scheduler/schedulerEdit.controller';
|
||||
|
||||
export default
|
||||
angular.module('managementJobScheduler', [])
|
||||
.controller('managementJobController', controller)
|
||||
.controller('managementJobAddController', addController)
|
||||
.controller('managementJobEditController', editController)
|
||||
.run(['$stateExtender', function($stateExtender){
|
||||
$stateExtender.addState({
|
||||
name: 'managementJobSchedules',
|
||||
route: '/management_jobs/:id/schedules',
|
||||
templateUrl: templateUrl('scheduler/scheduler'),
|
||||
controller: 'managementJobController',
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService){
|
||||
return FeaturesService.get();
|
||||
}]
|
||||
}
|
||||
});
|
||||
$stateExtender.addState({
|
||||
name: 'managementJobSchedules.add',
|
||||
route: '/add',
|
||||
templateUrl: templateUrl('management-jobs/scheduler/schedulerForm'),
|
||||
controller: 'managementJobAddController',
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService){
|
||||
return FeaturesService.get();
|
||||
}]
|
||||
}
|
||||
});
|
||||
$stateExtender.addState({
|
||||
name: 'managementJobSchedules.edit',
|
||||
route: '/add',
|
||||
templateUrl: templateUrl('management-jobs/scheduler/schedulerForm'),
|
||||
controller: 'managementJobEditController',
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService){
|
||||
return FeaturesService.get();
|
||||
}]
|
||||
}
|
||||
});
|
||||
}]);
|
||||
@ -0,0 +1,652 @@
|
||||
<div id="htmlTemplate" class=" SchedulerFormPanel Panel" ng-hide="hideForm">
|
||||
<div class="Form-header">
|
||||
<div class="Form-title" ng-show="!isEdit">{{ schedulerName || "Add Schedule"}}</div>
|
||||
<div class="Form-title" ng-show="isEdit">{{ schedulerName || "Edit Schedule"}}</div>
|
||||
<div class="Form-exitHolder">
|
||||
<button class="Form-exit" ng-click="formCancel()">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="SchedulerFormTarget">
|
||||
|
||||
<form class="form Form"
|
||||
role="form"
|
||||
name="scheduler_form_new"
|
||||
novalidate>
|
||||
|
||||
<div class="form-group SchedulerForm-formGroup">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
Name
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control input-sm
|
||||
Form-textInput"
|
||||
ng-class="{'RepeatFrequencyOptions-nameBorderErrorFix': scheduler_form_new.$dirty && scheduler_form_new.schedulerName.$error.required}"
|
||||
name="schedulerName"
|
||||
id="schedulerName"
|
||||
ng-model="schedulerName" required
|
||||
placeholder="Schedule name">
|
||||
<div class="error"
|
||||
ng-show="scheduler_form_new.$dirty && scheduler_form_new.schedulerName.$error.required">
|
||||
A schedule name is required.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group SchedulerForm-formGroup">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
Start Date
|
||||
<span class="fmt-help">
|
||||
(mm/dd/yyyy)
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group Form-inputGroup">
|
||||
<input type="text"
|
||||
class="form-control input-sm
|
||||
Form-textInput"
|
||||
name="schedulerStartDt"
|
||||
id="schedulerStartDt"
|
||||
ng-model="schedulerStartDt"
|
||||
sch-date-picker
|
||||
placeholder="mm/dd/yyyy"
|
||||
required
|
||||
ng-change="scheduleTimeChange()" >
|
||||
<span class="input-group-btn">
|
||||
<button
|
||||
class="btn btn-default btn-sm
|
||||
Form-inputButton Form-lookupButton"
|
||||
type="button"
|
||||
ng-click="showCalendar('schedulerStartDt')">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="error"
|
||||
ng-show="scheduler_form_schedulerStartDt_error"
|
||||
ng-bind="scheduler_form_schedulerStartDt_error">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group SchedulerForm-formGroup">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
Start Time
|
||||
<span class="fmt-help"
|
||||
ng-show="schedulerShowTimeZone">
|
||||
(HH24:MM:SS)
|
||||
</span>
|
||||
<span class="fmt-help"
|
||||
ng-show="!schedulerShowTimeZone">
|
||||
(HH24:MM:SS UTC)
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group SchedulerTime">
|
||||
<input name="schedulerStartHour"
|
||||
id="schedulerStartHour"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-time-spinner
|
||||
ScheduleTime-input SpinnerInput"
|
||||
ng-model="schedulerStartHour"
|
||||
placeholder="HH24"
|
||||
aw-min="0" min="0" aw-max="23"
|
||||
max="23" data-zero-pad="2" required
|
||||
ng-change="scheduleTimeChange()" >
|
||||
<span
|
||||
class="SchedulerTime-separator">
|
||||
:
|
||||
</span>
|
||||
<input name="schedulerStartMinute"
|
||||
id="schedulerStartMinute"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-time-spinner
|
||||
SchedulerTime-input SpinnerInput"
|
||||
ng-model="schedulerStartMinute"
|
||||
placeholder="MM"
|
||||
min="0" max="59" data-zero-pad="2"
|
||||
required
|
||||
ng-change="scheduleTimeChange()" >
|
||||
<span
|
||||
class="SchedulerTime-separator">
|
||||
:
|
||||
</span>
|
||||
<input name="schedulerStartSecond"
|
||||
id="schedulerStartSecond"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-time-spinner
|
||||
SchedulerTime-input SpinnerInput"
|
||||
ng-model="schedulerStartSecond"
|
||||
placeholder="SS"
|
||||
min="0" max="59" data-zero-pad="2"
|
||||
required
|
||||
ng-change="scheduleTimeChange()" >
|
||||
<!-- <div class="form-group
|
||||
SchedulerTime-utc"
|
||||
ng-show="schedulerShowUTCStartTime">
|
||||
<label
|
||||
class="SchedulerTime-utcLabel">
|
||||
UTC Start Time
|
||||
</label>
|
||||
<div id="schedulerUTCTime"
|
||||
class="SchedulerTime-utcTime">
|
||||
{{ schedulerUTCTime.split("UTC")[0] }}
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="error"
|
||||
ng-show="scheduler_startTime_error">
|
||||
The time must be in HH24:MM:SS format.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group SchedulerForm-formGroup"
|
||||
ng-show="schedulerShowTimeZone">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
Local Time Zone
|
||||
</label>
|
||||
<select
|
||||
class="MakeSelect2"
|
||||
name="schedulerTimeZone"
|
||||
id="schedulerTimeZone"
|
||||
ng-model="schedulerTimeZone"
|
||||
ng-options="z.name for z in timeZones"
|
||||
required class="form-control input-sm"
|
||||
ng-change="scheduleTimeChange()" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group SchedulerForm-formGroup">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
Repeat frequency
|
||||
</label>
|
||||
<select name="schedulerFrequency"
|
||||
id="schedulerFrequency"
|
||||
class="MakeSelect2"
|
||||
ng-model="schedulerFrequency"
|
||||
ng-options="f.name for f in frequencyOptions"
|
||||
required class="form-control input-sm"
|
||||
ng-change="scheduleRepeatChange()">
|
||||
</select>
|
||||
<div class="error"
|
||||
ng-show="sheduler_frequency_error">
|
||||
</div>
|
||||
</div>
|
||||
<div class="RepeatFrequencyOptions-label"
|
||||
ng-show="schedulerFrequency.value && schedulerFrequency.value !== 'none'">
|
||||
Frequency Details</div>
|
||||
<div class="RepeatFrequencyOptions Form"
|
||||
ng-show="schedulerFrequency.value && schedulerFrequency.value !== 'none'">
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-everyGroup
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerShowInterval">
|
||||
<label class="Form-inputLabel
|
||||
RepeatFrequencyOptions-everyLabel">
|
||||
<span class="red-text">*</span>
|
||||
Every
|
||||
</label>
|
||||
<input name="schedulerInterval"
|
||||
id="schedulerInterval"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-spinner
|
||||
SpinnerInput"
|
||||
ng-model="$parent.schedulerInterval"
|
||||
min="1"
|
||||
max="999"
|
||||
ng-change="resetError('scheduler_interval_error')"
|
||||
>
|
||||
<label class="inline-label
|
||||
RepeatFrequencyOptions-inlineLabel"
|
||||
ng-bind="schedulerIntervalLabel">
|
||||
</label>
|
||||
<div
|
||||
class="error
|
||||
RepeatFrequencyOptions-error"
|
||||
ng-show="$parent.scheduler_interval_error">
|
||||
Please provide a value between 1 and 999.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerFrequency && schedulerFrequency.value == 'monthly'">
|
||||
<div class="radio
|
||||
RepeatFrequencyOptions-radioLabel">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio" value="day"
|
||||
ng-model="$parent.monthlyRepeatOption"
|
||||
ng-change="monthlyRepeatChange()"
|
||||
name="monthlyRepeatOption"
|
||||
id="monthlyRepeatOption">
|
||||
on day
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
name="monthDay"
|
||||
id="monthDay"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-spinner SpinnerInput"
|
||||
ng-model="$parent.monthDay"
|
||||
min="1" max="31"
|
||||
ng-change="resetError('scheduler_monthDay_error')" >
|
||||
<div class="error"
|
||||
ng-show="$parent.scheduler_monthDay_error">
|
||||
The day must be between 1 and 31.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerFrequency && schedulerFrequency.value == 'monthly'">
|
||||
<div class="radio
|
||||
RepeatFrequencyOptions-radioLabel">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio"
|
||||
value="other"
|
||||
ng-model="$parent.monthlyRepeatOption"
|
||||
ng-change="monthlyRepeatChange()"
|
||||
name="monthlyRepeatOption"
|
||||
id="monthlyRepeatOption">
|
||||
on the
|
||||
</label>
|
||||
</div>
|
||||
<div class="RepeatFrequencyOptions-inputGroup
|
||||
RepeatFrequencyOptions-inputGroup--halves">
|
||||
<select name="monthlyOccurrence"
|
||||
id="monthlyOccurrence"
|
||||
ng-model="$parent.monthlyOccurrence"
|
||||
ng-options="o.name for o in occurrences"
|
||||
ng-disabled="monthlyRepeatOption != 'other'"
|
||||
class=" MakeSelect2 form-control
|
||||
input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
RepeatFrequencyOptions-monthlyOccurence"
|
||||
>
|
||||
</select>
|
||||
<select name="monthlyWeekDay"
|
||||
id="monthlyWeekDay"
|
||||
ng-model="$parent.monthlyWeekDay"
|
||||
ng-options="w.name for w in weekdays"
|
||||
ng-disabled="monthlyRepeatOption != 'other'"
|
||||
class="MakeSelect2 form-control input-sm" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerFrequency && schedulerFrequency.value == 'yearly'">
|
||||
<div class="radio
|
||||
RepeatFrequencyOptions-radioLabel">
|
||||
<span class="red-text">*</span>
|
||||
<label class="Form-inputLabel">
|
||||
<input type="radio"
|
||||
value="month"
|
||||
ng-model="$parent.yearlyRepeatOption"
|
||||
ng-change="yearlyRepeatChange()"
|
||||
name="yearlyRepeatOption"
|
||||
id="yearlyRepeatOption">
|
||||
on
|
||||
</label>
|
||||
</div>
|
||||
<div class="RepeatFrequencyOptions-inputGroup
|
||||
RepeatFrequencyOptions-inputGroup--halvesWithNumber">
|
||||
<select name="yearlyMonth"
|
||||
id="yearlyMonth"
|
||||
ng-model="$parent.yearlyMonth"
|
||||
ng-options="m.name for m in months"
|
||||
ng-disabled="yearlyRepeatOption != 'month'"
|
||||
class="MakeSelect2 form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect"
|
||||
>
|
||||
</select>
|
||||
<input name="yearlyMonthDay"
|
||||
id="yearlyMonthDay"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-spinner
|
||||
SpinnerInput"
|
||||
ng-model="$parent.yearlyMonthDay"
|
||||
min="1" max="31"
|
||||
ng-change="resetError('scheduler_yearlyMonthDay_error')"
|
||||
>
|
||||
</div>
|
||||
<div class="error"
|
||||
ng-show="$parent.scheduler_yearlyMonthDay_error">
|
||||
The day must be between 1 and 31.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerFrequency && schedulerFrequency.value == 'yearly'">
|
||||
<div class="radio
|
||||
RepeatFrequencyOptions-radioLabel">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio"
|
||||
value="other"
|
||||
ng-model="$parent.yearlyRepeatOption"
|
||||
ng-change="yearlyRepeatChange()"
|
||||
name="yearlyRepeatOption"
|
||||
id="yearlyRepeatOption">
|
||||
on the
|
||||
</label>
|
||||
</div>
|
||||
<div
|
||||
class="RepeatFrequencyOptions-inputGroup
|
||||
RepeatFrequencyOptions-inputGroup--thirds"
|
||||
>
|
||||
<select name="yearlyOccurrence"
|
||||
id="yearlyOccurrence"
|
||||
ng-model="$parent.yearlyOccurrence"
|
||||
ng-options="o.name for o in occurrences"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
RepeatFrequencyOptions-yearlyOccurence
|
||||
RepeatFrequencyOptions-thirdSelect"
|
||||
>
|
||||
</select>
|
||||
<select name="yearlyWeekDay"
|
||||
id="yearlyWeekDay"
|
||||
ng-model="$parent.yearlyWeekDay"
|
||||
ng-options="w.name for w in weekdays"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
RepeatFrequencyOptions-thirdSelect"
|
||||
>
|
||||
</select>
|
||||
<select name="yearlyOtherMonth"
|
||||
id="yearlyOtherMonth"
|
||||
ng-model="$parent.yearlyOtherMonth"
|
||||
ng-options="m.name for m in months"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-thirdSelect">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-week
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerFrequency && schedulerFrequency.value == 'weekly'">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
On Days
|
||||
</label>
|
||||
<div class="input-group
|
||||
RepeatFrequencyOptions-weekButtonContainer">
|
||||
<div class="btn-group
|
||||
RepeatFrequencyOptions-weekButtonGroup"
|
||||
data-toggle="buttons-checkbox"
|
||||
id="weekdaySelect">
|
||||
<button type="button"
|
||||
ng-class="weekDaySUClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="SU"
|
||||
ng-click="$parent.setWeekday($event,'su')">
|
||||
Sun
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-class="weekDayMOClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="MO"
|
||||
ng-click="$parent.setWeekday($event,'mo')">
|
||||
Mon
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-class="weekDayTUClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="TU"
|
||||
ng-click="$parent.setWeekday($event,'tu')">
|
||||
Tue
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-class="weekDayWEClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="WE"
|
||||
ng-click="$parent.setWeekday($event,'we')">
|
||||
Wed
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-class="weekDayTHClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="TH"
|
||||
ng-click="$parent.setWeekday($event,'th')">
|
||||
Thu
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-class="weekDayFRClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="FR"
|
||||
ng-click="$parent.setWeekday($event,'fr')">
|
||||
Fri
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-class="weekDaySAClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
data-value="SA"
|
||||
ng-click="$parent.setWeekday($event,'sa')">
|
||||
Sat
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="error"
|
||||
ng-show="$parent.scheduler_weekDays_error">
|
||||
Please select one or more days.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerShowInterval">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
End
|
||||
</label>
|
||||
<div>
|
||||
<select id="schedulerEnd"
|
||||
name="schedulerEnd"
|
||||
ng-model="$parent.schedulerEnd"
|
||||
ng-options="e.name for e in endOptions"
|
||||
required
|
||||
class="MakeSelect2
|
||||
form-control input-sm"
|
||||
ng-change="schedulerEndChange()">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group
|
||||
RepeatFrequencyOptions-everyGroup
|
||||
RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerEnd && schedulerEnd.value == 'after'">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
Occurrence(s)
|
||||
</label>
|
||||
<input
|
||||
ng-name="schedulerOccurrenceCount"
|
||||
ng-id="schedulerOccurrenceCount"
|
||||
sch-spinner="scheduler_form_new"
|
||||
class="scheduler-spinner
|
||||
SpinnerInput"
|
||||
ng-model="$parent.schedulerOccurrenceCount"
|
||||
min="1" max="999"
|
||||
on-change="resetError('scheduler_occurrenceCount_error')"
|
||||
>
|
||||
<div class="error
|
||||
RepeatFrequencyOptions-error"
|
||||
ng-show="$parent.scheduler_occurrenceCount_error">
|
||||
Please provide a value between 1 and 999.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group RepeatFrequencyOptions-formGroup"
|
||||
ng-if="schedulerEnd && schedulerEnd.value == 'on'">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
End Date
|
||||
<span class="fmt-help">
|
||||
(mm/dd/yyyy)
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group Form-inputGroup">
|
||||
<input type="text"
|
||||
name="schedulerEndDt"
|
||||
id="schedulerEndDt"
|
||||
class="form-control input-sm
|
||||
Form-textInput"
|
||||
ng-model="$parent.schedulerEndDt"
|
||||
sch-date-picker
|
||||
data-min-today="true"
|
||||
placeholder="mm/dd/yyyy"
|
||||
ng-change="$parent.resetError('scheduler_endDt_error')">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default btn-sm
|
||||
Form-inputButton Form-lookupButton"
|
||||
type="button"
|
||||
ng-click="showCalendar('schedulerEndDt')"
|
||||
>
|
||||
<i class="fa fa-calendar"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="error"
|
||||
ng-show="$parent.scheduler_endDt_error">
|
||||
Please provide a valid date.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="RepeatFrequencyOptions-subFormBorderFixer"
|
||||
ng-show="schedulerFrequency.value && schedulerFrequency.value !== 'none'">
|
||||
</div>
|
||||
<!-- start management job fields -->
|
||||
<div class="factDetailsNote" ng-if="isFactCleanup">
|
||||
<span class="factDetailsHeader">Note:</span> For facts collected older than the time period specified, save one fact scan (snapshot) per time window (frequency). For example, facts older than 30 days are purged, while one weekly fact scan is kept.
|
||||
Caution: Setting both numerical variables to "0" will delete all facts.</div>
|
||||
|
||||
<div class="form-group" ng-if="cleanupJob && !isFactCleanup">
|
||||
<label class="Form-inputLabel"><span class="red-text">*</span> Days of data to keep</label>
|
||||
<input type="number" class="form-control input-sm" name="schedulerPurgeDays" id="schedulerPurgeDays" min="1" ng-model="schedulerPurgeDays" required placeholder="Days of data to keep">
|
||||
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$dirty && scheduler_form.schedulerPurgeDays.$error.required">A value is required.</div>
|
||||
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$error.number">This is not a valid number.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group cleanupStretcher factDaysToKeepCompacter" ng-if="isFactCleanup">
|
||||
<div class="col-md-12">
|
||||
<label class="Form-inputLabel"><span class="red-text">*</span> Select a time period after which to remove old facts</label>
|
||||
</div>
|
||||
<div class="col-md-6 inputSpacer inputCompactMobile">
|
||||
<input type="number" id="keep_amount" name="keep_amount" ng-model="keep_amount" ng-required="true" class="form-control input-sm" aw-min=0 aw-max=9999 integer></input>
|
||||
<div class="error" ng-show="scheduler_form.keep_amount.$dirty && scheduler_form.keep_amount.$error.required">Please enter the number of days you would like to keep this data.</div>
|
||||
<div class="error survey_error" ng-show="scheduler_form.keep_amount.$error.number || scheduler_form.keep_amount.$error.integer" >Please enter a valid number.</div>
|
||||
<div class="error survey_error" ng-show="scheduler_form.keep_amount.$error.awMin">Please enter a non-negative number.</div>
|
||||
<div class="error survey_error" ng-show="scheduler_form.keep_amount.$error.awMax">Please enter a number smaller than 9999.</div>
|
||||
</div>
|
||||
<div class="col-md-6 inputSpacer">
|
||||
<select id="keep_unit" name="keep_unit" ng-model="keep_unit" ng-options="type.label for type in keep_unit_choices track by type.value" ng-required="true" class="form-control input-sm"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group cleanupStretcher" ng-if="isFactCleanup">
|
||||
<div class="col-md-12">
|
||||
<label class="Form-inputLabel"><span class="red-text">*</span> Select a frequency for snapshot retention</label>
|
||||
</div>
|
||||
<div class="col-md-6 inputSpacer inputCompactMobile">
|
||||
<input type="number" class="form-control input-sm" id="granularity_keep_amount" name="granularity_keep_amount" ng-model="granularity_keep_amount" ng-required="true" aw-min=0 aw-max=9999 >
|
||||
<div class="error" ng-show="scheduler_form.granularity_keep_amount.$dirty && scheduler_form.granularity_keep_amount.$error.required">Please enter the number of days you would like to keep this data.</div>
|
||||
<div class="error survey_error" ng-show="scheduler_form.granularity_keep_amount.$error.number || scheduler_form.granularity_keep_amount.$error.integer" >Please enter a valid number.</div>
|
||||
<div class="error survey_error" ng-show="scheduler_form.granularity_keep_amount.$error.awMin">Please enter a non-negative number.</div>
|
||||
<div class="error survey_error" ng-show="scheduler_form.granularity_keep_amount.$error.awMax">Please enter a number smaller than 9999.</div>
|
||||
</div>
|
||||
<div class="col-md-6 inputSpacer">
|
||||
<select id="granularity_keep_unit" name="granularity_keep_unit" ng-model="granularity_keep_unit" ng-options="type.label for type in granularity_keep_unit_choices track by type.value" ng-required="true" class="form-control input-sm"></select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end management job fields -->
|
||||
</form>
|
||||
<div class="SchedulerFormDetail-container
|
||||
SchedulerFormDetail-container--error"
|
||||
ng-show="!schedulerIsValid && scheduler_form_new.$dirty">
|
||||
<p class="SchedulerFormDetail-errorText">
|
||||
The scheduler options are invalid or incomplete.
|
||||
</p>
|
||||
</div>
|
||||
<div class="SchedulerFormDetail-container"
|
||||
ng-show="schedulerIsValid">
|
||||
<label class="SchedulerFormDetail-label">
|
||||
Description
|
||||
</label>
|
||||
<div class="SchedulerFormDetail-nlp">
|
||||
{{ rrule_nlp_description }}
|
||||
</div>
|
||||
<div class="SchedulerFormDetail-occurrenceHeader">
|
||||
<label class="SchedulerFormDetail-label
|
||||
SchedulerFormDetail-labelOccurrence">
|
||||
Occurrences
|
||||
<span
|
||||
class="SchedulerFormDetail-labelDetail">
|
||||
(Limited to first 10)
|
||||
</span>
|
||||
</label>
|
||||
<div id="date-choice"
|
||||
class="SchedulerFormDetail-dateFormats">
|
||||
<label
|
||||
class="SchedulerFormDetail-dateFormatsLabel">
|
||||
Date format
|
||||
</label>
|
||||
<label class="radio-inline
|
||||
SchedulerFormDetail-radioLabel">
|
||||
<input type="radio"
|
||||
class="SchedulerFormDetail-radioButton"
|
||||
ng-model="dateChoice"
|
||||
id="date-choice-local"
|
||||
value="local" >
|
||||
Local time
|
||||
</label>
|
||||
<label class="radio-inline
|
||||
SchedulerFormDetail-radioLabel">
|
||||
<input type="radio"
|
||||
class="SchedulerFormDetail-radioButton"
|
||||
ng-model="dateChoice"
|
||||
id="date-choice-utc"
|
||||
value="utc" >
|
||||
UTC
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="occurrence-list mono-space
|
||||
SchedulerFormDetail-occurrenceList"
|
||||
ng-show="dateChoice == 'utc'">
|
||||
<li ng-repeat="occurrence in occurrence_list">
|
||||
{{ occurrence.utc }}
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="occurrence-list mono-space
|
||||
SchedulerFormDetail-occurrenceList"
|
||||
ng-show="dateChoice == 'local'">
|
||||
<li ng-repeat="occurrence in occurrence_list">
|
||||
{{ occurrence.local }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="buttons Form-buttons">
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-saveButton"
|
||||
id="project_save_btn"
|
||||
ng-click="saveSchedule()"
|
||||
ng-disabled="!schedulerIsValid"> Save</button>
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-cancelButton"
|
||||
id="project_cancel_btn"
|
||||
ng-click="formCancel()">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,9 +21,13 @@ export default [
|
||||
ClearScope();
|
||||
|
||||
var base, e, id, url, parentObject;
|
||||
|
||||
base = $location.path().replace(/^\//, '').split('/')[0];
|
||||
|
||||
if (base == 'management_jobs') {
|
||||
$scope.base = base = 'system_job_templates';
|
||||
}
|
||||
if ($stateParams.job_type){
|
||||
$scope.job_type = $stateParams.job_type;
|
||||
}
|
||||
if ($scope.removePostRefresh) {
|
||||
$scope.removePostRefresh();
|
||||
}
|
||||
|
||||
@ -47,7 +47,8 @@ export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$s
|
||||
|
||||
AddSchedule({
|
||||
scope: $scope,
|
||||
callback: 'SchedulesRefresh'
|
||||
callback: 'SchedulesRefresh',
|
||||
base: $scope.base ? $scope.base : null
|
||||
});
|
||||
|
||||
var callSelect2 = function() {
|
||||
|
||||
@ -51,7 +51,8 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$
|
||||
EditSchedule({
|
||||
scope: $scope,
|
||||
id: parseInt($stateParams.schedule_id),
|
||||
callback: 'SchedulesRefresh'
|
||||
callback: 'SchedulesRefresh',
|
||||
base: $scope.base ? $scope.base: null
|
||||
});
|
||||
|
||||
var callSelect2 = function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user