mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
AC-331 Delete one or many hosts now working.
This commit is contained in:
@@ -205,7 +205,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
scope['inventory_id'] = id;
|
||||
scope['inventoryFailureFilter'] = false;
|
||||
|
||||
// Retrieve each related set and any lookups
|
||||
// Retrieve each related sets and any lookups
|
||||
if (scope.inventoryLoadedRemove) {
|
||||
scope.inventoryLoadedRemove();
|
||||
}
|
||||
@@ -217,6 +217,17 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
}
|
||||
});
|
||||
|
||||
// Add the selected flag to the hosts set.
|
||||
if (scope.relatedHostsRemove) {
|
||||
scope.relatedHostsRemove();
|
||||
}
|
||||
scope.relatedHostsRemove = scope.$on('relatedhosts', function() {
|
||||
scope.toggleAllFlag = false;
|
||||
for (var i=0; i < scope.hosts.length; i++) {
|
||||
scope.hosts[i].selected = 0;
|
||||
}
|
||||
});
|
||||
|
||||
LoadInventory({ scope: scope, doPostSteps: true });
|
||||
$('#inventory-tabs a[href="#inventory-hosts"]').on('show.bs.tab', function() {
|
||||
scope['hosts'] = null;
|
||||
@@ -460,6 +471,24 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
{ hdr: 'Error!', msg: 'Failed to lookup last job: ' + last_job + '. GET status: ' + status });
|
||||
});
|
||||
}
|
||||
|
||||
scope.toggleAllHosts = function() {
|
||||
scope.hostDeleteHide = (scope.toggleAllFlag) ? false : true;
|
||||
for (var i=0; i < scope.hosts.length; i++) {
|
||||
scope.hosts[i].selected = scope.toggleAllFlag;
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggleOneHost = function() {
|
||||
var result = true;
|
||||
for (var i=0; i < scope.hosts.length; i++) {
|
||||
if (scope.hosts[i].selected) {
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
scope.hostDeleteHide = result;
|
||||
}
|
||||
|
||||
// Respond to the scope.$emit from awTree directive
|
||||
scope.$on('refreshHost', function(e, group, title) {
|
||||
|
||||
Reference in New Issue
Block a user