2021-01-25 18:13:54 +00:00
|
|
|
<SearchBar
|
|
|
|
class="consul-service-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.search-bar." search.status.key)
|
|
|
|
default=(array
|
|
|
|
(concat "common.search." search.status.key)
|
|
|
|
(concat "common.consul." search.status.key)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(t (concat "components.consul.service.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|}}
|
|
|
|
<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.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|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option class="value-{{state}}" @value={{state}} @selected={{includes state @filter.status.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t (concat "common.consul." 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>
|
|
|
|
<search.Select
|
|
|
|
@position="left"
|
|
|
|
@onchange={{action @filter.kind.change}}
|
|
|
|
@multiple={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
{{t "components.consul.service.search-bar.kind"}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option @value="service" @selected={{includes 'service' @filter.kind.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t "common.consul.service"}}
|
|
|
|
</Option>
|
|
|
|
<Optgroup
|
|
|
|
@label={{t "common.consul.gateway"}}
|
|
|
|
>
|
|
|
|
{{#each (array "ingress-gateway" "terminating-gateway" "mesh-gateway") as |kind|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option @value={{kind}} @selected={{includes kind @filter.kind.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t (concat "common.consul." kind)}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
|
|
|
</Optgroup>
|
|
|
|
<Optgroup
|
|
|
|
@label={{t "common.consul.mesh"}}
|
|
|
|
>
|
|
|
|
{{#each (array "in-mesh" "not-in-mesh") as |state|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option @value={{state}} @selected={{includes state @filter.kind.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t (concat "common.search." state)}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</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|}}
|
2021-12-06 11:06:33 +00:00
|
|
|
{{#let
|
|
|
|
(reject-by 'Partition' @partition @partitions)
|
|
|
|
as |nonDefaultPartitions|}}
|
|
|
|
{{#if (gt nonDefaultPartitions.length 0)}}
|
|
|
|
<Optgroup
|
|
|
|
@label={{t 'common.brand.consul'}}
|
|
|
|
>
|
|
|
|
{{#each @partitions as |partition|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option class="partition" @value={{partition}} @selected={{includes partition @filter.source.value}}>
|
2021-12-06 11:06:33 +00:00
|
|
|
{{partition}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
|
|
|
</Optgroup>
|
|
|
|
{{/if}}
|
|
|
|
{{/let}}
|
|
|
|
|
|
|
|
{{#if (gt @sources.length 0)}}
|
|
|
|
<Optgroup
|
|
|
|
@label={{t 'common.search.integrations'}}
|
|
|
|
>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{#each @sources as |source|}}
|
2022-06-08 15:07:51 +00:00
|
|
|
<Option class={{source}} @value={{source}} @selected={{includes source @filter.source.value}}>
|
2021-01-25 18:13:54 +00:00
|
|
|
{{t (concat "common.brand." source)}}
|
|
|
|
</Option>
|
|
|
|
{{/each}}
|
2022-06-30 14:47:04 +00:00
|
|
|
<Option class="consul" @value='consul' @selected={{includes 'consul' @filter.source.value}}>
|
|
|
|
{{t 'common.brand.consul'}}
|
|
|
|
</Option>
|
2021-12-06 11:06:33 +00:00
|
|
|
</Optgroup>
|
|
|
|
{{/if}}
|
2021-01-25 18:13:54 +00:00
|
|
|
{{/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">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<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>
|
|
|
|
</Optgroup>
|
|
|
|
<Optgroup @label={{t "common.consul.service-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>
|
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</search.Select>
|
|
|
|
</:sort>
|
|
|
|
</SearchBar>
|