mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 03:59:21 -02: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:
@@ -33,7 +33,7 @@
|
|||||||
$scope.inventory_id = $stateParams.inventory_id;
|
$scope.inventory_id = $stateParams.inventory_id;
|
||||||
|
|
||||||
$scope.$watchCollection(list.name, function(){
|
$scope.$watchCollection(list.name, function(){
|
||||||
_.forEach($scope[list.name], buildStatusIndicators);
|
_.forEach($scope[list.name], processRow);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on('selectedOrDeselected', function(e, value) {
|
$scope.$on('selectedOrDeselected', function(e, value) {
|
||||||
@@ -54,11 +54,17 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildStatusIndicators(group){
|
function processRow(group){
|
||||||
if (group === undefined || group === null) {
|
if (group === undefined || group === null) {
|
||||||
group = {};
|
group = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
angular.forEach($scope.groupsSelected, function(selectedGroup){
|
||||||
|
if(selectedGroup.id === group.id) {
|
||||||
|
group.isSelected = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let hosts_status;
|
let hosts_status;
|
||||||
|
|
||||||
hosts_status = GetHostsStatusMsg({
|
hosts_status = GetHostsStatusMsg({
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
$scope.inventory_id = $stateParams.inventory_id;
|
$scope.inventory_id = $stateParams.inventory_id;
|
||||||
|
|
||||||
$scope.$watchCollection(list.name, function(){
|
$scope.$watchCollection(list.name, function(){
|
||||||
_.forEach($scope[list.name], buildStatusIndicators);
|
_.forEach($scope[list.name], processRow);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on('selectedOrDeselected', function(e, value) {
|
$scope.$on('selectedOrDeselected', function(e, value) {
|
||||||
@@ -55,11 +55,17 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildStatusIndicators(group){
|
function processRow(group){
|
||||||
if (group === undefined || group === null) {
|
if (group === undefined || group === null) {
|
||||||
group = {};
|
group = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
angular.forEach($scope.groupsSelected, function(selectedGroup){
|
||||||
|
if(selectedGroup.id === group.id) {
|
||||||
|
group.isSelected = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let hosts_status;
|
let hosts_status;
|
||||||
|
|
||||||
hosts_status = GetHostsStatusMsg({
|
hosts_status = GetHostsStatusMsg({
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat
|
|||||||
value.can_disassociate = true;
|
value.can_disassociate = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
angular.forEach($scope.hostsSelected, function(selectedHost){
|
||||||
|
if(selectedHost.id === value.id) {
|
||||||
|
value.isSelected = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
setJobStatus();
|
setJobStatus();
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ export default ['$scope', 'ListDefinition', '$rootScope', 'GetBasePath',
|
|||||||
$scope[list.name] = _.map($scope.hosts, function(value) {
|
$scope[list.name] = _.map($scope.hosts, function(value) {
|
||||||
value.inventory_name = value.summary_fields.inventory.name;
|
value.inventory_name = value.summary_fields.inventory.name;
|
||||||
value.inventory_id = value.summary_fields.inventory.id;
|
value.inventory_id = value.summary_fields.inventory.id;
|
||||||
|
angular.forEach($scope.hostsSelected, function(selectedHost){
|
||||||
|
if(selectedHost.id === value.id) {
|
||||||
|
value.isSelected = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
setJobStatus();
|
setJobStatus();
|
||||||
|
|||||||
Reference in New Issue
Block a user