2020-01-28 14:25:52 +00:00
|
|
|
{{#if isAuthorized }}
|
|
|
|
{{title 'Policies'}}
|
|
|
|
{{else}}
|
|
|
|
{{title 'Access Controls'}}
|
|
|
|
{{/if}}
|
2020-07-29 18:36:09 +00:00
|
|
|
|
2020-08-11 17:02:51 +00:00
|
|
|
{{#let (or sortBy "Name:asc") as |sort|}}
|
2020-04-08 17:03:18 +00:00
|
|
|
<AppView
|
|
|
|
@class="policy list"
|
|
|
|
@loading={{isLoading}}
|
|
|
|
@authorized={{isAuthorized}}
|
|
|
|
@enabled={{isEnabled}}
|
|
|
|
>
|
2020-02-19 19:26:38 +00:00
|
|
|
<BlockSlot @name="notification" as |status type|>
|
2020-01-22 12:08:29 +00:00
|
|
|
{{partial 'dc/acls/policies/notifications'}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="header">
|
2020-01-22 12:08:29 +00:00
|
|
|
<h1>
|
|
|
|
Access Controls
|
|
|
|
</h1>
|
2020-05-07 13:57:15 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="nav">
|
|
|
|
{{#if isAuthorized }}
|
|
|
|
{{partial 'dc/acls/nav'}}
|
|
|
|
{{/if}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="disabled">
|
2020-01-22 12:08:29 +00:00
|
|
|
{{partial 'dc/acls/disabled'}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="authorization">
|
2020-01-22 12:08:29 +00:00
|
|
|
{{partial 'dc/acls/authorization'}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2020-01-22 12:08:29 +00:00
|
|
|
<a data-test-create href="{{href-to 'dc.acls.policies.create'}}" class="type-create">Create</a>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2020-07-29 18:36:09 +00:00
|
|
|
<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-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 "Name:asc" "A to Z")
|
|
|
|
(array "Name:desc" "Z to A")
|
|
|
|
))
|
|
|
|
as |selectable|
|
|
|
|
}}
|
|
|
|
{{get selectable sort}}
|
|
|
|
{{/let}}
|
|
|
|
</span>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="options">
|
|
|
|
{{#let components.Optgroup components.Option as |Optgroup Option|}}
|
|
|
|
<Optgroup @label="Name">
|
|
|
|
<Option @value="Name:asc" @selected={{eq "Name:asc" sort}}>A to Z</Option>
|
|
|
|
<Option @value="Name:desc" @selected={{eq "Name:desc" sort}}>Z to A</Option>
|
|
|
|
</Optgroup>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</PopoverSelect>
|
|
|
|
</BlockSlot>
|
|
|
|
</SearchBar>
|
2020-07-29 18:36:09 +00:00
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
2020-08-11 17:02:51 +00:00
|
|
|
{{#let (sort-by (comparator 'policy' sort) items) as |sorted|}}
|
2020-07-29 18:36:09 +00:00
|
|
|
<ChangeableSet @dispatcher={{searchable 'policy' sorted}} @terms={{search}}>
|
2020-02-19 19:26:38 +00:00
|
|
|
<BlockSlot @name="set" as |filtered|>
|
2020-06-23 09:12:04 +00:00
|
|
|
<ConsulPolicyList
|
2020-07-29 18:36:09 +00:00
|
|
|
@items={{filtered}}
|
2020-06-23 09:12:04 +00:00
|
|
|
@ondelete={{action send 'delete'}}
|
|
|
|
/>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="empty">
|
2020-05-27 10:23:21 +00:00
|
|
|
<EmptyState @allowLogin={{true}}>
|
|
|
|
<BlockSlot @name="header">
|
2020-05-29 15:42:46 +00:00
|
|
|
<h2>
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
No policies found
|
|
|
|
{{else}}
|
|
|
|
Welcome to Policies
|
|
|
|
{{/if}}
|
|
|
|
</h2>
|
2020-05-27 10:23:21 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
2020-05-29 15:42:46 +00:00
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
No policies where found matching that search, or you may not have access to view the policies you are searching for.
|
|
|
|
{{else}}
|
|
|
|
There don't seem to be any policies, or you may not have access to view policies yet.
|
|
|
|
{{/if}}
|
2020-05-27 10:23:21 +00:00
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
|
|
|
<li class="docs-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_URL'}}/commands/acl/policy" rel="noopener noreferrer" target="_blank">Documentation on policies</a>
|
|
|
|
</li>
|
|
|
|
<li class="learn-link">
|
|
|
|
<a href="{{env 'CONSUL_LEARN_URL'}}/consul/security-networking/managing-acl-policies" rel="noopener noreferrer" target="_blank">Read the guide</a>
|
|
|
|
</li>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</ChangeableSet>
|
2020-07-29 18:36:09 +00:00
|
|
|
{{/let}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2020-07-29 18:36:09 +00:00
|
|
|
</AppView>
|
|
|
|
{{/let}}
|