got add hosts button to work at root level of inventory

This commit is contained in:
John Mitchell 2015-04-14 16:46:24 -04:00
parent 3416776402
commit 7f5c5396a3
2 changed files with 7 additions and 2 deletions

View File

@ -607,8 +607,14 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name,
});
}
else {
if (selected_group_id) {
// adding hosts to a group
url = GetBasePath('groups') + selected_group_id + '/';
} else {
// adding hosts to the top-level (inventory)
url = GetBasePath('inventory') + inventory_id + '/';
}
// Add mode
url = GetBasePath('groups') + selected_group_id + '/';
Rest.setUrl(url);
Rest.get()
.success( function(data) {

View File

@ -90,7 +90,6 @@ export default
create: {
mode: 'all',
ngClick: "createHost()",
ngHide: '!selected_group_id', //disable when 'All Hosts' selected
awToolTip: "Create a new host"
},
refresh: {