diff --git a/.changelog/14970.txt b/.changelog/14970.txt new file mode 100644 index 000000000..cbe075406 --- /dev/null +++ b/.changelog/14970.txt @@ -0,0 +1,3 @@ +```release-note:feature +ui: Filter agentless (synthetic) nodes from the nodes list page. +``` diff --git a/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs b/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs index a2096231f..dcdc8c591 100644 --- a/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs @@ -1,131 +1,121 @@ - + - + + as |api| + > - - - - - - {{#let - - (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") - ) - searchproperty=(hash - value=(if (not-eq searchproperty undefined) - (split searchproperty ',') - this._searchProperties - ) - change=(action (mut searchproperty) value="target.selectedItems") - default=this._searchProperties - ) - ) - - api.data - - leader.data - - as |sort filters items leader|}} - - -

- {{format-number items.length}} total -

- + + - - {{#if (gt items.length 0) }} - - {{/if}} + + {{#let + (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') + ) + searchproperty=(hash + value=(if + (not-eq searchproperty undefined) (split searchproperty ',') this._searchProperties + ) + change=(action (mut searchproperty) value='target.selectedItems') + default=this._searchProperties + ) + ) + api.data + leader.data + as |sort filters items leader| + }} + {{#let (reject-by 'Meta.synthetic-node' items) as |filtered|}} + + +

+ + {{format-number items.length}} total +

+ +
+ + {{#if (gt filtered.length 0)}} + + {{/if}} + + + + + + + + + +

+ {{t 'routes.dc.nodes.index.empty.header' items=items.length}} +

+
+ + {{t + 'routes.dc.nodes.index.empty.body' + items=items.length + canUseACLs=(can 'use acls') + htmlSafe=true + }} + + + + + +
+
+
+
+
+ {{/let}} + {{/let}}
- - - - - - - - -

- {{t 'routes.dc.nodes.index.empty.header' - items=items.length - }} -

-
- - {{t 'routes.dc.nodes.index.empty.body' - items=items.length - canUseACLs=(can 'use acls') - htmlSafe=true - }} - - - - - -
-
-
-
-
- {{/let}} -
-
+
diff --git a/ui/packages/consul-ui/mock-api/v1/health/service/_ b/ui/packages/consul-ui/mock-api/v1/health/service/_ index aaf9a1e0f..40e41019f 100644 --- a/ui/packages/consul-ui/mock-api/v1/health/service/_ +++ b/ui/packages/consul-ui/mock-api/v1/health/service/_ @@ -54,7 +54,7 @@ "TaggedAddresses":{"lan":"${ip}","wan":"${ip}"}, "Meta":{ "${service}-network-segment":"", - "synthetic-node":${externalSource === 'kubernetes' ? "true" : "false"} + "synthetic-node":${externalSource === 'kubernetes' ? true : false} }, ${typeof location.search.peer !== 'undefined' ? ` "PeerName": "${location.search.peer}", diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/empty-ids.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/empty-ids.feature index b0f1429ae..58380713f 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/empty-ids.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/empty-ids.feature @@ -6,22 +6,32 @@ Feature: dc / nodes / empty-ids: Hedge for if nodes come in over the API with no --- - ID: id-1 Node: name-1 + Meta: + synthetic-node: false Checks: - Status: passing - ID: "" Node: name-2 + Meta: + synthetic-node: false Checks: - Status: passing - ID: "" Node: name-3 + Meta: + synthetic-node: false Checks: - Status: passing - ID: "" Node: name-4 + Meta: + synthetic-node: false Checks: - Status: passing - ID: "" Node: name-5 + Meta: + synthetic-node: false Checks: - Status: passing --- diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature index beb759c61..5602e4f15 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/index.feature @@ -21,6 +21,31 @@ Feature: dc / nodes / index Then the url should be /dc-1/nodes Then I see 1 node models And I see status on the nodes.0 like "critical" + Scenario: Viewing nodes list page should not show synthetic nodes + Given 3 node model from yaml + --- + - Meta: + synthetic-node: true + Checks: + - Status: passing + ServiceID: "" + - Meta: + synthetic-node: false + Checks: + - Status: passing + ServiceID: "" + - Meta: + synthetic-node: false + Checks: + - Status: critical + ServiceID: "" + --- + When I visit the nodes page for yaml + --- + dc: dc-1 + --- + Then the url should be /dc-1/nodes + Then I see 2 node models Scenario: Viewing a node with an unhealthy ServiceCheck Given 1 node model from yaml --- @@ -29,6 +54,8 @@ Feature: dc / nodes / index ServiceID: "" - Status: critical ServiceID: web + Meta: + synthetic-node: false --- When I visit the nodes page for yaml --- @@ -38,7 +65,24 @@ Feature: dc / nodes / index Then I see 1 node models And I see status on the nodes.0 like "passing" Scenario: Viewing nodes in the listing - Given 3 node models + Given 3 node model from yaml + --- + - Meta: + synthetic-node: false + Checks: + - Status: passing + ServiceID: "" + - Meta: + synthetic-node: false + Checks: + - Status: passing + ServiceID: "" + - Meta: + synthetic-node: false + Checks: + - Status: critical + ServiceID: "" + --- When I visit the nodes page for yaml --- dc: dc-1 @@ -54,12 +98,18 @@ Feature: dc / nodes / index Checks: - Status: critical Name: Warning check + Meta: + synthetic-node: false - Address: 10.0.0.1 Checks: - Status: passing + Meta: + synthetic-node: false - Address: 10.0.0.3 Checks: - Status: passing + Meta: + synthetic-node: false --- When I visit the nodes page for yaml --- @@ -73,10 +123,16 @@ Feature: dc / nodes / index --- - Node: node-01 Address: 10.0.0.0 + Meta: + synthetic-node: false - Node: node-02 Address: 10.0.0.1 + Meta: + synthetic-node: false - Node: node-03 Address: 10.0.0.2 + Meta: + synthetic-node: false --- When I visit the nodes page for yaml --- diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/navigation.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/navigation.feature index 116e26ff8..f33a73f83 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/navigation.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/navigation.feature @@ -2,7 +2,27 @@ Feature: dc / nodes / navigation Scenario: Clicking a node in the listing and back again Given 1 datacenter model with the value "dc-1" - And 3 node models + And 3 node models from yaml + --- + - Node: Node-A + Meta: + synthetic-node: false + Checks: + - Status: critical + ServiceID: "" + - Node: Node-B + Meta: + synthetic-node: false + Checks: + - Status: passing + ServiceID: "" + - Node: Node-C + Meta: + synthetic-node: false + Checks: + - Status: warning + ServiceID: "" + --- When I visit the nodes page for yaml --- dc: dc-1 diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/no-leader.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/no-leader.feature index 84f6036cf..6a1e5b659 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/no-leader.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/no-leader.feature @@ -2,7 +2,27 @@ Feature: dc / nodes / no-leader Scenario: Leader hasn't been elected Given 1 datacenter model with the value "dc-1" - And 3 node models + And 3 node models from yaml + --- + - Node: Node-A + Meta: + synthetic-node: false + Checks: + - Status: critical + ServiceID: "" + - Node: Node-B + Meta: + synthetic-node: false + Checks: + - Status: passing + ServiceID: "" + - Node: Node-C + Meta: + synthetic-node: false + Checks: + - Status: warning + ServiceID: "" + --- And the url "/v1/status/leader" responds with from yaml --- body: | diff --git a/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature b/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature index 452a2eeea..d529a80b7 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/nodes/sorting.feature @@ -5,26 +5,38 @@ Feature: dc / nodes / sorting And 6 node models from yaml --- - Node: Node-A + Meta: + synthetic-node: false Checks: - Status: critical ServiceID: "" - Node: Node-B + Meta: + synthetic-node: false Checks: - Status: passing ServiceID: "" - Node: Node-C + Meta: + synthetic-node: false Checks: - Status: warning ServiceID: "" - Node: Node-D + Meta: + synthetic-node: false Checks: - Status: critical ServiceID: "" - Node: Node-E + Meta: + synthetic-node: false Checks: - Status: critical ServiceID: "" - Node: Node-F + Meta: + synthetic-node: false Checks: - Status: warning ServiceID: ""