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('
Group Selector
'); + // Force root node styling changes + $('#inventory-node ins').first().remove(); + $('#inventory-node a ins').first().css('background-image', 'none').append('').css('margin-right','10px'); + $('#inventory-node a').first().css('margin-bottom', '10px'); scope.$emit('treeLoaded'); }); diff --git a/awx/ui/static/js/lists/InventorySummary.js b/awx/ui/static/js/lists/InventorySummary.js index 4891151d8a..4e83cc4ac3 100644 --- a/awx/ui/static/js/lists/InventorySummary.js +++ b/awx/ui/static/js/lists/InventorySummary.js @@ -22,10 +22,10 @@ angular.module('InventorySummaryDefinition', []) name: { key: true, label: 'Group', - noLink: true, ngBind: "group.summary_fields.group.name", sourceModel: 'group', - sourceField: 'name' + sourceField: 'name', + ngClick: "\{\{ 'GroupsEdit(' + group.group + ')' \}\}" }, hosts_with_active_failures: { label: 'Hosts with
Job Failures?', @@ -37,6 +37,22 @@ angular.module('InventorySummaryDefinition', []) searchable: false, nosort: true }, + has_active_failures: { + label: 'Hosts have job failures?', + searchSingleValue: true, + searchType: 'boolean', + searchValue: 'true', + searchOnly: true, + sourceModel: 'group', + sourceField: 'has_active_failures' + }, + last_update_failed: { + label: 'Update failed?', + searchSingleValue: true, + searchType: 'boolean', + searchValue: 'true', + searchOnly: true + }, status: { label: 'Update
Status', searchType: 'select', @@ -63,21 +79,12 @@ angular.module('InventorySummaryDefinition', []) { name: "Local Script", value: "file" }, { name: "Manual", value: "" }, { name: "Rackspace", value: "rackspace" }] - }, - has_active_failures: { - label: 'Hosts have job failures?', - searchSingleValue: true, - searchType: 'boolean', - searchValue: 'true', - searchOnly: true, - sourceModel: 'group', - sourceField: 'has_active_failures' } }, actions: { refresh: { - awRefresh: false, + awRefresh: true, mode: 'all' }, help: { diff --git a/awx/ui/static/js/lists/JobEvents.js b/awx/ui/static/js/lists/JobEvents.js index b107bc970f..d9a4c2150d 100644 --- a/awx/ui/static/js/lists/JobEvents.js +++ b/awx/ui/static/js/lists/JobEvents.js @@ -75,6 +75,7 @@ angular.module('JobEventsListDefinition', []) host: { label: 'Host', ngBind: 'jobevent.summary_fields.host.name', + ngHref: "\{\{ jobevent.hostLink \}\}", searchField: 'hosts__name', nosort: true, searchOnly: false, diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 7935f280c0..72578f6360 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -716,20 +716,27 @@ select.field-mini-height { .icon-cloud-na:before, .icon-cloud-never:before, .icon-cloud-updating:before, - .icon-cloud-failed:before, .icon-cloud-successful:before { - content: "\f0c2"; + content: "\f111"; } + + .icon-cloud-failed:before { + content: "\f06a"; + } + .icon-cloud-na { color: #888; } + .icon-cloud-never { color: #888; } + .icon-cloud-updating, .icon-cloud-success { color: #5bb75b; } + .icon-cloud-failed { color: @red; } diff --git a/awx/ui/static/lib/jstree/themes/ansible/style.css b/awx/ui/static/lib/jstree/themes/ansible/style.css index 85d22e61ab..711b6c1341 100644 --- a/awx/ui/static/lib/jstree/themes/ansible/style.css +++ b/awx/ui/static/lib/jstree/themes/ansible/style.css @@ -84,3 +84,4 @@ .jstree-ansible .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; } /* IE6 END */ +