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

pull/17754/head
Vijay Srinivas 1 year ago committed by Vijay
parent 0cf1b7077c
commit 27f34ce1c2

@ -50,5 +50,17 @@ as |item index|>
{{item.Address}} {{item.Address}}
</dd> </dd>
</dl> </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> </BlockSlot>
</ListCollection> </ListCollection>

@ -19,12 +19,14 @@
) )
) )
(t (concat "components.consul.node.search-bar." search.status.value) (if search.status.value
default=(array search.status.value
(concat "common.search." search.status.value) (t (concat "components.consul.node.search-bar." search.status.value)
(concat "common.consul." search.status.value) default=(array
(concat "common.brand." search.status.value) (concat "common.search." search.status.value)
) (concat "common.consul." search.status.value)
(concat "common.brand." search.status.value)
))
) )
as |key value|}} as |key value|}}
@ -95,6 +97,27 @@ as |key value|}}
{{/let}} {{/let}}
</BlockSlot> </BlockSlot>
</search.Select> </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> </:filter>
<:sort as |search|> <:sort as |search|>
<search.Select <search.Select
@ -112,6 +135,8 @@ as |key value|}}
(array "Node:desc" (t "common.sort.alpha.desc")) (array "Node:desc" (t "common.sort.alpha.desc"))
(array "Status:asc" (t "common.sort.status.asc")) (array "Status:asc" (t "common.sort.status.asc"))
(array "Status:desc" (t "common.sort.status.desc")) (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| 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: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> <Option @value="Node:desc" @selected={{eq "Node:desc" @sort.value}}>{{t "common.sort.alpha.desc"}}</Option>
</Optgroup> </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}} {{/let}}
</BlockSlot> </BlockSlot>
</search.Select> </search.Select>

@ -40,10 +40,15 @@
change=(action (mut searchproperty) value='target.selectedItems') change=(action (mut searchproperty) value='target.selectedItems')
default=this._searchProperties default=this._searchProperties
) )
version=(hash
value=(if this.version (split this.version ',') undefined)
change=(action (mut this.version) value='target.selectedItems')
)
) )
api.data api.data
leader.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|}} {{#let (reject-by 'Meta.synthetic-node' items) as |filtered|}}
<AppView> <AppView>
@ -61,6 +66,7 @@
@onsearch={{action (mut search) value='target.value'}} @onsearch={{action (mut search) value='target.value'}}
@sort={{sort}} @sort={{sort}}
@filter={{filters}} @filter={{filters}}
@versions={{versions}}
/> />
{{/if}} {{/if}}
</BlockSlot> </BlockSlot>

Loading…
Cancel
Save