fix external source and sync failure queries on inv groups/invs

This commit is contained in:
John Mitchell
2016-06-01 14:32:42 -04:00
parent c5c65adc09
commit 857f873f4d
3 changed files with 21 additions and 8 deletions

View File

@@ -74,8 +74,14 @@ export default
}, },
inventory_sources_with_failures: { inventory_sources_with_failures: {
label: 'Sync failures?', label: 'Sync failures?',
searchType: 'gtzero', searchType: 'select',
searchValue: 'true', searchOptions: [{
label: 'Yes',
value: 'inventory_sources_with_failures__gt=0'
}, {
label: 'No',
value: 'inventory_sources_with_failures__lte=0'
}],
searchOnly: true searchOnly: true
} }
}, },

View File

@@ -95,11 +95,15 @@ export default
}, },
has_external_source: { has_external_source: {
label: 'Has external source?', label: 'Has external source?',
searchType: 'in', searchType: 'select',
searchValue: 'ec2,rax,vmware,azure,gce,openstack', searchOptions: [{
searchOnly: true, label: 'Yes',
sourceModel: 'inventory_source', value: 'inventory_source__source__in=ec2,rax,vmware,azure,gce,openstack'
sourceField: 'source' }, {
label: 'No',
value: 'not__inventory_source__source__in=ec2,rax,vmware,azure,gce,openstack'
}],
searchOnly: true
}, },
has_active_failures: { has_active_failures: {
label: 'Has failed hosts?', label: 'Has failed hosts?',

View File

@@ -180,6 +180,9 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu
if (tag.type === "text") { if (tag.type === "text") {
tag.url = tag.value + "__icontains=" + textVal; tag.url = tag.value + "__icontains=" + textVal;
tag.name = textVal; tag.name = textVal;
} else if (selectVal.value.indexOf("=") > 0) {
tag.url = selectVal.value;
tag.name = selectVal.label;
} else { } else {
tag.url = tag.value + "=" + selectVal.value; tag.url = tag.value + "=" + selectVal.value;
tag.name = selectVal.label; tag.name = selectVal.label;