open-consul/ui-v2/app/templates/dc/services/index.hbs
John Cowen 7d6f5ef92a ui: refactor out the taglist component to use a recursive pattern (#7837)
* ui: refactor out the taglist component to use a recursive pattern

* Make sure simple rendering tests pass
2020-05-12 17:14:54 +00:00

44 lines
1.3 KiB
Handlebars

{{title 'Services'}}
{{#let (selectable-key-values
(array "Name:asc" "A to Z")
(array "Name:desc" "Z to A")
selected=sortBy
)
as |sort|
}}
<AppView @class="service list">
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}}
</BlockSlot>
<BlockSlot @name="header">
<h1>
Services <em>{{format-number items.length}} total</em>
</h1>
<label for="toolbar-toggle"></label>
</BlockSlot>
<BlockSlot @name="toolbar">
{{#if (gt items.length 0) }}
<CatalogToolbar
@searchable={{searchable}}
@value={{search}}
@selected={{sort.selected}}
@options={{sort.items}}
@onchange={{action (mut sortBy) value='target.selected.key'}}
/>
{{/if}}
</BlockSlot>
<BlockSlot @name="content">
<ChangeableSet @dispatcher={{searchable}}>
<BlockSlot @name="set" as |filtered|>
<ConsulServiceList @routeName="dc.services.show" @items={{sort-by sort.selected.key filtered}} @proxies={{proxies}}/>
</BlockSlot>
<BlockSlot @name="empty">
<p>
There are no services.
</p>
</BlockSlot>
</ChangeableSet>
</BlockSlot>
</AppView>
{{/let}}