mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
This commit is contained in:
@@ -177,8 +177,7 @@ export default
|
|||||||
base = params.base || $location.path().replace(/^\//, '').split('/')[0],
|
base = params.base || $location.path().replace(/^\//, '').split('/')[0],
|
||||||
url = params.url || null,
|
url = params.url || null,
|
||||||
scheduler;
|
scheduler;
|
||||||
|
if (!Empty($stateParams.id) && base !== 'system_job_templates' && base !== 'inventories' && !url) {
|
||||||
if (!Empty($stateParams.id) && base !== 'system_job_templates' && base !== 'inventories') {
|
|
||||||
url = GetBasePath(base) + $stateParams.id + '/schedules/';
|
url = GetBasePath(base) + $stateParams.id + '/schedules/';
|
||||||
}
|
}
|
||||||
else if(base === "inventories"){
|
else if(base === "inventories"){
|
||||||
|
|||||||
@@ -22,25 +22,56 @@ export default
|
|||||||
|
|
||||||
// job templates
|
// job templates
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
|
searchPrefix: 'schedule',
|
||||||
name: 'jobTemplateSchedules',
|
name: 'jobTemplateSchedules',
|
||||||
route: '/templates/job_template/:id/schedules',
|
route: '/templates/job_template/:id/schedules',
|
||||||
templateUrl: templateUrl("scheduler/scheduler"),
|
|
||||||
controller: 'schedulerListController',
|
|
||||||
data: {
|
data: {
|
||||||
activityStream: true,
|
activityStream: true,
|
||||||
activityStreamTarget: 'job_template',
|
activityStreamTarget: 'job_template',
|
||||||
activityStreamId: 'id'
|
activityStreamId: 'id'
|
||||||
},
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'templates.editJobTemplate',
|
parent: 'templates.editJobTemplate({job_template_id: parentObject.id})',
|
||||||
label: 'SCHEDULES'
|
label: 'SCHEDULES'
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
Dataset: ['SchedulesList', 'QuerySet', '$stateParams', 'GetBasePath',
|
||||||
|
function(list, qs, $stateParams, GetBasePath) {
|
||||||
|
let path = `${GetBasePath('job_templates')}${$stateParams.id}/schedules`;
|
||||||
|
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
||||||
|
}
|
||||||
|
],
|
||||||
|
ParentObject: ['$stateParams', 'Rest', 'GetBasePath', function($stateParams, Rest, GetBasePath){
|
||||||
|
let path = `${GetBasePath('job_templates')}${$stateParams.id}`;
|
||||||
|
Rest.setUrl(path);
|
||||||
|
return Rest.get(path).then((res) => res.data);
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
views: {
|
||||||
|
'@': {
|
||||||
|
templateProvider: function(SchedulesList, generateList, ParentObject){
|
||||||
|
// include name of parent resource in listTitle
|
||||||
|
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
|
||||||
|
let html = generateList.build({
|
||||||
|
list: SchedulesList,
|
||||||
|
mode: 'edit'
|
||||||
|
});
|
||||||
|
html = generateList.wrapPanel(html);
|
||||||
|
return generateList.insertFormView() + html;
|
||||||
|
},
|
||||||
|
controller: 'schedulerListController'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
name: 'jobTemplateSchedules.add',
|
name: 'jobTemplateSchedules.add',
|
||||||
route: '/add',
|
route: '/add',
|
||||||
templateUrl: templateUrl("scheduler/schedulerForm"),
|
views: {
|
||||||
controller: 'schedulerAddController',
|
'form': {
|
||||||
|
controller: 'schedulerAddController',
|
||||||
|
templateUrl: templateUrl("scheduler/schedulerForm"),
|
||||||
|
}
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'jobTemplateSchedules',
|
parent: 'jobTemplateSchedules',
|
||||||
label: 'CREATE SCHEDULE'
|
label: 'CREATE SCHEDULE'
|
||||||
@@ -49,8 +80,12 @@ export default
|
|||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
name: 'jobTemplateSchedules.edit',
|
name: 'jobTemplateSchedules.edit',
|
||||||
route: '/:schedule_id',
|
route: '/:schedule_id',
|
||||||
templateUrl: templateUrl("scheduler/schedulerForm"),
|
views: {
|
||||||
controller: 'schedulerEditController',
|
'form': {
|
||||||
|
controller: 'schedulerEditController',
|
||||||
|
templateUrl: templateUrl("scheduler/schedulerForm"),
|
||||||
|
}
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'jobTemplateSchedules',
|
parent: 'jobTemplateSchedules',
|
||||||
label: '{{schedule_obj.name}}'
|
label: '{{schedule_obj.name}}'
|
||||||
@@ -59,6 +94,7 @@ export default
|
|||||||
|
|
||||||
// workflows
|
// workflows
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
|
searchPrefix: 'schedule',
|
||||||
name: 'workflowJobTemplateSchedules',
|
name: 'workflowJobTemplateSchedules',
|
||||||
route: '/templates/workflow_job_template/:id/schedules',
|
route: '/templates/workflow_job_template/:id/schedules',
|
||||||
templateUrl: templateUrl("scheduler/scheduler"),
|
templateUrl: templateUrl("scheduler/scheduler"),
|
||||||
@@ -69,15 +105,47 @@ export default
|
|||||||
activityStreamId: 'id'
|
activityStreamId: 'id'
|
||||||
},
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'templates.editWorkflowJobTemplate',
|
parent: 'templates.editWorkflowJobTemplate({workflow_job_template_id: parentObject.id})',
|
||||||
label: 'SCHEDULES'
|
label: 'SCHEDULES'
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
Dataset: ['SchedulesList', 'QuerySet', '$stateParams', 'GetBasePath',
|
||||||
|
function(list, qs, $stateParams, GetBasePath) {
|
||||||
|
let path = `${GetBasePath('workflow_job_templates')}${$stateParams.id}/schedules`;
|
||||||
|
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
||||||
|
}
|
||||||
|
],
|
||||||
|
ParentObject: ['$stateParams', 'Rest', 'GetBasePath', function($stateParams, Rest, GetBasePath){
|
||||||
|
let path = `${GetBasePath('workflow_job_templates')}${$stateParams.id}`;
|
||||||
|
Rest.setUrl(path);
|
||||||
|
return Rest.get(path).then((res) => res.data);
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
views: {
|
||||||
|
'@': {
|
||||||
|
templateProvider: function(SchedulesList, generateList, ParentObject){
|
||||||
|
// include name of parent resource in listTitle
|
||||||
|
SchedulesList.listTitle = `${ParentObject.name}<div class='List-titleLockup'></div>Schedules`;
|
||||||
|
let html = generateList.build({
|
||||||
|
list: SchedulesList,
|
||||||
|
mode: 'edit'
|
||||||
|
});
|
||||||
|
html = generateList.wrapPanel(html);
|
||||||
|
return generateList.insertFormView() + html;
|
||||||
|
},
|
||||||
|
controller: 'schedulerListController'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
name: 'workflowJobTemplateSchedules.add',
|
name: 'workflowJobTemplateSchedules.add',
|
||||||
route: '/add',
|
route: '/add',
|
||||||
templateUrl: templateUrl("scheduler/schedulerForm"),
|
views: {
|
||||||
controller: 'schedulerAddController',
|
'form': {
|
||||||
|
controller: 'schedulerAddController',
|
||||||
|
templateUrl: templateUrl("scheduler/schedulerForm"),
|
||||||
|
}
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'workflowJobTemplateSchedules',
|
parent: 'workflowJobTemplateSchedules',
|
||||||
label: 'CREATE SCHEDULE'
|
label: 'CREATE SCHEDULE'
|
||||||
@@ -86,8 +154,12 @@ export default
|
|||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
name: 'workflowJobTemplateSchedules.edit',
|
name: 'workflowJobTemplateSchedules.edit',
|
||||||
route: '/:schedule_id',
|
route: '/:schedule_id',
|
||||||
templateUrl: templateUrl("scheduler/schedulerForm"),
|
views: {
|
||||||
controller: 'schedulerEditController',
|
'form': {
|
||||||
|
controller: 'schedulerEditController',
|
||||||
|
templateUrl: templateUrl("scheduler/schedulerForm"),
|
||||||
|
}
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'workflowJobTemplateSchedules',
|
parent: 'workflowJobTemplateSchedules',
|
||||||
label: '{{schedule_obj.name}}'
|
label: '{{schedule_obj.name}}'
|
||||||
@@ -95,7 +167,7 @@ export default
|
|||||||
});
|
});
|
||||||
// projects
|
// projects
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
searchPrefix: 'schedule',
|
searchPrefix: 'schedule',
|
||||||
name: 'projectSchedules',
|
name: 'projectSchedules',
|
||||||
route: '/projects/:id/schedules',
|
route: '/projects/:id/schedules',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Reference in New Issue
Block a user