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:
chouseknecht
2013-05-21 11:27:59 -04:00
parent 06239b4c04
commit f5c487aab8
6 changed files with 61 additions and 34 deletions

View File

@@ -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;

View File

@@ -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) {