diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index f7672ee4bf..de2c723e2e 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -41,13 +41,17 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res } if (scope.inventories[i].has_inventory_sources) { //scope.inventories[i].inventory_source = 'external'; - scope.inventories[i].has_inventory_tip = 'Has one or more external sources. Click to view details.'; - scope.inventories[i].has_inventory_link = '/#/inventories/' + scope.inventories[i].id + '/groups'; + scope.inventories[i].has_inv_sources_tip = 'Has one or more external sources. Click to view details.'; + scope.inventories[i].has_inv_sources_link = '/#/inventories/' + scope.inventories[i].id + + '/groups?has_external_source=true'; + scope.inventories[i].inventory_sources = 'yes'; } else { //scope.inventories[i].inventory_source = 'manual'; - scope.inventories[i].has_inventory_tip = 'Has no external sources. Click to view details'; - scope.inventories[i].has_inventory_link = '/#/inventories/' + scope.inventories[i].id + '/groups'; + scope.inventories[i].has_inv_sources_tip = 'Has no external sources.'; + scope.inventories[i].has_inv_sources_link = '/#/inventories/' + scope.inventories[i].id + + '/groups'; + scope.inventories[i].inventory_sources = 'no'; } } }); diff --git a/awx/ui/static/js/forms/InventoryHosts.js b/awx/ui/static/js/forms/InventoryHosts.js index 526e55aba5..c9729cc8f3 100644 --- a/awx/ui/static/js/forms/InventoryHosts.js +++ b/awx/ui/static/js/forms/InventoryHosts.js @@ -25,15 +25,35 @@ angular.module('InventoryHostsFormDefinition', []) label: 'Current
Job Status?', ngHref: "\{\{ host.activeFailuresLink \}\}", awToolTip: "\{\{ host.badgeToolTip \}\}", - dataPlacement: 'bottom', + dataPlacement: 'top', badgeNgHref: '\{\{ host.activeFailuresLink \}\}', badgeIcon: "\{\{ 'icon-failures-' + host.has_active_failures \}\}", badgePlacement: 'left', badgeToolTip: "\{\{ host.badgeToolTip \}\}", - badgeTipPlacement: 'bottom', + badgeTipPlacement: 'top', searchable: false, nosort: true }, + inventory_sources: { + label: 'External
Source?', + ngHref: "\{\{ host.has_inv_source_link \}\}", + badgeNgHref: "\{\{ host.has_inv_source_link \}\}", + badgeIcon: "\{\{ 'icon-cloud-' + host.has_inventory_sources \}\}", + badgePlacement: 'left', + badgeToolTip: "\{\{ host.has_inv_source_tip \}\}", + awToolTip: "\{\{ host.has_inv_source_tip \}\}", + dataPlacement: 'top', + badgeTipPlacement: 'top', + searchable: false, + nosort: true + }, + groups: { + label: 'Groups', + searchable: true, + sourceModel: 'groups', + sourceField: 'name', + nosort: true + }, has_active_failures: { label: 'Current job failed?', searchSingleValue: true, @@ -41,12 +61,12 @@ angular.module('InventoryHostsFormDefinition', []) searchValue: 'true', searchOnly: true }, - groups: { - label: 'Groups', - searchable: true, - sourceModel: 'groups', - sourceField: 'name', - nosort: true + has_inventory_sources: { + label: 'Has external source?', + searchSingleValue: true, + searchType: 'boolean', + searchValue: 'true', + searchOnly: true } }, diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 0d2f34fc9e..833da85be4 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -239,12 +239,22 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' scope[list.iterator + 'SearchField'] = 'name'; scope[list.iterator + 'SearchType'] = 'iexact'; scope[list.iterator + 'SearchValue'] = scope['inventorySummaryGroup']; + scope[list.iterator + 'SearchFieldLabel'] = list.fields['name'].label; + } + else if ($routeParams['has_external_source']) { + scope[list.iterator + 'SearchField'] = 'has_external_source'; + scope[list.iterator + 'SearchValue'] = list.fields['has_external_source'].searchValue; + scope[list.iterator + 'InputDisable'] = true; + scope[list.iterator + 'SearchType'] = 'in'; + scope[list.iterator + 'SearchFieldLabel'] = list.fields['has_external_source'].label; + //=ec2,rackspace,file) } else if ($routeParams['status']) { // with status param, called post update-submit scope[list.iterator + 'SearchField'] = 'status'; scope[list.iterator + 'SelectShow'] = true; scope[list.iterator + 'SearchSelectOpts'] = list.fields['status'].searchOptions; + scope[list.iterator + 'SearchFieldLabel'] = list.fields['status'].label; for (var opt in list.fields['status'].searchOptions) { if (list.fields['status'].searchOptions[opt].value == $routeParams['status']) { scope[list.iterator + 'SearchSelectValue'] = list.fields['status'].searchOptions[opt]; diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index c2787f744b..d23d46dfc1 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -441,6 +441,18 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H } } scope.hosts[i].groups = scope.hosts[i].groups.replace(/\, $/,''); + + if (scope.hosts[i].has_inventory_sources) { + scope.hosts[i].inventory_sources = 'yes'; + scope.hosts[i].has_inv_source_link = '???'; + scope.hosts[i].has_inv_source_tip = 'Has an external source. Click to view details.'; + } + else { + scope.hosts[i].inventory_sources = 'no'; + scope.hosts[i].has_inv_source_link = '???'; + scope.hosts[i].has_inv_source_tip = 'Has no external source.'; + } + } // Add the value displayed in Job Status column @@ -519,7 +531,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H "data-group-id=\"" + sorted[i].id + "\" " + "> " + " " + + "aw-tool-tip=\"" + toolTip + "\" data-placement=\"top\"> " + "" + sorted[i].name + " "; if (sorted[i].children.length > 0) { buildHTML(sorted[i].children); diff --git a/awx/ui/static/js/helpers/search.js b/awx/ui/static/js/helpers/search.js index f00ed7bfa3..ec8afd46a6 100644 --- a/awx/ui/static/js/helpers/search.js +++ b/awx/ui/static/js/helpers/search.js @@ -108,6 +108,11 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper']) scope[iterator + "SearchSelectValue"] = { value: list.fields[fld].searchValue }; } } + else if (list.fields[fld].searchType == 'in') { + scope[iterator + "SearchType"] = 'in'; + scope[iterator + "SearchValue"] = list.fields[fld].searchValue; + scope[iterator + "InputDisable"] = true; + } else if (list.fields[fld].searchType && (list.fields[fld].searchType == 'boolean' || list.fields[fld].searchType == 'select')) { scope[iterator + 'SelectShow'] = true; diff --git a/awx/ui/static/js/lists/Inventories.js b/awx/ui/static/js/lists/Inventories.js index bd7c3a0c88..24938479fb 100644 --- a/awx/ui/static/js/lists/Inventories.js +++ b/awx/ui/static/js/lists/Inventories.js @@ -33,18 +33,18 @@ angular.module('InventoriesListDefinition', []) type: 'badgeCount', "class": "{{ 'failures-' + inventory.has_active_failures }}", awToolTip: '# of hosts with failed jobs. Click to view hosts.', - dataPlacement: 'bottom', + dataPlacement: 'top', searchable: false }, - inventory_source: { - label: 'Source?', - //ngHref: "\{\{ inventory.has_inventory_link \}\}", - //awToolTip: "\{\{ inventory.has_inventory_tip \}\}", - //dataPlacement: 'top', - badgeNgHref: '\{\{ inventory.has_inventory_link \}\}', + inventory_sources: { + label: 'External
Sources?', + ngHref: '\{\{ inventory.has_inv_sources_link \}\}', + badgeNgHref: '\{\{ inventory.has_inv_sources_link \}\}', badgeIcon: "\{\{ 'icon-cloud-' + inventory.has_inventory_sources \}\}", badgePlacement: 'left', - badgeToolTip: "\{\{ inventory.has_inventory_tip \}\}", + badgeToolTip: "\{\{ inventory.has_inv_sources_tip \}\}", + awToolTip: "\{\{ inventory.has_inv_sources_tip \}\}", + dataPlacement: "top", badgeTipPlacement: 'top', searchable: false, nosort: true @@ -52,7 +52,7 @@ angular.module('InventoriesListDefinition', []) organization: { label: 'Organization', ngBind: 'inventory.summary_fields.organization.name', - linkTo: '/organizations/{{ inventory.organization }}', + linkTo: '/#/organizations/{{ inventory.organization }}', sourceModel: 'organization', sourceField: 'name', excludeModal: true diff --git a/awx/ui/static/js/lists/InventorySummary.js b/awx/ui/static/js/lists/InventorySummary.js index cf6335a83c..f64ac68dda 100644 --- a/awx/ui/static/js/lists/InventorySummary.js +++ b/awx/ui/static/js/lists/InventorySummary.js @@ -68,6 +68,14 @@ angular.module('InventorySummaryDefinition', []) sourceModel: 'inventory_source', sourceField: 'source' }, + has_external_source: { + label: 'Has external source?', + searchType: 'in', + searchValue: 'ec2,rackspace', + searchOnly: true, + sourceModel: 'inventory_source', + sourceField: 'source' + }, has_active_failures: { label: 'Hosts have job failures?', searchSingleValue: true, diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 1964871b57..90444bf76e 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -742,18 +742,21 @@ select.field-mini-height { } /* Inventory cloud sourced? indicator */ - .icon-cloud-true:before, + .icon-cloud-true:before { + content: "\f111"; + } + .icon-cloud-false:before { - content: "\f0c2"; + content: "\f111"; } .icon-cloud-true { - color: @blue-link; + color: @green; } .icon-cloud-false { color: @grey; - } + } /* end */ .field-success {