mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Hook up system tracking from the host list
This commit is contained in:
parent
ad494bbb40
commit
a9ea639d9b
@ -61,6 +61,24 @@ export default ['$scope', 'RelatedHostsListDefinition', '$rootScope', 'GetBasePa
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on('selectedOrDeselected', function(e, value) {
|
||||
let item = value.value;
|
||||
|
||||
if (value.isSelected) {
|
||||
if(!$scope.hostsSelected) {
|
||||
$scope.hostsSelected = [];
|
||||
}
|
||||
$scope.hostsSelected.push(item);
|
||||
} else {
|
||||
_.remove($scope.hostsSelected, { id: item.id });
|
||||
if($scope.hostsSelected.length === 0) {
|
||||
$scope.hostsSelected = null;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.systemTrackingDisabled = ($scope.hostsSelected && $scope.hostsSelected.length > 2) ? true : false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function setJobStatus(){
|
||||
@ -120,4 +138,13 @@ export default ['$scope', 'RelatedHostsListDefinition', '$rootScope', 'GetBasePa
|
||||
$scope.smartInventory = function() {
|
||||
$state.go('inventories.addSmartInventory');
|
||||
};
|
||||
|
||||
$scope.systemTracking = function(){
|
||||
var hostIds = _.map($scope.hostsSelected, (host) => host.id);
|
||||
$state.go('systemTracking', {
|
||||
inventoryId: $state.params.inventory_id,
|
||||
hosts: $scope.$parent.hostsSelectedItems,
|
||||
hostIds: hostIds
|
||||
});
|
||||
};
|
||||
}];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user