John Cowen 4743ab045e ui: Upstream Instance Search and Sort (#9172)
* ui: Add predicate, comparator and necessary files for the search/sort

* Implement search and sort for upstream instance list

* ui: Tweak CSS so its all part of the component

* Remove the old proxy test attribute
2020-11-13 10:27:19 +00:00

37 lines
1.0 KiB
Handlebars

<div class="tab-section">
<div role="tabpanel">
{{#let (or sortBy "DestinationName:asc") as |sort|}}
{{#if (gt proxy.Service.Proxy.Upstreams.length 0)}}
<input type="checkbox" id="toolbar-toggle" />
<Consul::UpstreamInstance::SearchBar
@search={{search}}
@onsearch={{action (mut search) value="target.value"}}
@sort={{sort}}
@onsort={{action (mut sortBy) value="target.selected"}}
/>
<Consul::UpstreamInstance::List
@search={{search}}
@sort={{sort}}
@items={{proxy.Service.Proxy.Upstreams}}
@dc={{dc}}
@nspace={{nspace}}
>
<:empty>
<EmptyState>
<BlockSlot @name="body">
<p>
{{#if search.length}}
No upstreams where found matching that search.
{{else}}
This service has no upstreams.
{{/if}}
</p>
</BlockSlot>
</EmptyState>
</:empty>
</Consul::UpstreamInstance::List>
{{/if}}
{{/let}}
</div>
</div>