1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 18:21:12 +03:00

AC-503 cleanup of has_inventory_source indicators and links on inventory and inventory->host pages. added new query on inventory groups page.

This commit is contained in:
chouseknecht 2013-10-08 22:59:01 -04:00
parent 0389476336
commit 832b892528
8 changed files with 88 additions and 26 deletions

View File

@ -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';
}
}
});

View File

@ -25,15 +25,35 @@ angular.module('InventoryHostsFormDefinition', [])
label: 'Current<br>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<br>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
}
},

View File

@ -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];

View File

@ -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 + "\" " +
"><a href=\"\" class=\"expand\"><i class=\"icon-caret-down\"></i></a> " +
"<i class=\"field-badge icon-failures-" + sorted[i].has_active_failures + "\" " +
"aw-tool-tip=\"" + toolTip + "\" data-placement=\"bottom\"></i> " +
"aw-tool-tip=\"" + toolTip + "\" data-placement=\"top\"></i> " +
"<a href=\"\" class=\"activate\">" + sorted[i].name + "</a> ";
if (sorted[i].children.length > 0) {
buildHTML(sorted[i].children);

View File

@ -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;

View File

@ -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<br>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

View File

@ -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,

View File

@ -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 {