mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
added scan jobs list to inventory properties
added the scan jobs list in an accordion underneath the inventory properties.
This commit is contained in:
@@ -92,6 +92,7 @@ var tower = angular.module('Tower', [
|
|||||||
'InventoryHostsDefinition',
|
'InventoryHostsDefinition',
|
||||||
'HostsHelper',
|
'HostsHelper',
|
||||||
'AWFilters',
|
'AWFilters',
|
||||||
|
'ScanJobsListDefinition',
|
||||||
'HostFormDefinition',
|
'HostFormDefinition',
|
||||||
'HostListDefinition',
|
'HostListDefinition',
|
||||||
'GroupFormDefinition',
|
'GroupFormDefinition',
|
||||||
@@ -261,6 +262,11 @@ var tower = angular.module('Tower', [
|
|||||||
controller: InventoriesEdit
|
controller: InventoriesEdit
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
when('/inventories/:inventory_id/job_templates/add', {
|
||||||
|
templateUrl: urlPrefix + 'partials/job_templates.html',
|
||||||
|
controller: JobTemplatesAdd
|
||||||
|
}).
|
||||||
|
|
||||||
when('/inventories/:inventory_id/manage', {
|
when('/inventories/:inventory_id/manage', {
|
||||||
templateUrl: urlPrefix + 'partials/inventory-manage.html',
|
templateUrl: urlPrefix + 'partials/inventory-manage.html',
|
||||||
controller: InventoriesManage
|
controller: InventoriesManage
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
export function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, Rest, Alert, InventoryList, GenerateList,
|
export function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, Rest, Alert, InventoryList, generateList,
|
||||||
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream,
|
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream,
|
||||||
EditInventoryProperties, Find, Empty, LogViewer) {
|
EditInventoryProperties, Find, Empty, LogViewer) {
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ export function InventoriesList($scope, $rootScope, $location, $log, $routeParam
|
|||||||
|
|
||||||
var list = InventoryList,
|
var list = InventoryList,
|
||||||
defaultUrl = GetBasePath('inventory'),
|
defaultUrl = GetBasePath('inventory'),
|
||||||
view = GenerateList,
|
view = generateList,
|
||||||
paths = $location.path().replace(/^\//, '').split('/'),
|
paths = $location.path().replace(/^\//, '').split('/'),
|
||||||
mode = (paths[0] === 'inventories') ? 'edit' : 'select';
|
mode = (paths[0] === 'inventories') ? 'edit' : 'select';
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeP
|
|||||||
|
|
||||||
|
|
||||||
export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
||||||
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, OrganizationList, SearchInit, PaginateInit,
|
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit,
|
||||||
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) {
|
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
@@ -481,14 +481,16 @@ InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log
|
|||||||
];
|
];
|
||||||
|
|
||||||
export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
||||||
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, OrganizationList, SearchInit, PaginateInit,
|
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit,
|
||||||
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream) {
|
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, ScanJobsList) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
var defaultUrl = GetBasePath('inventory'),
|
var defaultUrl = GetBasePath('inventory'),
|
||||||
form = InventoryForm,
|
form = InventoryForm(),
|
||||||
|
list = ScanJobsList,
|
||||||
|
view = generateList,
|
||||||
generator = GenerateForm,
|
generator = GenerateForm,
|
||||||
inventory_id = $routeParams.inventory_id,
|
inventory_id = $routeParams.inventory_id,
|
||||||
master = {},
|
master = {},
|
||||||
@@ -498,27 +500,11 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $
|
|||||||
form.formLabelSize = null;
|
form.formLabelSize = null;
|
||||||
form.formFieldSize = null;
|
form.formFieldSize = null;
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: false, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
|
// view.inject(list, { scope: $scope, id: 'scan-jobs-list' });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|
||||||
// $scope.parseType = 'yaml';
|
|
||||||
// ParseTypeChange({
|
|
||||||
// scope: $scope,
|
|
||||||
// variable: 'variables',
|
|
||||||
// parse_variable: 'parseType',
|
|
||||||
// field_id: 'inventory_variables'
|
|
||||||
// });
|
|
||||||
|
|
||||||
// LookUpInit({
|
|
||||||
// scope: $scope,
|
|
||||||
// form: form,
|
|
||||||
// current_item: ($routeParams.organization_id) ? $routeParams.organization_id : null,
|
|
||||||
// list: OrganizationList,
|
|
||||||
// field: 'organization',
|
|
||||||
// input_type: 'radio'
|
|
||||||
// });
|
|
||||||
Wait('start');
|
Wait('start');
|
||||||
Rest.setUrl(GetBasePath('inventory') + inventory_id + '/');
|
Rest.setUrl(GetBasePath('inventory') + inventory_id + '/');
|
||||||
Rest.get()
|
Rest.get()
|
||||||
@@ -639,16 +625,20 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $
|
|||||||
field_id: 'inventory_variables'
|
field_id: 'inventory_variables'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.addScanJob = function(){
|
||||||
|
$location.path($location.path()+'/job_templates/add');
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
||||||
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList', 'OrganizationList', 'SearchInit',
|
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit',
|
||||||
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream'
|
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'ScanJobsList'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function InventoriesManage ($log, $scope, $location, $routeParams, $compile, GenerateList, ClearScope, Empty, Wait, Rest, Alert, LoadBreadCrumbs, GetBasePath, ProcessErrors,
|
export function InventoriesManage ($log, $scope, $location, $routeParams, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert, LoadBreadCrumbs, GetBasePath, ProcessErrors,
|
||||||
Breadcrumbs, InventoryGroups, InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg, GetHostsStatusMsg, GroupsEdit, InventoryUpdate,
|
Breadcrumbs, InventoryGroups, InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg, GetHostsStatusMsg, GroupsEdit, InventoryUpdate,
|
||||||
GroupsCancelUpdate, ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary,
|
GroupsCancelUpdate, ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary,
|
||||||
InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize, GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight,
|
InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize, GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight,
|
||||||
@@ -740,7 +730,7 @@ export function InventoriesManage ($log, $scope, $location, $routeParams, $compi
|
|||||||
$compile(e)($scope);
|
$compile(e)($scope);
|
||||||
|
|
||||||
// Add groups view
|
// Add groups view
|
||||||
GenerateList.inject(InventoryGroups, {
|
generateList.inject(InventoryGroups, {
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
id: 'group-list-container',
|
id: 'group-list-container',
|
||||||
breadCrumbs: false,
|
breadCrumbs: false,
|
||||||
@@ -1191,7 +1181,7 @@ export function InventoriesManage ($log, $scope, $location, $routeParams, $compi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
InventoriesManage.$inject = ['$log', '$scope', '$location', '$routeParams', '$compile', 'GenerateList', 'ClearScope', 'Empty', 'Wait', 'Rest', 'Alert', 'LoadBreadCrumbs',
|
InventoriesManage.$inject = ['$log', '$scope', '$location', '$routeParams', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait', 'Rest', 'Alert', 'LoadBreadCrumbs',
|
||||||
'GetBasePath', 'ProcessErrors', 'Breadcrumbs', 'InventoryGroups', 'InjectHosts', 'Find', 'HostsReload', 'SearchInit', 'PaginateInit', 'GetSyncStatusMsg',
|
'GetBasePath', 'ProcessErrors', 'Breadcrumbs', 'InventoryGroups', 'InjectHosts', 'Find', 'HostsReload', 'SearchInit', 'PaginateInit', 'GetSyncStatusMsg',
|
||||||
'GetHostsStatusMsg', 'GroupsEdit', 'InventoryUpdate', 'GroupsCancelUpdate', 'ViewUpdateStatus', 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
'GetHostsStatusMsg', 'GroupsEdit', 'InventoryUpdate', 'GroupsCancelUpdate', 'ViewUpdateStatus', 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete',
|
||||||
'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary', 'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', 'WatchInventoryWindowResize',
|
'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary', 'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', 'WatchInventoryWindowResize',
|
||||||
|
|||||||
@@ -13,13 +13,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('InventoryFormDefinition', [])
|
angular.module('InventoryFormDefinition', ['ScanJobsListDefinition'])
|
||||||
.value('InventoryForm', {
|
.value('InventoryFormObject', {
|
||||||
|
|
||||||
addTitle: 'Create Inventory',
|
addTitle: 'Create Inventory',
|
||||||
editTitle: '{{ inventory_name }}',
|
editTitle: '{{ inventory_name }}',
|
||||||
name: 'inventory',
|
name: 'inventory',
|
||||||
well: true,
|
well: true,
|
||||||
|
collapse: true,
|
||||||
|
collapseTitle: "Properties",
|
||||||
|
collapseMode: 'edit',
|
||||||
|
collapseOpen: true,
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
stream: {
|
stream: {
|
||||||
@@ -93,7 +97,75 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
related: {
|
related: {
|
||||||
|
scan_jobs: {
|
||||||
|
type: 'collection',
|
||||||
|
title: 'Scan Jobs',
|
||||||
|
iterator: 'scan_job',
|
||||||
|
index: false,
|
||||||
|
open: false,
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
add: {
|
||||||
|
ngClick: "addScanJob(inventory_id)",
|
||||||
|
icon: 'icon-plus',
|
||||||
|
label: 'Add',
|
||||||
|
awToolTip: 'Add a scan job'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
fields: {
|
||||||
|
name: {
|
||||||
|
key: true,
|
||||||
|
label: 'Name'
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
label: 'Description'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
fieldActions: {
|
||||||
|
edit: {
|
||||||
|
label: 'Edit',
|
||||||
|
ngClick: "edit('organizations', organization.id, organization.name)",
|
||||||
|
icon: 'icon-edit',
|
||||||
|
awToolTip: 'Edit the organization',
|
||||||
|
'class': 'btn btn-default'
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
label: 'Delete',
|
||||||
|
ngClick: "delete('organizations', organization.id, organization.name, 'organizations')",
|
||||||
|
icon: 'icon-trash',
|
||||||
|
"class": 'btn-danger',
|
||||||
|
awToolTip: 'Delete the organization'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
relatedSets: function(urls) {
|
||||||
|
return {
|
||||||
|
scan_jobs: {
|
||||||
|
iterator: 'scan_job',
|
||||||
|
url: urls.organizations
|
||||||
|
},
|
||||||
|
// schedules: {
|
||||||
|
// iterator: 'schedule',
|
||||||
|
// url: urls.schedules
|
||||||
|
// }
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
})
|
||||||
|
.factory('InventoryForm', ['InventoryFormObject', 'ScanJobsList',
|
||||||
|
function(InventoryFormObject, ScanJobsList) {
|
||||||
|
return function() {
|
||||||
|
var itm;
|
||||||
|
for (itm in InventoryFormObject.related) {
|
||||||
|
if (InventoryFormObject.related[itm].include === "ScanJobsList") {
|
||||||
|
InventoryFormObject.related[itm] = ScanJobsList;
|
||||||
|
InventoryFormObject.related[itm].generateList = true; // tell form generator to call list generator and inject a list
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return InventoryFormObject;
|
||||||
|
};
|
||||||
|
}]);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import PortalJobs from "tower/lists/PortalJobs";
|
|||||||
import Projects from "tower/lists/Projects";
|
import Projects from "tower/lists/Projects";
|
||||||
import QueuedJobs from "tower/lists/QueuedJobs";
|
import QueuedJobs from "tower/lists/QueuedJobs";
|
||||||
import RunningJobs from "tower/lists/RunningJobs";
|
import RunningJobs from "tower/lists/RunningJobs";
|
||||||
|
import ScanJobsList from "tower/lists/ScanJobs";
|
||||||
import ScheduledJobs from "tower/lists/ScheduledJobs";
|
import ScheduledJobs from "tower/lists/ScheduledJobs";
|
||||||
import Schedules from "tower/lists/Schedules";
|
import Schedules from "tower/lists/Schedules";
|
||||||
import Streams from "tower/lists/Streams";
|
import Streams from "tower/lists/Streams";
|
||||||
@@ -53,6 +54,7 @@ export
|
|||||||
Projects,
|
Projects,
|
||||||
QueuedJobs,
|
QueuedJobs,
|
||||||
RunningJobs,
|
RunningJobs,
|
||||||
|
ScanJobsList,
|
||||||
ScheduledJobs,
|
ScheduledJobs,
|
||||||
Schedules,
|
Schedules,
|
||||||
Streams,
|
Streams,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<div class="tab-pane" id="inventories">
|
<div class="tab-pane" id="inventories">
|
||||||
<div ng-cloak id="htmlTemplate"></div>
|
<div ng-cloak id="htmlTemplate"></div>
|
||||||
<div id="inventory-edit-modal-dialog"></div>
|
<div id="inventory-edit-modal-dialog"></div>
|
||||||
|
<div id="scan-jobs-list" style="padding-top:40px"></div>
|
||||||
<div ng-include="'/static/partials/logviewer.html'"></div>
|
<div ng-include="'/static/partials/logviewer.html'"></div>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user