mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
Hook up system tracking from the host list
This commit is contained in:
committed by
Jared Tabor
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(){
|
function setJobStatus(){
|
||||||
@@ -120,4 +138,13 @@ export default ['$scope', 'RelatedHostsListDefinition', '$rootScope', 'GetBasePa
|
|||||||
$scope.smartInventory = function() {
|
$scope.smartInventory = function() {
|
||||||
$state.go('inventories.addSmartInventory');
|
$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
|
||||||
|
});
|
||||||
|
};
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user