2021-01-25 18:13:54 +00:00
|
|
|
<SearchBar
|
|
|
|
class="consul-service-instance-search-bar"
|
2020-12-01 15:45:09 +00:00
|
|
|
...attributes
|
2021-01-25 18:13:54 +00:00
|
|
|
@filter={{@filter}}
|
2020-12-01 15:45:09 +00:00
|
|
|
>
|
2021-01-25 18:13:54 +00:00
|
|
|
<:status as |search|>
|
|
|
|
|
|
|
|
{{#let
|
|
|
|
|
|
|
|
(t (concat "components.consul.service-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.service-instance.search-bar." search.status.key ".options." 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|}}
|
|
|
|
<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"}}
|
|
|
|
>
|
|
|
|
{{#if @filter.searchproperty}}
|
|
|
|
<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>
|
|
|
|
{{/if}}
|
|
|
|
</search.Search>
|
|
|
|
</:search>
|
|
|
|
<:filter as |search|>
|
|
|
|
<search.Select
|
|
|
|
class="type-status"
|
|
|
|
@position="left"
|
|
|
|
@onchange={{action @filter.status.change}}
|
2020-12-01 15:45:09 +00:00
|
|
|
@multiple={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t "common.consul.status"}}
|
2020-12-01 15:45:09 +00:00
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
2021-01-25 18:13:54 +00:00
|
|
|
{{#each (array "passing" "warning" "critical" "empty") as |state|}}
|
|
|
|
<Option class="value-{{state}}" @value={{state}} @selected={{contains state @filter.status.value}}>
|
|
|
|
{{t (concat "common.consul." state)
|
|
|
|
default=(array
|
|
|
|
(concat "common.search." state)
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</Option>
|
2020-12-09 13:08:30 +00:00
|
|
|
{{/each}}
|
2020-12-01 15:45:09 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
2021-01-25 18:13:54 +00:00
|
|
|
</search.Select>
|
|
|
|
{{#if (gt @sources.length 0)}}
|
|
|
|
<search.Select
|
|
|
|
class="type-source"
|
|
|
|
@position="left"
|
|
|
|
@onchange={{action @filter.source.change}}
|
|
|
|
@multiple={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
{{t "common.search.source"}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
{{#each @sources as |source|}}
|
|
|
|
<Option class={{source}} @value={{source}} @selected={{contains source @filter.source.value}}>
|
|
|
|
{{t (concat "common.brand." source)}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</search.Select>
|
|
|
|
{{/if}}
|
|
|
|
</:filter>
|
|
|
|
<:sort as |search|>
|
|
|
|
<search.Select
|
|
|
|
class="type-sort"
|
|
|
|
data-test-sort-control
|
|
|
|
@position="right"
|
|
|
|
@onchange={{action @sort.change}}
|
|
|
|
@multiple={{false}}
|
|
|
|
@required={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
{{#let (from-entries (array
|
|
|
|
(array "Name:asc" (t "common.sort.alpha.asc"))
|
|
|
|
(array "Name:desc" (t "common.sort.alpha.desc"))
|
|
|
|
(array "Status:asc" (t "common.sort.status.asc"))
|
|
|
|
(array "Status:desc" (t "common.sort.status.desc"))
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
|
|
|
{{get selectable @sort.value}}
|
|
|
|
{{/let}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
2020-09-01 18:13:11 +00:00
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
2021-01-25 18:13:54 +00:00
|
|
|
<Optgroup @label={{t "common.consul.status"}}>
|
|
|
|
<Option @value="Status:asc" @selected={{eq "Status:asc" @sort.value}}>{{t "common.sort.status.asc"}}</Option>
|
|
|
|
<Option @value="Status:desc" @selected={{eq "Status:desc" @sort.value}}>{{t "common.sort.status.desc"}}</Option>
|
2020-09-01 18:13:11 +00:00
|
|
|
</Optgroup>
|
2021-01-25 18:13:54 +00:00
|
|
|
<Optgroup @label={{t "components.consul.service-instance.search-bar.sort.name.name"}}>
|
|
|
|
<Option @value="Name:asc" @selected={{eq "Name:asc" @sort.value}}>{{t "common.sort.alpha.asc"}}</Option>
|
|
|
|
<Option @value="Name:desc" @selected={{eq "Name:desc" @sort.value}}>{{t "common.sort.alpha.desc"}}</Option>
|
2020-09-01 18:13:11 +00:00
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
2021-01-25 18:13:54 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</search.Select>
|
|
|
|
</:sort>
|
|
|
|
</SearchBar>
|