2020-12-01 15:45:09 +00:00
|
|
|
<form
|
|
|
|
class="consul-policy-search-bar filter-bar"
|
|
|
|
...attributes
|
|
|
|
>
|
|
|
|
<div class="search">
|
|
|
|
<FreetextFilter
|
|
|
|
@onsearch={{action @onsearch}}
|
|
|
|
@value={{@search}}
|
|
|
|
@placeholder="Search"
|
|
|
|
>
|
|
|
|
<PopoverSelect
|
|
|
|
class="type-search-properties"
|
|
|
|
@position="right"
|
|
|
|
@onchange={{action @onfilter.searchproperty}}
|
|
|
|
@multiple={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
Search across
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<Option @value="Name" @selected={{contains 'Name' @filter.searchproperties}}>Name</Option>
|
|
|
|
<Option @value="Description" @selected={{contains 'Description' @filter.searchproperties}}>Description</Option>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
|
|
|
</FreetextFilter>
|
|
|
|
</div>
|
2020-09-01 18:13:11 +00:00
|
|
|
<div class="filters">
|
|
|
|
<PopoverSelect
|
|
|
|
class="select-dcs"
|
|
|
|
@position="left"
|
2020-12-01 15:45:09 +00:00
|
|
|
@onchange={{action @onfilter.dc}}
|
2020-09-01 18:13:11 +00:00
|
|
|
@multiple={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
Datacenters
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
{{#each dcs as |dc|}}
|
2020-12-01 15:45:09 +00:00
|
|
|
<Option @value={{@dc.Name}} @selected={{contains dc.Name @filter.dcs}}>{{dc.Name}}</Option>
|
2020-09-01 18:13:11 +00:00
|
|
|
{{/each}}
|
|
|
|
{{/let}}
|
2020-12-01 15:45:09 +00:00
|
|
|
<DataSource @src="/*/*/datacenters" @loading="lazy" @onchange={{action (mut this.dcs) value="data"}} />
|
2020-09-01 18:13:11 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
|
|
|
<PopoverSelect
|
|
|
|
class="select-type"
|
|
|
|
@position="left"
|
2020-12-01 15:45:09 +00:00
|
|
|
@onchange={{action @onfilter.kind}}
|
2020-09-01 18:13:11 +00:00
|
|
|
@multiple={{true}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
Type
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
2020-12-01 15:45:09 +00:00
|
|
|
<Option @value="global-management" @selected={{contains 'global-management' @filter.kinds}}>Global Management</Option>
|
|
|
|
<Option @value="standard" @selected={{contains 'standard' @filter.kinds}}>Standard</Option>
|
2020-09-01 18:13:11 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
|
|
|
</div>
|
|
|
|
<div class="sort">
|
|
|
|
<PopoverSelect
|
|
|
|
class="type-sort"
|
|
|
|
data-test-sort-control
|
|
|
|
@position="right"
|
2020-12-01 15:45:09 +00:00
|
|
|
@onchange={{action @onsort}}
|
2020-09-01 18:13:11 +00:00
|
|
|
@multiple={{false}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
{{#let (from-entries (array
|
|
|
|
(array "Name:asc" "A to Z")
|
|
|
|
(array "Name:desc" "Z to A")
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
2020-12-01 15:45:09 +00:00
|
|
|
{{get selectable @sort}}
|
2020-09-01 18:13:11 +00:00
|
|
|
{{/let}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<Optgroup @label="Name">
|
2020-12-01 15:45:09 +00:00
|
|
|
<Option @value="Name:asc" @selected={{eq "Name:asc" @sort}}>A to Z</Option>
|
|
|
|
<Option @value="Name:desc" @selected={{eq "Name:desc" @sort}}>Z to A</Option>
|
2020-09-01 18:13:11 +00:00
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
|
|
|
</div>
|
|
|
|
</form>
|