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: {
label: 'Sync failures?',
searchType: 'gtzero',
searchValue: 'true',
searchType: 'select',
searchOptions: [{
label: 'Yes',
value: 'inventory_sources_with_failures__gt=0'
}, {
label: 'No',
value: 'inventory_sources_with_failures__lte=0'
}],
searchOnly: true
}
},

View File

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

View File

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