diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index 9434cececc..e0b2534686 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -482,15 +482,13 @@ InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit, - LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, ScanJobsList) { + LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream) { ClearScope(); // Inject dynamic view var defaultUrl = GetBasePath('inventory'), form = InventoryForm(), - list = ScanJobsList, - view = generateList, generator = GenerateForm, inventory_id = $routeParams.inventory_id, master = {}, @@ -501,7 +499,7 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $ form.formFieldSize = null; generator.inject(form, { mode: 'edit', related: true, scope: $scope }); - // view.inject(list, { scope: $scope, id: 'scan-jobs-list' }); + generator.reset(); LoadBreadCrumbs(); @@ -627,13 +625,13 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $ }; $scope.addScanJob = function(){ - $location.path($location.path()+'/job_templates/add'); + $location.path($location.path()+'/job_templates/add'); }; } InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit', - 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'ScanJobsList' + 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream' ]; diff --git a/awx/ui/static/js/lists/ScanJobs.js b/awx/ui/static/js/lists/ScanJobs.js new file mode 100644 index 0000000000..c13b864f4f --- /dev/null +++ b/awx/ui/static/js/lists/ScanJobs.js @@ -0,0 +1,94 @@ +/********************************************* + * Copyright (c) 2014 AnsibleWorks, Inc. + * + * Jobs.js + * List view object for job data model. + * + * Used on dashboard to provide a list of all jobs, regardless of + * status. + * + */ + + + +export default + angular.module('ScanJobsListDefinition', []) + .value( 'ScanJobsList', { + + name: 'scan_jobs', + iterator: 'scan_job', + editTitle: 'Scan Jobs', + 'class': 'table-condensed', + index: false, + hover: true, + well: false, + + fields: { + name: { + key: true, + label: 'Name', + // columnClass: 'col-lg-5 col-md-5 col-sm-9 col-xs-8' + }, + description: { + label: 'Description', + // columnClass: 'col-lg-4 col-md-3 hidden-sm hidden-xs' + } + }, + + actions: { + add: { + mode: 'all', // One of: edit, select, all + ngClick: 'addScanJobTemplate()', + basePaths: ['job_templates'], + awToolTip: 'Create a new template', + ngHide: 'portalMode===true' + }, + stream: { + ngClick: "showActivity()", + awToolTip: "View Activity Stream", + icon: "icon-comments-alt", + mode: 'edit', + ngHide: 'portalMode===true' + } + }, + + fieldActions: { + submit: { + label: 'Launch', + mode: 'all', + ngClick: 'submitJob(job_template.id)', + awToolTip: 'Start a job using this template', + dataPlacement: 'top' + }, + schedule: { + label: 'Schedule', + mode: 'all', + ngHref: '#/job_templates/{{ job_template.id }}/schedules', + awToolTip: 'Schedule future job template runs', + dataPlacement: 'top', + }, + edit: { + label: 'Edit', + ngClick: "editJobTemplate(job_template.id)", + awToolTip: 'Edit template', + "class": 'btn-default btn-xs', + dataPlacement: 'top', + }, + "delete": { + label: 'Delete', + ngClick: "deleteJobTemplate(job_template.id, job_template.name)", + "class": 'btn-danger btn-xs', + awToolTip: 'Delete template', + dataPlacement: 'top', + }, + copy: { + label: 'Copy', + ngClick: "copyJobTemplate(job_template.id, job_template.name)", + "class": 'btn-danger btn-xs', + awToolTip: 'Copy template', + dataPlacement: 'top', + ngHide: 'job_template.summary_fields.can_copy===false' + + } + } + });