Filter healthchecks for synthetic-nodes

This commit is contained in:
wenincode 2022-10-13 15:47:47 -06:00
parent e04c56a3a1
commit 0eb250d3a0
2 changed files with 98 additions and 76 deletions

View File

@ -0,0 +1,16 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class HealthChecksController extends Controller {
@action
syntheticNodeSearchPropertyFilter(item, searchProperty) {
return !(item.Node.Meta?.['synthetic-node'] && searchProperty === 'Node');
}
@action
syntheticNodeHealthCheckFilter(item, healthcheck, index, list) {
console.log('List to be filtered: ', list);
console.log(healthcheck.Kind);
return !(item.Node.Meta?.['synthetic-node'] && healthcheck?.Kind === 'node');
}
}

View File

@ -1,6 +1,8 @@
<Route
@name={{routeName}}
as |route|>
{{#let
(filter (action 'syntheticNodeSearchPropertyFilter' route.model.item) searchProperties) as |filteredSearchProperties|}}
{{#let
(hash
@ -20,14 +22,17 @@ as |route|>
searchproperty=(hash
value=(if (not-eq searchproperty undefined)
(split searchproperty ',')
searchProperties
filteredSearchProperties
)
change=(action (mut searchproperty) value="target.selectedItems")
default=searchProperties
default=filteredSearchProperties
)
)
(filter
(action 'syntheticNodeHealthCheckFilter' route.model.item)
(merge-checks (array route.model.item.Checks route.model.proxy.Checks) route.model.proxy.ServiceProxy.Expose.Checks)
)
as |sort filters items|}}
<div class="tab-section">
@ -90,4 +95,5 @@ as |route|>
</div>
{{/let}}
{{/let}}
</Route>