2020-01-28 14:25:52 +00:00
|
|
|
{{title 'Nodes'}}
|
2020-06-17 13:19:50 +00:00
|
|
|
<EventSource @src={{items}} />
|
2020-08-28 13:21:03 +00:00
|
|
|
{{#let (or sortBy "Node:asc") as |sort|}}
|
|
|
|
<AppView @class="node list">
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
|
|
|
Nodes <em>{{format-number items.length}} total</em>
|
|
|
|
</h1>
|
|
|
|
<label for="toolbar-toggle"></label>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="toolbar">
|
|
|
|
{{#if (gt items.length 0) }}
|
2020-05-29 15:42:46 +00:00
|
|
|
<SearchBar
|
|
|
|
@value={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
2020-08-28 13:21:03 +00:00
|
|
|
class="with-sort"
|
|
|
|
>
|
|
|
|
<BlockSlot @name="secondary">
|
|
|
|
<PopoverSelect
|
|
|
|
@position="right"
|
|
|
|
@onchange={{action (mut sortBy) value='target.selected'}}
|
|
|
|
@multiple={{false}}
|
|
|
|
as |components|>
|
|
|
|
<BlockSlot @name="selected">
|
|
|
|
<span>
|
|
|
|
{{#let (from-entries (array
|
|
|
|
(array "Node:asc" "A to Z")
|
|
|
|
(array "Node:desc" "Z to A")
|
|
|
|
(array "Status:asc" "Unhealthy to Healthy")
|
|
|
|
(array "Status:desc" "Healthy to Unhealthy")
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
|
|
|
{{get selectable sort}}
|
|
|
|
{{/let}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<Optgroup @label="Name">
|
|
|
|
<Option @value="Node:asc" @selected={{eq "Node:asc" sort}}>A to Z</Option>
|
|
|
|
<Option @value="Node:desc" @selected={{eq "Node:desc" sort}}>Z to A</Option>
|
|
|
|
</Optgroup>
|
|
|
|
<Optgroup @label="Health Status">
|
|
|
|
<Option @value="Status:asc" @selected={{eq "Status:asc" sort}}>Unhealthy to Healthy</Option>
|
|
|
|
<Option @value="Status:desc" @selected={{eq "Status:desc" sort}}>Healthy to Unhealthy</Option>
|
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
2020-05-27 10:23:21 +00:00
|
|
|
</BlockSlot>
|
2020-08-28 13:21:03 +00:00
|
|
|
</SearchBar>
|
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
{{#let (sort-by (comparator 'node' sort) items) as |sorted|}}
|
|
|
|
<ChangeableSet @dispatcher={{searchable 'node' sorted}} @terms={{search}}>
|
|
|
|
<BlockSlot @name="set" as |filtered|>
|
|
|
|
<ConsulNodeList @items={{filtered}} @leader={{leader}} />
|
2020-05-27 10:23:21 +00:00
|
|
|
</BlockSlot>
|
2020-08-28 13:21:03 +00:00
|
|
|
<BlockSlot @name="empty">
|
|
|
|
<EmptyState>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
|
|
|
There don't seem to be any registered nodes, or you may not have access to view nodes yet.
|
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</BlockSlot>
|
|
|
|
</ChangeableSet>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</AppView>
|
2020-05-29 15:42:46 +00:00
|
|
|
{{/let}}
|