diff --git a/ui/packages/consul-ui/app/controllers/dc/services/instance/healthchecks.js b/ui/packages/consul-ui/app/controllers/dc/services/instance/healthchecks.js new file mode 100644 index 0000000000..8d6270e823 --- /dev/null +++ b/ui/packages/consul-ui/app/controllers/dc/services/instance/healthchecks.js @@ -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'); + } +} diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs index 454e92f1a6..80f621db55 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs @@ -2,92 +2,98 @@ @name={{routeName}} as |route|> {{#let + (filter (action 'syntheticNodeSearchPropertyFilter' route.model.item) searchProperties) as |filteredSearchProperties|}} + {{#let - (hash - value=(or sortBy "Status:asc") - change=(action (mut sortBy) value="target.selected") - ) + (hash + value=(or sortBy "Status:asc") + change=(action (mut sortBy) value="target.selected") + ) - (hash - status=(hash - value=(if status (split status ',') undefined) - change=(action (mut status) value="target.selectedItems") - ) - check=(hash - value=(if check (split check ',') undefined) - change=(action (mut check) value="target.selectedItems") - ) - searchproperty=(hash - value=(if (not-eq searchproperty undefined) - (split searchproperty ',') - searchProperties + (hash + status=(hash + value=(if status (split status ',') undefined) + change=(action (mut status) value="target.selectedItems") + ) + check=(hash + value=(if check (split check ',') undefined) + change=(action (mut check) value="target.selectedItems") + ) + searchproperty=(hash + value=(if (not-eq searchproperty undefined) + (split searchproperty ',') + filteredSearchProperties + ) + change=(action (mut searchproperty) value="target.selectedItems") + default=filteredSearchProperties ) - change=(action (mut searchproperty) value="target.selectedItems") - default=searchProperties ) - ) - (merge-checks (array route.model.item.Checks route.model.proxy.Checks) route.model.proxy.ServiceProxy.Expose.Checks) + (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|}} -