2021-01-25 18:13:54 +00:00
|
|
|
<SearchBar
|
|
|
|
class="consul-upstream-instance-search-bar"
|
2020-11-12 18:45:11 +00:00
|
|
|
...attributes
|
2021-01-25 18:13:54 +00:00
|
|
|
@filter={{@filter}}
|
2020-11-12 18:45:11 +00:00
|
|
|
>
|
2021-01-25 18:13:54 +00:00
|
|
|
<:status as |search|>
|
|
|
|
|
|
|
|
{{#let
|
|
|
|
|
|
|
|
(t (concat "components.consul.upstream-instance.search-bar." search.status.key ".name")
|
|
|
|
default=(array
|
|
|
|
(concat "common.search." search.status.key)
|
|
|
|
(concat "common.consul." search.status.key)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(t (concat "components.consul.upstream-instance.search-bar." search.status.value ".name")
|
|
|
|
default=(array
|
|
|
|
(concat "common.search." search.status.value)
|
|
|
|
(concat "common.consul." search.status.value)
|
|
|
|
(concat "common.brand." search.status.value)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
as |key value|}}
|
|
|
|
<search.RemoveFilter
|
|
|
|
aria-label={{t "common.ui.remove" item=(concat key " " value)}}
|
|
|
|
>
|
|
|
|
<dl>
|
|
|
|
<dt>{{key}}</dt>
|
|
|
|
<dd>{{value}}</dd>
|
|
|
|
</dl>
|
|
|
|
</search.RemoveFilter>
|
|
|
|
{{/let}}
|
|
|
|
|
|
|
|
</:status>
|
|
|
|
<:search as |search|>
|
|
|
|
<search.Search
|
|
|
|
@onsearch={{action @onsearch}}
|
|
|
|
@value={{@search}}
|
|
|
|
@placeholder={{t "common.search.search"}}
|
|
|
|
>
|
|
|
|
<search.Select
|
|
|
|
class="type-search-properties"
|
|
|
|
@position="right"
|
|
|
|
@onchange={{action @filter.searchproperty.change}}
|
|
|
|
@multiple={{true}}
|
|
|
|
@required={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
{{t "common.search.searchproperty"}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
{{#each @filter.searchproperty.default as |prop|}}
|
|
|
|
<Option @value={{prop}} @selected={{contains prop @filter.searchproperty.value}}>
|
|
|
|
{{t (concat "common.consul." (lowercase prop))}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</search.Select>
|
|
|
|
</search.Search>
|
|
|
|
</:search>
|
|
|
|
<:sort as |search|>
|
|
|
|
<search.Select
|
|
|
|
class="type-sort"
|
|
|
|
data-test-sort-control
|
2020-12-09 19:12:17 +00:00
|
|
|
@position="right"
|
2021-01-25 18:13:54 +00:00
|
|
|
@onchange={{action @sort.change}}
|
|
|
|
@multiple={{false}}
|
|
|
|
@required={{true}}
|
2020-12-09 19:12:17 +00:00
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{#let (from-entries (array
|
|
|
|
(array "DestinationName:asc" (t "common.sort.alpha.asc"))
|
|
|
|
(array "DestinationName:desc" (t "common.sort.alpha.desc"))
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
|
|
|
{{get selectable @sort.value}}
|
|
|
|
{{/let}}
|
2020-12-09 19:12:17 +00:00
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
2021-01-25 18:13:54 +00:00
|
|
|
<Option @value="DestinationName:asc" @selected={{eq "DestinationName:asc" @sort.value}}>{{t "common.sort.alpha.asc"}}</Option>
|
|
|
|
<Option @value="DestinationName:desc" @selected={{eq "DestinationName:desc" @sort.value}}>{{t "common.sort.alpha.desc"}}</Option>
|
2020-12-09 19:12:17 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
2021-01-25 18:13:54 +00:00
|
|
|
</search.Select>
|
|
|
|
</:sort>
|
|
|
|
</SearchBar>
|