Skip to content

Commit

Permalink
Merge 27f34ce into backport/ui/enhancement/updateNodeList/mentally-mo…
Browse files Browse the repository at this point in the history
…dern-feline
  • Loading branch information
hc-github-team-consul-core authored Jul 12, 2023
2 parents c2d00de + 27f34ce commit 16f5d31
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 7 deletions.
12 changes: 12 additions & 0 deletions ui/packages/consul-ui/app/components/consul/node/list/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,17 @@ as |item index|>
{{item.Address}}
</dd>
</dl>
<dl>
<dt>
<span>ConsulVersion</span>
</dt>
<dd>
{{!-- Displaying consul version from node meta data --}}
{{#if item.Meta.consul-version}}
<FlightIcon class='w-4 h-4' @size='24' @name='consul-color' @stretched={{true}} />
<span>v{{item.Meta.consul-version}}</span>
{{/if}}
</dd>
</dl>
</BlockSlot>
</ListCollection>
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
)
)

(t (concat "components.consul.node.search-bar." search.status.value)
default=(array
(concat "common.search." search.status.value)
(concat "common.consul." search.status.value)
(concat "common.brand." search.status.value)
)
(if search.status.value
search.status.value
(t (concat "components.consul.node.search-bar." search.status.value)
default=(array
(concat "common.search." search.status.value)
(concat "common.consul." search.status.value)
(concat "common.brand." search.status.value)
))
)

as |key value|}}
Expand Down Expand Up @@ -95,6 +97,27 @@ as |key value|}}
{{/let}}
</BlockSlot>
</search.Select>
<search.Select
class="type-version"
@position="left"
@onchange={{action @filter.version.change}}
@multiple={{false}}
as |components|>
<BlockSlot @name="selected">
<span>
{{t "common.consul.version"}}
</span>
</BlockSlot>
<BlockSlot @name="options">
{{#let components.Optgroup components.Option as |Optgroup Option|}}
{{#each @versions as |version|}}
<Option @value={{version}} @selected={{includes version @filter.version.value}}>
{{concat version ".x" }}
</Option>
{{/each}}
{{/let}}
</BlockSlot>
</search.Select>
</:filter>
<:sort as |search|>
<search.Select
Expand All @@ -112,6 +135,8 @@ as |key value|}}
(array "Node:desc" (t "common.sort.alpha.desc"))
(array "Status:asc" (t "common.sort.status.asc"))
(array "Status:desc" (t "common.sort.status.desc"))
(array "Version:asc" (t "common.sort.version.asc"))
(array "Version:desc" (t "common.sort.version.desc"))
))
as |selectable|
}}
Expand All @@ -129,6 +154,10 @@ as |key value|}}
<Option @value="Node:asc" @selected={{eq "Node:asc" @sort.value}}>{{t "common.sort.alpha.asc"}}</Option>
<Option @value="Node:desc" @selected={{eq "Node:desc" @sort.value}}>{{t "common.sort.alpha.desc"}}</Option>
</Optgroup>
<Optgroup @label={{t "common.consul.version"}}>
<Option @value="Version:asc" @selected={{eq "Version:asc" @sort.value}}>{{t "common.sort.version.asc"}}</Option>
<Option @value="Version:desc" @selected={{eq "Version:desc" @sort.value}}>{{t "common.sort.version.desc"}}</Option>
</Optgroup>
{{/let}}
</BlockSlot>
</search.Select>
Expand Down
8 changes: 7 additions & 1 deletion ui/packages/consul-ui/app/templates/dc/nodes/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@
change=(action (mut searchproperty) value='target.selectedItems')
default=this._searchProperties
)
version=(hash
value=(if this.version (split this.version ',') undefined)
change=(action (mut this.version) value='target.selectedItems')
)
)
api.data
leader.data
as |sort filters items leader|
api.data.meta.versions
as |sort filters items leader versions|
}}
{{#let (reject-by 'Meta.synthetic-node' items) as |filtered|}}
<AppView>
Expand All @@ -61,6 +66,7 @@
@onsearch={{action (mut search) value='target.value'}}
@sort={{sort}}
@filter={{filters}}
@versions={{versions}}
/>
{{/if}}
</BlockSlot>
Expand Down

0 comments on commit 16f5d31

Please sign in to comment.