diff --git a/.changelog/11556.txt b/.changelog/11556.txt new file mode 100644 index 000000000..1b7fd6037 --- /dev/null +++ b/.changelog/11556.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Add upstream icons for upstreams and upstream instances +``` diff --git a/ui/packages/consul-ui/app/components/consul/intention/list/table/index.hbs b/ui/packages/consul-ui/app/components/consul/intention/list/table/index.hbs index 761dbe603..beeb91cd6 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/list/table/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/intention/list/table/index.hbs @@ -24,6 +24,7 @@ as |item index|> {{else}} {{item.SourceName}} {{/if}} + {{#if (or (can 'use nspaces') (can 'use partitions'))}} {{! TODO: slugify }} class={{concat 'nspace-' (or item.SourceNS 'default')}} >{{or item.SourceNS 'default'}} + {{/if}} @@ -44,6 +46,7 @@ as |item index|> {{else}} {{item.DestinationName}} {{/if}} + {{#if (or (can 'use nspaces') (can 'use partitions'))}} {{! TODO: slugify }} class={{concat 'nspace-' (or item.DestinationNS 'default')}} >{{or item.DestinationNS 'default'}} + {{/if}} diff --git a/ui/packages/consul-ui/app/components/consul/upstream-instance/list/README.mdx b/ui/packages/consul-ui/app/components/consul/upstream-instance/list/README.mdx new file mode 100644 index 000000000..52cee1d4a --- /dev/null +++ b/ui/packages/consul-ui/app/components/consul/upstream-instance/list/README.mdx @@ -0,0 +1,39 @@ +# Consul::UpstreamInstance::List + +```hbs + + + +``` + +A presentational component for rendering Consul Upstream Instances. Upstreams +instances are a Consul Service Instance that specifically has a relationship +with an origin Service Instance. + +Currently you have to pass in the current dc, nspace and partition so that we +can figure out whether to show things that aren't in same 'bucket' that you are +currently in in the UI. + +## Arguments + +| Argument | Type | Default | Description | +| --- | --- | --- | --- | +| `items` | `array` | | An array of Upstreams | +| `dc` | `string` | | The slug of the current dc | +| `nspace` | `string` | | The slug of the current nspace | +| `partition` | `string` | | The slug of the current partition | + +## See + +- [Possible + Occurances](/hashicorp/consul/search?q=%22Consul%3A%3AUpstreamInstance%3A%3AList%22) +- [Template Source Code](./index.hbs) + +--- diff --git a/ui/packages/consul-ui/app/components/consul/upstream-instance/list/index.hbs b/ui/packages/consul-ui/app/components/consul/upstream-instance/list/index.hbs index 3b525336d..7c605bb1b 100644 --- a/ui/packages/consul-ui/app/components/consul/upstream-instance/list/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/upstream-instance/list/index.hbs @@ -11,7 +11,21 @@

-{{#if (env 'CONSUL_NSPACES_ENABLED')}} +{{#if (can 'use partitions')}} + {{#if (not-eq item.DestinationType 'prepared_query')}} +
+
+ Admin Partition +
+
+ {{or item.DestinationPartition 'default'}} +
+
+ {{/if}} +{{/if}} +{{#if (can 'use nspaces')}} {{#if (not-eq item.DestinationType 'prepared_query')}}
+ + +``` + +A presentational component for rendering Consul Upstreams (not upstream +instances). Upstreams are a Consul Service that is specifically have a +relationship with an origin Service. The Upstream 'groups' are usually only used +for showing relationships for gateways. + +Currently you have to pass in the current dc, nspace and partition so that we +can figure out whether to show things that aren't in same 'bucket' that you are +currently in in the UI. + +## Arguments + +| Argument | Type | Default | Description | +| --- | --- | --- | --- | +| `items` | `array` | | An array of Upstreams | +| `dc` | `string` | | The slug of the current dc | +| `nspace` | `string` | | The slug of the current nspace | +| `partition` | `string` | | The slug of the current partition | + +## See + +- [Possible Occurances](/hashicorp/consul/search?q=%22Consul%3A%3AUpstream%3A%3AList%22) +- [Component Source Code](./index.js) +- [Template Source Code](./index.hbs) + +--- diff --git a/ui/packages/consul-ui/app/components/consul/upstream/list/index.hbs b/ui/packages/consul-ui/app/components/consul/upstream/list/index.hbs index 29d3720f6..66324a9be 100644 --- a/ui/packages/consul-ui/app/components/consul/upstream/list/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/upstream/list/index.hbs @@ -24,6 +24,18 @@ as |item index|> {{/if}}
+{{#if (and (can 'use partitions') (not-eq item.Partition @partition))}} +
+
+ Admin Partition +
+
+ {{item.Partition}} +
+
+{{/if}} @items={{collection.items}} @dc={{dc}} @nspace={{nspace}} + @partition={{partition}} />