diff --git a/awx/ui/static/js/controllers/JobEvents.js b/awx/ui/static/js/controllers/JobEvents.js index 4d8156c736..560cb676f9 100644 --- a/awx/ui/static/js/controllers/JobEvents.js +++ b/awx/ui/static/js/controllers/JobEvents.js @@ -32,6 +32,18 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest, scope.parentNode = 'parent-event'; // used in ngClass to dynamicall set row level class and control scope.childNode = 'child-event'; // link color and cursor + + if (scope.removeSetHostLinks) { + scope.removeSetHostLinks(); + } + scope.removeSetHostLinks = scope.$on('SetHostLinks', function(e, inventory_id) { + for (var i=0; i < scope.jobevents.length; i++) { + if (scope.jobevents[i].summary_fields.host) { + scope.jobevents[i].hostLink = "/#/inventories/" + inventory_id + "/hosts/?name=" + + escape(scope.jobevents[i].summary_fields.host.name); + } + } + }); function formatJSON(eventData) { //turn JSON event data into an html form @@ -181,6 +193,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest, clearInterval($rootScope.timer); } } + scope.$emit('SetHostLinks', data.inventory); }) .error( function(data, status, headers, config) { ProcessErrors(scope, data, status, null, diff --git a/awx/ui/static/js/forms/InventoryHosts.js b/awx/ui/static/js/forms/InventoryHosts.js index a05d49aa7d..526e55aba5 100644 --- a/awx/ui/static/js/forms/InventoryHosts.js +++ b/awx/ui/static/js/forms/InventoryHosts.js @@ -43,7 +43,7 @@ angular.module('InventoryHostsFormDefinition', []) }, groups: { label: 'Groups', - searchable: false, + searchable: true, sourceModel: 'groups', sourceField: 'name', nosort: true diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index ef52097e5b..279dd4ea9c 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -126,9 +126,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' .factory('InventoryStatus', [ '$rootScope', 'Rest', 'Alert', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'InventorySummary', - 'GenerateList', 'ClearScope', 'SearchInit', 'PaginateInit', 'Refresh', 'InventoryUpdate', + 'GenerateList', 'ClearScope', 'SearchInit', 'PaginateInit', 'Refresh', 'InventoryUpdate', 'GroupsEdit', function($rootScope, Rest, Alert, ProcessErrors, GetBasePath, FormatDate, InventorySummary, GenerateList, ClearScope, SearchInit, - PaginateInit, Refresh, InventoryUpdate) { + PaginateInit, Refresh, InventoryUpdate, GroupsEdit) { return function(params) { //Build a summary of a given inventory @@ -205,6 +205,16 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' SearchInit({ scope: scope, set: 'groups', list: list, url: defaultUrl }); PaginateInit({ scope: scope, list: list, url: defaultUrl }); scope.search(list.iterator); + + scope.GroupsEdit = function(group_id) { + // On the tree, select the first occurrance of the requested group + var node = $('#tree-view').find("li[group_id='" + group_id + "']").first(); + var selected = $('#tree-view').jstree('get_selected'); + selected.each(function(idx) { + $('#tree-view').jstree('deselect_node', $(this)); + }); + $('#tree-view').jstree('select_node', node); + } scope.refresh = function() { scope['groupSearchSpin'] = true; diff --git a/awx/ui/static/js/helpers/inventory.js b/awx/ui/static/js/helpers/inventory.js index b751807168..303bb54f62 100644 --- a/awx/ui/static/js/helpers/inventory.js +++ b/awx/ui/static/js/helpers/inventory.js @@ -33,7 +33,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi var treeData = [{ data: { - title: inventory_name + title: inventory_name + ' Inventory' }, attr: { type: 'inventory', @@ -160,7 +160,10 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi $(tree_id).bind("loaded.jstree", function () { scope['treeLoading'] = false; Wait('stop'); - $(tree_id).prepend('