2021-04-06 12:40:40 +00:00
|
|
|
<Route
|
|
|
|
@name={{routeName}}
|
|
|
|
@title="Roles"
|
|
|
|
as |route|>
|
2021-09-15 18:50:11 +00:00
|
|
|
<DataLoader
|
|
|
|
@src={{
|
|
|
|
uri '/${partition}/${nspace}/${dc}/roles'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
)}}
|
|
|
|
as |loader|>
|
|
|
|
|
|
|
|
<BlockSlot @name="error">
|
|
|
|
{{#if (eq loader.error.status '401')}}
|
|
|
|
<Consul::Acl::Disabled />
|
|
|
|
{{else}}
|
|
|
|
<AppError
|
|
|
|
@error={{loader.error}}
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
|
|
|
|
<BlockSlot @name="loaded">
|
2021-04-06 12:40:40 +00:00
|
|
|
{{#let
|
2020-07-29 14:55:38 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
(hash
|
|
|
|
value=(or sortBy "Name:asc")
|
|
|
|
change=(action (mut sortBy) value="target.selected")
|
|
|
|
)
|
2021-01-25 18:13:54 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
(hash
|
|
|
|
searchproperty=(hash
|
|
|
|
value=(if (not-eq searchproperty undefined)
|
|
|
|
(split searchproperty ',')
|
|
|
|
searchProperties
|
|
|
|
)
|
|
|
|
change=(action (mut searchproperty) value="target.selectedItems")
|
|
|
|
default=searchProperties
|
2021-01-25 18:13:54 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-09-15 18:50:11 +00:00
|
|
|
loader.data
|
2021-01-25 18:13:54 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
as |sort filters items|}}
|
2021-01-25 18:13:54 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
<AppView
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
>
|
|
|
|
<BlockSlot @name="notification" as |status type item error|>
|
|
|
|
<Consul::Role::Notifications
|
|
|
|
@type={{type}}
|
|
|
|
@status={{status}}
|
|
|
|
@item={{item}}
|
|
|
|
@error={{error}}
|
|
|
|
/>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
2021-09-15 18:50:11 +00:00
|
|
|
<route.Title @title="Roles" />
|
2021-04-06 12:40:40 +00:00
|
|
|
</h1>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2021-09-27 16:20:44 +00:00
|
|
|
{{#if (can "create roles")}}
|
2021-04-06 12:40:40 +00:00
|
|
|
<a data-test-create href="{{href-to 'dc.acls.roles.create'}}" class="type-create">Create</a>
|
2021-09-27 16:20:44 +00:00
|
|
|
{{/if}}
|
2021-04-06 12:40:40 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="toolbar">
|
|
|
|
{{#if (gt items.length 0) }}
|
|
|
|
<Consul::Role::SearchBar
|
|
|
|
@search={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
2020-12-01 15:45:09 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
@sort={{sort}}
|
2020-12-01 15:45:09 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
@filter={{filters}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
<DataCollection
|
|
|
|
@type="role"
|
|
|
|
@sort={{sort.value}}
|
|
|
|
@filters={{filters}}
|
|
|
|
@search={{search}}
|
|
|
|
@items={{items}}
|
|
|
|
as |collection|>
|
|
|
|
<collection.Collection>
|
|
|
|
<Consul::Role::List
|
|
|
|
@items={{collection.items}}
|
|
|
|
@ondelete={{route-action 'delete'}}
|
|
|
|
/>
|
|
|
|
</collection.Collection>
|
|
|
|
<collection.Empty>
|
|
|
|
<EmptyState
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h2>
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
No roles found
|
|
|
|
{{else}}
|
|
|
|
Welcome to Roles
|
|
|
|
{{/if}}
|
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
No roles where found matching that search, or you may not have access to view the roles you are searching for.
|
|
|
|
{{else}}
|
|
|
|
There don't seem to be any roles, or you may not have access to view roles yet.
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
|
|
|
<li class="docs-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_URL'}}/commands/acl/role" rel="noopener noreferrer" target="_blank">Documentation on roles</a>
|
|
|
|
</li>
|
|
|
|
<li class="learn-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_API_URL'}}/acl/roles.html" rel="noopener noreferrer" target="_blank">Read the API Docs</a>
|
|
|
|
</li>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</collection.Empty>
|
|
|
|
</DataCollection>
|
|
|
|
</BlockSlot>
|
|
|
|
</AppView>
|
|
|
|
{{/let}}
|
2021-09-15 18:50:11 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|
2021-04-06 12:40:40 +00:00
|
|
|
</Route>
|