diff --git a/ui-v2/app/components/consul-metadata-list/README.mdx b/ui-v2/app/components/consul-metadata-list/README.mdx new file mode 100644 index 000000000..cb5c04d79 --- /dev/null +++ b/ui-v2/app/components/consul-metadata-list/README.mdx @@ -0,0 +1,27 @@ +## ConsulMetadataList + +`` + +A presentational component for presenting Consul Metadata + +### Arguments + +| Argument/Attribute | Type | Default | Description | +| --- | --- | --- | --- | +| `items` | `array` | | A an array of entries or `[key, value]` pairs as returned by `Object.entries()` | + +### Example + +The following example shows how to construct the required structure from the +Consul API using a `object-entries` helper. + +```handlebars + +``` + +### See + +- [Component Source Code](./index.js) +- [TemplateSource Code](./index.hbs) + +--- diff --git a/ui-v2/app/components/consul-metadata-list/index.hbs b/ui-v2/app/components/consul-metadata-list/index.hbs new file mode 100644 index 000000000..3d1febfaa --- /dev/null +++ b/ui-v2/app/components/consul-metadata-list/index.hbs @@ -0,0 +1,19 @@ + + + Key + Value + + + + + {{object-at 0 item}} + + + + {{object-at 1 item}} + + + diff --git a/ui-v2/app/components/consul-metadata-list/index.js b/ui-v2/app/components/consul-metadata-list/index.js new file mode 100644 index 000000000..479865264 --- /dev/null +++ b/ui-v2/app/components/consul-metadata-list/index.js @@ -0,0 +1,5 @@ +import Component from '@ember/component'; + +export default Component.extend({ + tagName: '', +}); diff --git a/ui-v2/app/templates/dc/nodes/-metadata.hbs b/ui-v2/app/templates/dc/nodes/-metadata.hbs index bd1936d99..d19bae58a 100644 --- a/ui-v2/app/templates/dc/nodes/-metadata.hbs +++ b/ui-v2/app/templates/dc/nodes/-metadata.hbs @@ -1,25 +1,5 @@ {{#if item.Meta}} - {{#with (object-entries item.Meta) as |meta|}} - - - Key - Value - - - - - {{object-at 0 item}} - - - - {{object-at 1 item}} - - - - {{/with}} + {{else}}

This node has no meta data. diff --git a/ui-v2/app/templates/dc/services/-metadata.hbs b/ui-v2/app/templates/dc/services/-metadata.hbs index e1061be4c..8785b0341 100644 --- a/ui-v2/app/templates/dc/services/-metadata.hbs +++ b/ui-v2/app/templates/dc/services/-metadata.hbs @@ -1,25 +1,5 @@ {{#if item.Meta}} - {{#with (object-entries item.Meta) as |meta|}} - - - Key - Value - - - - - {{object-at 0 item}} - - - - {{object-at 1 item}} - - - - {{/with}} + {{else}}

This instance has no meta data.