2020-01-28 14:25:52 +00:00
|
|
|
{{title 'Intentions'}}
|
2020-07-09 09:08:47 +00:00
|
|
|
<DataLoader @src={{concat '/' nspace '/' dc '/intentions'}} as |api|>
|
|
|
|
|
|
|
|
<BlockSlot @name="error">
|
|
|
|
<AppError @error={{api.error}} />
|
|
|
|
</BlockSlot>
|
|
|
|
|
|
|
|
<BlockSlot @name="loaded">
|
2020-08-11 17:02:51 +00:00
|
|
|
{{#let (or sortBy "Action:asc") as |sort|}}
|
2020-07-09 09:08:47 +00:00
|
|
|
<AppView @class="intention list">
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
|
|
|
Intentions <em>{{format-number api.data.length}} total</em>
|
|
|
|
</h1>
|
|
|
|
<label for="toolbar-toggle"></label>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
|
|
|
<a data-test-create href="{{href-to 'dc.intentions.create'}}" class="type-create">Create</a>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="toolbar">
|
|
|
|
{{#if (gt api.data.length 0) }}
|
|
|
|
<SearchBar
|
|
|
|
@value={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
2020-08-11 17:02:51 +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 "Action:asc" "Allow to Deny")
|
|
|
|
(array "Action:desc" "Deny to Allow")
|
|
|
|
(array "SourceName:asc" "Source: A to Z")
|
|
|
|
(array "SourceName:desc" "Source: Z to A")
|
|
|
|
(array "DestinationName:asc" "Destination: A to Z")
|
|
|
|
(array "DestinationName:desc" "Destination: Z to A")
|
|
|
|
(array "Precedence:asc" "Precedence: Ascending")
|
|
|
|
(array "Precedence:desc" "Precedence: Descending")
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
|
|
|
{{get selectable sort}}
|
|
|
|
{{/let}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<Optgroup @label="Permission">
|
|
|
|
<Option @value="Action:asc" @selected={{eq "Action:asc" sort}}>Allow to Deny</Option>
|
|
|
|
<Option @value="Action:desc" @selected={{eq "Action:desc" sort}}>Deny to Allow</Option>
|
|
|
|
</Optgroup>
|
|
|
|
<Optgroup @label="Source">
|
|
|
|
<Option @value="SourceName:asc" @selected={{eq "SourceName:asc" sort}}>A to Z</Option>
|
|
|
|
<Option @value="SourceName:desc" @selected={{eq "SourceName:desc" sort}}>Z to A</Option>
|
|
|
|
</Optgroup>
|
|
|
|
<Optgroup @label="Destination">
|
|
|
|
<Option @value="DestinationName:asc" @selected={{eq "DestinationName:asc" sort}}>A to Z</Option>
|
|
|
|
<Option @value="DestinationName:desc" @selected={{eq "DestinationName:desc" sort}}>Z to A</Option>
|
|
|
|
</Optgroup>
|
|
|
|
<Optgroup @label="Precedence">
|
|
|
|
<Option @value="Precedence:asc" @selected={{eq "Precedence:asc" sort}}>Ascending</Option>
|
|
|
|
<Option @value="Precedence:desc" @selected={{eq "Precedence:desc" sort}}>Descending</Option>
|
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
|
|
|
</BlockSlot>
|
|
|
|
</SearchBar>
|
2020-07-09 09:08:47 +00:00
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
2020-08-11 17:02:51 +00:00
|
|
|
{{#let (sort-by (comparator 'intention' sort) api.data) as |sorted|}}
|
2020-07-28 15:06:32 +00:00
|
|
|
<ChangeableSet @dispatcher={{searchable 'intention' sorted}} @terms={{search}}>
|
2020-07-09 09:08:47 +00:00
|
|
|
<BlockSlot @name="content" as |filtered|>
|
|
|
|
<ConsulIntentionList
|
|
|
|
@items={{filtered}}
|
|
|
|
@ondelete={{refresh-route}}
|
|
|
|
>
|
|
|
|
<EmptyState @allowLogin={{true}}>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h2>
|
|
|
|
{{#if (gt api.data.length 0)}}
|
|
|
|
No intentions found
|
|
|
|
{{else}}
|
|
|
|
Welcome to Intentions
|
|
|
|
{{/if}}
|
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
|
|
|
{{#if (gt api.data.length 0)}}
|
|
|
|
No intentions where found matching that search, or you may not have access to view the intentions you are searching for.
|
|
|
|
{{else}}
|
|
|
|
There don't seem to be any intentions, or you may not have access to view intentions yet.
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
|
|
|
<li class="docs-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_URL'}}/commands/intention" rel="noopener noreferrer" target="_blank">Documentation on intentions</a>
|
|
|
|
</li>
|
|
|
|
<li class="learn-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/getting-started/connect" rel="noopener noreferrer" target="_blank">Read the guide</a>
|
|
|
|
</li>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</ConsulIntentionList>
|
2020-05-27 10:23:21 +00:00
|
|
|
</BlockSlot>
|
2020-07-09 09:08:47 +00:00
|
|
|
</ChangeableSet>
|
2020-07-28 15:06:32 +00:00
|
|
|
{{/let}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2020-07-09 09:08:47 +00:00
|
|
|
</AppView>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|