From de234b3aa74e3e85f4c82f1224936d85053ae663 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 11 Apr 2022 12:49:59 +0100 Subject: [PATCH] ui: Add more explanatory texts for empty states (#12354) * ui: Add more explanatory texts for empty states * Change all template "Read the guide"s * Add missing htmlSafe * Remove the stuff I commented out to try and grok the hairy rebase * Changelog * More rebased yaml weirdness plus added node:read --- .changelog/12354.txt | 3 + .../app/templates/dc/nodes/show/sessions.hbs | 25 +- .../templates/dc/acls/auth-methods/index.hbs | 19 +- .../acls/auth-methods/show/binding-rules.hbs | 10 +- .../acls/auth-methods/show/nspace-rules.hbs | 10 +- .../app/templates/dc/acls/policies/index.hbs | 21 +- .../app/templates/dc/acls/roles/index.hbs | 19 +- .../app/templates/dc/acls/tokens/index.hbs | 19 +- .../app/templates/dc/intentions/index.hbs | 21 +- .../consul-ui/app/templates/dc/kv/index.hbs | 21 +- .../app/templates/dc/nodes/index.hbs | 15 +- .../templates/dc/nodes/show/healthchecks.hbs | 8 +- .../app/templates/dc/nodes/show/services.hbs | 7 +- .../app/templates/dc/services/index.hbs | 23 +- .../dc/services/instance/exposedpaths.hbs | 8 +- .../dc/services/instance/upstreams.hbs | 24 +- .../templates/dc/services/show/instances.hbs | 7 +- .../dc/services/show/intentions/index.hbs | 21 +- .../templates/dc/services/show/services.hbs | 14 +- .../app/templates/dc/services/show/tags.hbs | 11 +- .../templates/dc/services/show/upstreams.hbs | 7 +- .../consul-ui/translations/routes/en-us.yaml | 268 ++++++++++++++++-- 22 files changed, 385 insertions(+), 196 deletions(-) create mode 100644 .changelog/12354.txt diff --git a/.changelog/12354.txt b/.changelog/12354.txt new file mode 100644 index 000000000..a81bb29bc --- /dev/null +++ b/.changelog/12354.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Include details on ACL policy dispositions required for unauthorized views +``` diff --git a/ui/packages/consul-lock-sessions/app/templates/dc/nodes/show/sessions.hbs b/ui/packages/consul-lock-sessions/app/templates/dc/nodes/show/sessions.hbs index b868871f7..b6cb1107a 100644 --- a/ui/packages/consul-lock-sessions/app/templates/dc/nodes/show/sessions.hbs +++ b/ui/packages/consul-lock-sessions/app/templates/dc/nodes/show/sessions.hbs @@ -70,17 +70,18 @@ as |route|> - -

- Welcome to Lock Sessions -

-
- - -

- Consul provides a session mechanism which can be used to build distributed locks. Sessions act as a binding layer between nodes, health checks, and key/value data. There are currently no lock sessions present, or you may not have permission to view lock sessions. -

-
+ +

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

+
+ + {{t 'routes.dc.nodes.show.sessions.empty.body' + htmlSafe=true + }} + diff --git a/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/index.hbs b/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/index.hbs index d68a2ec88..f61a94347 100644 --- a/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/index.hbs @@ -90,21 +90,16 @@ as |route|> >

- {{#if (gt items.length 0)}} - No auth methods found - {{else}} - Welcome to Auth Methods - {{/if}} + {{t 'routes.dc.auth-methods.index.empty.header' + items=items.length + }}

-

- {{#if (gt items.length 0)}} - No auth methods where found matching that search, or you may not have access to view the auth methods you are searching for. - {{else}} - There don't seem to be any auth methods, or you may not have access to view auth methods yet. - {{/if}} -

+ {{t 'routes.dc.auth-methods.index.empty.body' + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/acls/roles/index.hbs b/ui/packages/consul-ui/app/templates/dc/acls/roles/index.hbs index 17d398429..a1b76fb63 100644 --- a/ui/packages/consul-ui/app/templates/dc/acls/roles/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/acls/roles/index.hbs @@ -91,21 +91,16 @@ as |route|> >

- {{#if (gt items.length 0)}} - No roles found - {{else}} - Welcome to Roles - {{/if}} + {{t 'routes.dc.acls.roles.index.empty.header' + items=items.length + }}

-

- {{#if (gt items.length 0)}} - No roles where found matching that search, or you may not have access to view the roles you are searching for. - {{else}} - There don't seem to be any roles, or you may not have access to view roles yet. - {{/if}} -

+ {{t 'routes.dc.acls.roles.index.empty.body' + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/kv/index.hbs b/ui/packages/consul-ui/app/templates/dc/kv/index.hbs index 100e6144d..97858ca95 100644 --- a/ui/packages/consul-ui/app/templates/dc/kv/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/kv/index.hbs @@ -178,28 +178,23 @@ as |sort filters parent items|}} >

- {{#if (gt items.length 0)}} - No K/V pairs found - {{else}} - Welcome to Key/Value - {{/if}} + {{t 'routes.dc.kv.index.empty.header' + items=items.length + }}

-

- {{#if (gt items.length 0)}} - No K/V pairs where found matching that search, or you may not have access to view the K/V pairs you are searching for. - {{else}} - You don't have any K/V pairs, or you may not have access to view K/V pairs yet. - {{/if}} -

+ {{t 'routes.dc.kv.index.empty.body' + items=items.length + htmlSafe=true + }}
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 7c75724d1..d5ba6306a 100644 --- a/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs @@ -95,17 +95,16 @@ as |route|> >

- {{#if (gt items.length 0)}} - No nodes found - {{else}} - Welcome to Nodes - {{/if}} + {{t 'routes.dc.nodes.index.empty.header' + items=items.length + }}

-

- There don't seem to be any registered nodes, or you may not have access to view nodes yet. -

+ {{t 'routes.dc.nodes.index.empty.body' + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/nodes/show/healthchecks.hbs b/ui/packages/consul-ui/app/templates/dc/nodes/show/healthchecks.hbs index ca2cb185a..8a8f9b876 100644 --- a/ui/packages/consul-ui/app/templates/dc/nodes/show/healthchecks.hbs +++ b/ui/packages/consul-ui/app/templates/dc/nodes/show/healthchecks.hbs @@ -82,10 +82,10 @@ as |route|> - {{t "routes.dc.nodes.show.healthchecks.empty" - items=items.length - htmlSafe=true - }} + {{t "routes.dc.nodes.show.healthchecks.empty" + items=items.length + htmlSafe=true + }} diff --git a/ui/packages/consul-ui/app/templates/dc/nodes/show/services.hbs b/ui/packages/consul-ui/app/templates/dc/nodes/show/services.hbs index 770386b37..2c7c67a18 100644 --- a/ui/packages/consul-ui/app/templates/dc/nodes/show/services.hbs +++ b/ui/packages/consul-ui/app/templates/dc/nodes/show/services.hbs @@ -63,9 +63,10 @@ as |route|> -

- This node has no service instances{{#if (gt items.length 0)}} matching that search{{/if}}. -

+ {{t "routes.dc.nodes.show.services.empty" + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/index.hbs b/ui/packages/consul-ui/app/templates/dc/services/index.hbs index 3d6e04933..433211d0c 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/index.hbs @@ -105,21 +105,16 @@ as |sort filters items partition nspace|}} >

- {{#if (gt items.length 0)}} - No services found - {{else}} - Welcome to Services - {{/if}} + {{t 'routes.dc.services.index.empty.header' + items=items.length + }}

-

- {{#if (gt items.length 0)}} - No services where found matching that search, or you may not have access to view the services you are searching for. - {{else}} - There don't seem to be any registered services, or you may not have access to view services yet. - {{/if}} -

+ {{t 'routes.dc.services.index.empty.body' + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance/exposedpaths.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance/exposedpaths.hbs index df7e723d6..c044d97dd 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/instance/exposedpaths.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/instance/exposedpaths.hbs @@ -7,9 +7,7 @@ as |route|> as |item proxy|}}
{{#if (gt proxy.ServiceProxy.Expose.Paths.length 0)}} -

- The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation. -

+ {{t 'routes.dc.services.instance.exposedpaths.intro' htmlSafe=true}} -

- There are no individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation. -

+ {{t 'routes.dc.services.instance.exposedpaths.empty.body' htmlSafe=true}}
{{/if}} diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs index 30830ca4c..c5282482f 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs @@ -53,19 +53,14 @@ as |route|> -

- {{t "routes.dc.services.instance.upstreams.tproxy-mode.body"}} -

+ {{t "routes.dc.services.instance.upstreams.tproxy-mode.body" + htmlSafe=true + }}
-

- - {{t "routes.dc.services.instance.upstreams.tproxy-mode.footer"}} - -

+ {{t "routes.dc.services.instance.upstreams.tproxy-mode.footer" + htmlSafe=true + }}
{{/if}} @@ -87,9 +82,10 @@ as |route|> -

- This service has no upstreams{{#if (gt items.length 0)}} matching that search{{/if}}. -

+ {{t "routes.dc.services.instance.upstreams.empty" + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/instances.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/instances.hbs index 5cd8d2297..7ee9df362 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show/instances.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show/instances.hbs @@ -75,9 +75,10 @@ as |sort filters items proxyMeta|}} -

- There are no instances{{#if (gt items.length 0)}} matching that search{{/if}}. -

+ {{t "routes.dc.services.show.instances.empty" + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/intentions/index.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/intentions/index.hbs index 003d915f6..2b127daa3 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show/intentions/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show/intentions/index.hbs @@ -94,28 +94,23 @@ as |route|> >

- {{#if (gt items.length 0)}} - No intentions found - {{else}} - Welcome to Intentions - {{/if}} + {{t 'routes.dc.services.intentions.index.empty.header' + items=items.length + }}

-

- {{#if (gt items.length 0)}} - No intentions where found matching that search, or you may not have access to view the intentions you are searching for. - {{else}} - There don't seem to be any intentions, or you may not have access to view intentions yet. - {{/if}} -

+ {{t 'routes.dc.services.intentions.index.empty.body' + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/services.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/services.hbs index 33d782863..04d568e8e 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show/services.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show/services.hbs @@ -56,10 +56,6 @@ as |route|> @filter={{filters}} /> {{/if}} -

- The following services may receive traffic from external services through this gateway. Learn more about configuring gateways in our - step-by-step guide. -

@items={{items}} as |collection|> + {{t "routes.dc.services.show.services.intro" + htmlSafe=true + }} -

- There are no linked services{{#if (gt items.length 0)}} matching that search{{/if}}. -

+ {{t "routes.dc.services.show.services.empty" + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/tags.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/tags.hbs index e94891f87..5aae2f633 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show/tags.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show/tags.hbs @@ -7,10 +7,15 @@ as |route|> {{else}} + +

+ {{t 'routes.dc.services.show.tags.empty.header'}} +

+
-

- There are no tags. -

+ {{t 'routes.dc.services.show.tags.empty.body' + htmlSafe=true + }}
{{/if}} diff --git a/ui/packages/consul-ui/app/templates/dc/services/show/upstreams.hbs b/ui/packages/consul-ui/app/templates/dc/services/show/upstreams.hbs index 72d86d0f7..1f4c8efbc 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show/upstreams.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show/upstreams.hbs @@ -82,9 +82,10 @@ as |route|> -

- There are no upstreams{{#if (gt items.length 0)}} matching that search{{/if}}. -

+ {{t "routes.dc.services.show.upstreams.empty" + items=items.length + htmlSafe=true + }}
diff --git a/ui/packages/consul-ui/translations/routes/en-us.yaml b/ui/packages/consul-ui/translations/routes/en-us.yaml index 59dd94ff1..e1b7d3559 100644 --- a/ui/packages/consul-ui/translations/routes/en-us.yaml +++ b/ui/packages/consul-ui/translations/routes/en-us.yaml @@ -18,12 +18,46 @@ dc: title: License nodes: + index: + empty: + header: | + {items, select, + 0 {Welcome to Nodes} + other {No Nodes found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any registered Nodes in this Consul cluster} + other {No Nodes were found matching your search} + }, or you may not have service:read and node:read permissions access to this view. +

show: + rtt: + title: Round Trip Time + metadata: + title: Metadata + sessions: + title: Lock Sessions + header: Welcome to Lock Sessions + body: | +

+ Consul provides a session mechanism which can be used to build distributed locks. Sessions act as a binding layer between Nodes, Health Checks, and Key/Value data. There are currently no Lock Sessions present, or you may not have key:read or session:read permissions. +

+ services: + title: Service Instances + empty: | +

+ This Node has no Service Instances{items, select, + 0 {} + other { matching that search} + }. +

healthchecks: title: Health Checks empty: |

- This node has no health checks{items, select, + This Node has no Health Checks{items, select, 0 {} other { matching that search} }. @@ -34,15 +68,65 @@ dc:

This node has a failing serf node check. The health statuses shown on this page are the statuses as they were known before the node became unreachable.

- services: - title: Service Instances - rtt: - title: Round Trip Time - sessions: - title: Lock Sessions - metadata: - title: Metadata services: + index: + empty: + header: | + {items, select, + 0 {Welcome to Services} + other {No Services found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any registered services in this Consul cluster} + other {No Services were found matching your search} + }, or you may not have service:read and node:read access to this view. Use Terraform, Kubernetes CRDs, Vault, or the Consul CLI to register Services. +

+ instance: + exposedpaths: + intro: | +

+ The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation. +

+ + empty: + body: | +

+ There are no individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation. +

+ healthchecks: + empty: | +

+ This instance has no health checks{items, select, + 0 {} + other { matching that search} + }. +

+ critical-serf-notice: + header: Failing serf check + body: | +

+ This instance has a failing serf node check. The health statuses shown on this page are the statuses as they were known before the node became unreachable. +

+ upstreams: + tproxy-mode: + header: Transparent proxy mode + body: | +

+ The upstreams listed on this page have been defined in a proxy registration. There may be more upstreams, though, as "transparent" mode is enabled on this proxy. +

+ footer: | +

+ Read the documentation +

+ empty: | +

+ This Service Instance has no Upstreams{items, select, + 0 {} + other { matching that search} + }. +

show: topology: notices: @@ -87,30 +171,168 @@ dc:

Read the documentation

+ intentions: + index: + empty: + header: | + {items, select, + 0 {Welcome to Intentions} + other {No Intentions found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any Intentions in this Consul cluster} + other {No Intentions were found matching your search} + }, or you may not have intentions:read permissions access to this view. +

+ + instances: + empty: | +

+ This Service has no Instances{items, select, + 0 {} + other { matching that search} + }. +

+ services: + intro: | +

+ The following services may receive traffic from external services through this gateway. Learn more about configuring gateways in our step-by-step guide. +

+ empty: | +

+ There are no Services{items, select, + 0 {} + other { matching that search} + }. +

+ tags: + empty: + header: Welcome to Tags + body: | +

+ There are no tags for this Service. +

upstreams: intro: |

Upstreams are services that may receive traffic from this gateway. If you are not using Consul DNS, please make sure your Host: header uses the correct domain name for the gateway to correctly proxy to its upstreams. Learn more about configuring gateways in our documentation.

- instance: - healthchecks: empty: |

- This instance has no health checks{items, select, + This Service has no Upstreams{items, select, 0 {} other { matching that search} }.

- critical-serf-notice: - header: Failing serf check - body: | -

- This instance has a failing serf node check. The health statuses shown on this page are the statuses as they were known before the node became unreachable. -

- upstreams: - tproxy-mode: - header: Transparent proxy mode - body: The upstreams listed on this page have been defined in a proxy registration. There may be more upstreams, though, as "transparent" mode is enabled on this proxy. - footer: Read the documentation + routing-config: source: Routing Configuration + intentions: + index: + empty: + header: | + {items, select, + 0 {Welcome to Intentions} + other {No Intentions found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any Intentions in this Consul cluster} + other {No Intentions were found matching your search} + }, or you may not have intentions:read permissions access to this view. +

+ kv: + index: + empty: + header: | + {items, select, + 0 {Welcome to Key/Value} + other {No Key/Values found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any K/V pairs in this Consul cluster yet} + other {No K/V pairs were found matching your search} + }, or you may not have key:read permissions access to this view. +

+ acls: + tokens: + index: + empty: + header: | + {items, select, + 0 {Welcome to Tokens} + other {No Tokens found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any Tokens} + other {No Tokens were found matching your search} + }, or you may not have acl:read permissions to view Tokens yet. +

+ policies: + index: + empty: + header: | + {items, select, + 0 {Welcome to Policies} + other {No Policies found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any Policies} + other {No Policies were found matching your search} + }, or you may not have acl:read permissions to view Policies yet. +

+ roles: + index: + empty: + header: | + {items, select, + 0 {Welcome to Roles} + other {No Roles found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any Roles} + other {No Roles were found matching your search} + }, or you may not have acl:read permissions to view Roles yet. +

+ auth-methods: + show: + binding-rules: + empty: + header: No Binding Rules + body: | +

+ Binding rules allow an operator to express a systematic way of automatically linking roles and service identities to newly created tokens without operator intervention. +

+ nspace-rules: + empty: + header: No Namespace Rules + body: | +

+ A set of rules that can control which namespace tokens created via this auth method will be created within. Unlike binding rules, the first matching namespace rule wins. +

+ + index: + empty: + header: | + {items, select, + 0 {Welcome to Auth Methods} + other {No Auth Methods found} + } + body: | +

+ {items, select, + 0 {There don't seem to be any Auth Methods} + other {No Auth Methods were found matching your search} + }, or you may not have acl:read permissions to view Auth Methods yet. +