Add basic searching by tags using the freetext search near-term
This commit is contained in:
parent
6c9f4fbe8a
commit
f993130937
|
@ -26,6 +26,10 @@ export default Controller.extend(WithFiltering, {
|
|||
get(item, 'ID')
|
||||
.toLowerCase()
|
||||
.indexOf(term) !== -1 ||
|
||||
(get(item, 'Tags') || [])
|
||||
.join('')
|
||||
.toLowerCase()
|
||||
.indexOf(term) !== -1 ||
|
||||
get(item, 'Port')
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
|
|
|
@ -26,10 +26,16 @@ const widthDeclaration = function(num) {
|
|||
};
|
||||
export default Controller.extend(WithHealthFiltering, {
|
||||
filter: function(item, { s = '', status = '' }) {
|
||||
const term = s.toLowerCase();
|
||||
return (
|
||||
get(item, 'Name')
|
||||
(get(item, 'Name')
|
||||
.toLowerCase()
|
||||
.indexOf(s.toLowerCase()) !== -1 && item.hasStatus(status)
|
||||
.indexOf(term) !== -1 ||
|
||||
(get(item, 'Tags') || [])
|
||||
.join('')
|
||||
.toLowerCase()
|
||||
.indexOf(term) !== -1) &&
|
||||
item.hasStatus(status)
|
||||
);
|
||||
},
|
||||
totalWidth: computed('{maxPassing,maxWarning,maxCritical}', function() {
|
||||
|
|
Loading…
Reference in New Issue