Browse Source

updates in ui templates to display consul version with filter and sorts

pull/17754/head
Vijay Srinivas 1 year ago committed by Vijay
parent
commit
27f34ce1c2
  1. 12
      ui/packages/consul-ui/app/components/consul/node/list/index.hbs
  2. 41
      ui/packages/consul-ui/app/components/consul/node/search-bar/index.hbs
  3. 8
      ui/packages/consul-ui/app/templates/dc/nodes/index.hbs

12
ui/packages/consul-ui/app/components/consul/node/list/index.hbs

@ -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>

41
ui/packages/consul-ui/app/components/consul/node/search-bar/index.hbs

@ -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|}}
@ -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
@ -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|
}}
@ -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>

8
ui/packages/consul-ui/app/templates/dc/nodes/index.hbs

@ -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>
@ -61,6 +66,7 @@
@onsearch={{action (mut search) value='target.value'}}
@sort={{sort}}
@filter={{filters}}
@versions={{versions}}
/>
{{/if}}
</BlockSlot>

Loading…
Cancel
Save