2020-01-28 14:25:52 +00:00
{{ # if isAuthorized }}
2020-11-18 11:11:30 +00:00
{{ page-title 'Tokens' }}
2020-01-28 14:25:52 +00:00
{{ else }}
2020-11-18 11:11:30 +00:00
{{ page-title 'Access Controls' }}
2020-01-28 14:25:52 +00:00
{{ / if }}
2020-07-29 13:41:40 +00:00
2020-09-01 18:13:11 +00:00
{{ # let ( hash
2020-11-13 15:55:40 +00:00
kinds=(if kind (split kind ',') undefined)
2020-12-02 09:16:55 +00:00
searchproperties=(if (not-eq searchproperty undefined)
(split searchproperty ',')
(array 'Description' 'Policy' 'Role')
)
2020-09-01 18:13:11 +00:00
) as |filters|}}
{{ # let ( or sortBy "CreateTime:desc" ) as | sort | }}
<AppView
@authorized= {{ isAuthorized }}
@enabled= {{ isEnabled }}
>
2020-10-19 16:31:01 +00:00
<BlockSlot @name="notification" as |status type item error|>
<Consul::Token::Notifications
@type= {{ type }}
@status= {{ status }}
@item= {{ item }}
@error= {{ error }}
/>
2020-09-01 18:13:11 +00:00
</BlockSlot>
<BlockSlot @name="header">
<h1>
Access Controls
</h1>
</BlockSlot>
<BlockSlot @name="nav">
{{ # if isAuthorized }}
{{ partial 'dc/acls/nav' }}
{{ / if }}
</BlockSlot>
<BlockSlot @name="actions">
<a data-test-create href=" {{ href-to 'dc.acls.tokens.create' }} " class="type-create">Create</a>
</BlockSlot>
<BlockSlot @name="toolbar">
{{ # if ( gt items .length 0 ) }}
2020-10-14 08:03:39 +00:00
<Consul::Token::SearchBar
2020-09-01 18:13:11 +00:00
@search= {{ search }}
@onsearch= {{ action ( mut search ) value = "target.value" }}
@sort= {{ sort }}
@onsort= {{ action ( mut sortBy ) value = "target.selected" }}
@filter= {{ filters }}
@onfilter= {{ hash
2020-12-02 09:16:55 +00:00
searchproperty=(action (mut searchproperty) value="target.selectedItems")
2020-11-13 15:55:40 +00:00
kind=(action (mut kind) value="target.selectedItems")
2020-09-01 18:13:11 +00:00
}}
/>
{{ / if }}
</BlockSlot>
<BlockSlot @name="content">
{{ # if ( token / is-legacy items ) }}
2020-12-02 09:16:55 +00:00
<Notice
@type="info"
as |notice|>
<notice.Header>
<h3>Update</h3>
</notice.Header>
<notice.Body>
<p data-test-notification-update>We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our <a href=" {{ env 'CONSUL_DOCS_URL' }} /guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p>
</notice.Body>
</Notice>
2020-09-01 18:13:11 +00:00
{{ / if }}
2020-12-02 09:16:55 +00:00
<DataCollection
@type="token"
@sort= {{ sort }}
@filters= {{ filters }}
@search= {{ search }}
@items= {{ items }}
as |collection|>
<collection.Collection>
2020-10-14 08:03:39 +00:00
<Consul::Token::List
2020-12-02 09:16:55 +00:00
@items= {{ collection .items }}
2020-09-01 18:13:11 +00:00
@token= {{ token }}
2020-12-02 09:16:55 +00:00
@onuse= {{ route-action 'use' }}
@ondelete= {{ route-action 'delete' }}
@onlogout= {{ route-action 'logout' }}
@onclone= {{ route-action 'clone' }}
/>
</collection.Collection>
<collection.Empty>
2020-09-01 18:13:11 +00:00
<EmptyState @allowLogin= {{ true }} >
<BlockSlot @name="header">
<h2>
{{ # if ( gt items .length 0 ) }}
No tokens found
{{ else }}
Welcome to ACL Tokens
{{ / if }}
</h2>
</BlockSlot>
<BlockSlot @name="body">
<p>
{{ # if ( gt items .length 0 ) }}
No tokens where found matching that search, or you may not have access to view the tokens you are searching for.
{{ else }}
There don't seem to be any tokens, or you may not have access to view tokens yet.
{{ / if }}
</p>
</BlockSlot>
</EmptyState>
2020-12-02 09:16:55 +00:00
</collection.Empty>
</DataCollection>
2020-02-19 19:26:38 +00:00
</BlockSlot>
2020-09-01 18:13:11 +00:00
</AppView>
2020-07-29 13:41:40 +00:00
{{ / let }}
{{ / let }}