2021-01-25 18:13:54 +00:00
|
|
|
<SearchBar
|
|
|
|
class="consul-token-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.token.search-bar." search.status.key ".name")
|
|
|
|
default=(array
|
|
|
|
(concat "common.search." search.status.key)
|
|
|
|
(concat "common.consul." search.status.key)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(t (concat "components.consul.token.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"}}
|
|
|
|
>
|
|
|
|
<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|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option @value={{prop}} @selected={{includes prop @filter.searchproperty.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t (concat "common.consul." (lowercase prop))}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</search.Select>
|
|
|
|
</search.Search>
|
|
|
|
</:search>
|
|
|
|
<:filter as |search|>
|
|
|
|
<search.Select
|
|
|
|
class="type-status"
|
|
|
|
@position="left"
|
|
|
|
@onchange={{action @filter.kind.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 "components.consul.token.search-bar.kind.name"}}
|
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 "global-management" "global" "local") as |state|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option class="value-{{state}}" @value={{state}} @selected={{includes state @filter.kind.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t (concat "components.consul.token.search-bar.kind.options." state)
|
|
|
|
default=(array
|
|
|
|
(concat "common.search." state)
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
2020-12-01 15:45:09 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
2021-01-25 18:13:54 +00:00
|
|
|
</search.Select>
|
|
|
|
</: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 "CreateTime:desc" (t "common.sort.age.desc"))
|
|
|
|
(array "CreateTime:asc" (t "common.sort.age.asc"))
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
|
|
|
{{get selectable @sort.value}}
|
|
|
|
{{/let}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<Optgroup @label={{t "common.ui.creation"}}>
|
|
|
|
<Option @value="CreateTime:desc" @selected={{eq "CreateTime:desc" @sort.value}}>{{t "common.sort.age.desc"}}</Option>
|
|
|
|
<Option @value="CreateTime:asc" @selected={{eq "CreateTime:asc" @sort.value}}>{{t "common.sort.age.asc"}}</Option>
|
2020-09-01 18:13:11 +00:00
|
|
|
</Optgroup>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</search.Select>
|
|
|
|
</:sort>
|
|
|
|
</SearchBar>
|