mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Merge pull request #78 from mabashian/7266-run-commands
Maintain selected host/group rows on pagination and search changes
This commit is contained in:
commit
fde3e41042
@ -33,7 +33,7 @@
|
||||
$scope.inventory_id = $stateParams.inventory_id;
|
||||
|
||||
$scope.$watchCollection(list.name, function(){
|
||||
_.forEach($scope[list.name], buildStatusIndicators);
|
||||
_.forEach($scope[list.name], processRow);
|
||||
});
|
||||
|
||||
$scope.$on('selectedOrDeselected', function(e, value) {
|
||||
@ -54,11 +54,17 @@
|
||||
|
||||
}
|
||||
|
||||
function buildStatusIndicators(group){
|
||||
function processRow(group){
|
||||
if (group === undefined || group === null) {
|
||||
group = {};
|
||||
}
|
||||
|
||||
angular.forEach($scope.groupsSelected, function(selectedGroup){
|
||||
if(selectedGroup.id === group.id) {
|
||||
group.isSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
let hosts_status;
|
||||
|
||||
hosts_status = GetHostsStatusMsg({
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
$scope.inventory_id = $stateParams.inventory_id;
|
||||
|
||||
$scope.$watchCollection(list.name, function(){
|
||||
_.forEach($scope[list.name], buildStatusIndicators);
|
||||
_.forEach($scope[list.name], processRow);
|
||||
});
|
||||
|
||||
$scope.$on('selectedOrDeselected', function(e, value) {
|
||||
@ -55,11 +55,17 @@
|
||||
|
||||
}
|
||||
|
||||
function buildStatusIndicators(group){
|
||||
function processRow(group){
|
||||
if (group === undefined || group === null) {
|
||||
group = {};
|
||||
}
|
||||
|
||||
angular.forEach($scope.groupsSelected, function(selectedGroup){
|
||||
if(selectedGroup.id === group.id) {
|
||||
group.isSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
let hosts_status;
|
||||
|
||||
hosts_status = GetHostsStatusMsg({
|
||||
|
||||
@ -34,6 +34,11 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat
|
||||
value.can_disassociate = true;
|
||||
}
|
||||
});
|
||||
angular.forEach($scope.hostsSelected, function(selectedHost){
|
||||
if(selectedHost.id === value.id) {
|
||||
value.isSelected = true;
|
||||
}
|
||||
});
|
||||
return value;
|
||||
});
|
||||
setJobStatus();
|
||||
|
||||
@ -31,6 +31,11 @@ export default ['$scope', 'ListDefinition', '$rootScope', 'GetBasePath',
|
||||
$scope[list.name] = _.map($scope.hosts, function(value) {
|
||||
value.inventory_name = value.summary_fields.inventory.name;
|
||||
value.inventory_id = value.summary_fields.inventory.id;
|
||||
angular.forEach($scope.hostsSelected, function(selectedHost){
|
||||
if(selectedHost.id === value.id) {
|
||||
value.isSelected = true;
|
||||
}
|
||||
});
|
||||
return value;
|
||||
});
|
||||
setJobStatus();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user