mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Merge pull request #2619 from mabashian/2617
Highlight group/host currently being edited
This commit is contained in:
commit
1b9b14d6f7
@ -12,6 +12,10 @@
|
||||
view = generateList,
|
||||
pageSize = 20;
|
||||
$scope.inventory_id = $stateParams.inventory_id;
|
||||
if($state.current.name === "inventoryManage.editGroup") {
|
||||
$scope.rowBeingEdited = $state.params.group_id;
|
||||
$scope.listBeingEdited = "groups";
|
||||
}
|
||||
$scope.groupSelect = function(id){
|
||||
var group = $stateParams.group === undefined ? [id] : _($stateParams.group).concat(id).value();
|
||||
$state.go('inventoryManage', {inventory_id: $stateParams.inventory_id, group: group}, {reload: true});
|
||||
@ -152,6 +156,22 @@
|
||||
$state.go('inventoryManage.copyMoveGroup', {group_id: id, groups: $stateParams.groups});
|
||||
};
|
||||
|
||||
var cleanUpStateChangeListener = $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams) {
|
||||
if (toState.name === "inventoryManage.editGroup") {
|
||||
$scope.rowBeingEdited = toParams.group_id;
|
||||
$scope.listBeingEdited = "groups";
|
||||
}
|
||||
else {
|
||||
delete $scope.rowBeingEdited;
|
||||
delete $scope.listBeingEdited;
|
||||
}
|
||||
});
|
||||
|
||||
// Remove the listener when the scope is destroyed to avoid a memory leak
|
||||
$scope.$on('$destroy', function() {
|
||||
cleanUpStateChangeListener();
|
||||
});
|
||||
|
||||
var init = function(){
|
||||
list.basePath = groupsUrl;
|
||||
view.inject(list,{
|
||||
|
||||
@ -11,6 +11,10 @@
|
||||
var list = InventoryHosts,
|
||||
view = generateList,
|
||||
pageSize = 20;
|
||||
if($state.current.name === "inventoryManage.editHost") {
|
||||
$scope.rowBeingEdited = $state.params.host_id;
|
||||
$scope.listBeingEdited = "hosts";
|
||||
}
|
||||
$scope.createHost = function(){
|
||||
$state.go('inventoryManage.addHost');
|
||||
};
|
||||
@ -63,6 +67,20 @@
|
||||
$scope.$on('PostRefresh', ()=>{
|
||||
_.forEach($scope.hosts, (host) => SetStatus({scope: $scope, host: host}));
|
||||
});
|
||||
var cleanUpStateChangeListener = $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams) {
|
||||
if (toState.name === "inventoryManage.editHost") {
|
||||
$scope.rowBeingEdited = toParams.host_id;
|
||||
$scope.listBeingEdited = "hosts";
|
||||
}
|
||||
else {
|
||||
delete $scope.rowBeingEdited;
|
||||
delete $scope.listBeingEdited;
|
||||
}
|
||||
});
|
||||
// Remove the listener when the scope is destroyed to avoid a memory leak
|
||||
$scope.$on('$destroy', function() {
|
||||
cleanUpStateChangeListener();
|
||||
});
|
||||
var init = function(){
|
||||
list.basePath = hostsUrl;
|
||||
view.inject(list,{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user