mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
Inventory hosts now appear in All Hosts folder. User not allowed to add hosts outside of a group (i.e. cannot add to All Hosts group). Fixed job template so that a credential can be removed.
This commit is contained in:
@@ -28,7 +28,7 @@ angular.module('LookUpHelper', [ 'RestServices', 'Utilities', 'SearchHelper', 'P
|
||||
var postAction = params.postAction //action to perform post user selection
|
||||
|
||||
|
||||
// Show pop-up to select user
|
||||
// Show pop-up
|
||||
var name = list.iterator.charAt(0).toUpperCase() + list.iterator.substring(1);
|
||||
var defaultUrl = (list.name == 'inventories') ? GetBasePath('inventory') : GetBasePath(list.name);
|
||||
var hdr = (params.hdr) ? params.hdr : 'Select ' + name;
|
||||
|
||||
@@ -149,14 +149,14 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
});
|
||||
});
|
||||
|
||||
// Load inventory top-level hosts
|
||||
// Load inventory all hosts
|
||||
Rest.setUrl(hosts + '?order_by=name');
|
||||
Rest.get()
|
||||
.success ( function(data, status, headers, config) {
|
||||
treeData = [];
|
||||
treeData.push({
|
||||
data: {
|
||||
title: inventory_name,
|
||||
title: inventory_name
|
||||
},
|
||||
attr: {
|
||||
type: 'inventory',
|
||||
@@ -168,8 +168,22 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
state: 'open',
|
||||
children:[]
|
||||
});
|
||||
//treeData[0].children.push({
|
||||
var all_hosts_node = {
|
||||
data: {
|
||||
title: 'All Hosts'
|
||||
},
|
||||
attr: {
|
||||
type: 'all-hosts-group',
|
||||
id: 'all-hosts-group',
|
||||
url: hosts + '?order_by=name',
|
||||
name: 'All Hosts'
|
||||
},
|
||||
state: 'closed',
|
||||
children: []
|
||||
};
|
||||
for (var i=0; i < data.results.length; i++ ) {
|
||||
treeData[0].children.push({
|
||||
all_hosts_node.children.push({
|
||||
data: {
|
||||
title: data.results[i].name,
|
||||
icon: '/'
|
||||
@@ -186,6 +200,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
},
|
||||
});
|
||||
}
|
||||
treeData[0].children.push(all_hosts_node);
|
||||
scope.$emit('hostsLoaded');
|
||||
})
|
||||
.error ( function(data, status, headers, config) {
|
||||
|
||||
Reference in New Issue
Block a user