mirror of
https://github.com/status-im/consul.git
synced 2025-01-13 07:14:37 +00:00
bb95738321
Adds a 'status' for the filtering/searching in the UI, without this its not super clear that you are filtering a recordset due to the menu selections being hidden once closed. You can also use the pills in this status view to delete individual filters.
74 lines
1.8 KiB
Handlebars
74 lines
1.8 KiB
Handlebars
{{page-title 'Nodes'}}
|
|
<EventSource @src={{items}} />
|
|
<EventSource @src={{leader}} />
|
|
{{#let
|
|
|
|
(hash
|
|
value=(or sortBy "Status:asc")
|
|
change=(action (mut sortBy) value="target.selected")
|
|
)
|
|
|
|
(hash
|
|
status=(hash
|
|
value=(if status (split status ',') undefined)
|
|
change=(action (mut status) value="target.selectedItems")
|
|
)
|
|
searchproperty=(hash
|
|
value=(if (not-eq searchproperty undefined)
|
|
(split searchproperty ',')
|
|
searchProperties
|
|
)
|
|
change=(action (mut searchproperty) value="target.selectedItems")
|
|
default=searchProperties
|
|
)
|
|
)
|
|
|
|
items
|
|
|
|
as |sort filters items|}}
|
|
<AppView>
|
|
<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) }}
|
|
<Consul::Node::SearchBar
|
|
@search={{search}}
|
|
@onsearch={{action (mut search) value="target.value"}}
|
|
|
|
@sort={{sort}}
|
|
|
|
@filter={{filters}}
|
|
/>
|
|
{{/if}}
|
|
</BlockSlot>
|
|
<BlockSlot @name="content">
|
|
<DataCollection
|
|
@type="node"
|
|
@sort={{sort.value}}
|
|
@filters={{filters}}
|
|
@search={{search}}
|
|
@items={{items}}
|
|
as |collection|>
|
|
<collection.Collection>
|
|
<Consul::Node::List
|
|
@items={{collection.items}}
|
|
@leader={{leader}}
|
|
/>
|
|
</collection.Collection>
|
|
<collection.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>
|
|
</collection.Empty>
|
|
</DataCollection>
|
|
</BlockSlot>
|
|
</AppView>
|
|
{{/let}} |