2021-04-06 12:40:40 +00:00
|
|
|
<Route
|
|
|
|
@name={{routeName}}
|
|
|
|
as |route|>
|
2021-09-15 18:50:11 +00:00
|
|
|
<DataLoader
|
|
|
|
@src={{
|
|
|
|
uri '/${partition}/${nspace}/${dc}/namespaces'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
)}}
|
|
|
|
as |loader|>
|
|
|
|
|
|
|
|
<BlockSlot @name="error">
|
|
|
|
<AppError
|
|
|
|
@error={{loader.error}}
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
/>
|
|
|
|
</BlockSlot>
|
|
|
|
|
|
|
|
<BlockSlot @name="loaded">
|
2021-04-06 12:40:40 +00:00
|
|
|
{{#let
|
2021-01-25 18:13:54 +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>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
2021-09-15 18:50:11 +00:00
|
|
|
<route.Title @title="Namespaces" />
|
2021-04-06 12:40:40 +00:00
|
|
|
</h1>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2021-09-27 16:20:44 +00:00
|
|
|
{{#if (can "create nspaces")}}
|
2023-02-22 21:05:15 +00:00
|
|
|
<Hds::Button
|
|
|
|
@text='Create'
|
|
|
|
@route='dc.nspaces.create'
|
|
|
|
data-test-create
|
|
|
|
/>
|
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::Nspace::SearchBar
|
|
|
|
@search={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
2020-09-01 18:13:11 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
@sort={{sort}}
|
2020-09-01 18:13:11 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
@filter={{filters}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
2021-12-01 11:04:02 +00:00
|
|
|
<DataWriter
|
|
|
|
@sink={{uri '/${partition}/${dc}/${nspace}/nspace/'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
@type="nspace"
|
|
|
|
@label="Namespace"
|
|
|
|
@ondelete={{refresh-route}}
|
|
|
|
as |writer|>
|
|
|
|
<BlockSlot @name="removed" as |after|>
|
|
|
|
<Consul::Nspace::Notifications
|
|
|
|
{{notification
|
|
|
|
after=(action after)
|
|
|
|
}}
|
|
|
|
@type="remove"
|
|
|
|
/>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
2021-04-06 12:40:40 +00:00
|
|
|
<DataCollection
|
|
|
|
@type="nspace"
|
|
|
|
@sort={{sort.value}}
|
|
|
|
@filters={{filters}}
|
|
|
|
@search={{search}}
|
|
|
|
@items={{items}}
|
|
|
|
as |collection|>
|
|
|
|
<collection.Collection>
|
|
|
|
<Consul::Nspace::List
|
|
|
|
@items={{collection.items}}
|
2021-12-01 11:04:02 +00:00
|
|
|
@ondelete={{writer.delete}}
|
2021-04-06 12:40:40 +00:00
|
|
|
/>
|
|
|
|
</collection.Collection>
|
|
|
|
<collection.Empty>
|
|
|
|
<EmptyState
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h2>
|
2022-10-06 17:01:49 +00:00
|
|
|
{{t 'routes.dc.namespaces.index.empty.header'
|
|
|
|
items=items.length}}
|
2021-04-06 12:40:40 +00:00
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
2022-10-06 17:01:49 +00:00
|
|
|
{{t 'routes.dc.namespaces.index.empty.body'
|
|
|
|
items=items.length
|
|
|
|
canUseACLs=(can 'use acls')}}
|
2021-04-06 12:40:40 +00:00
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2023-02-22 21:05:15 +00:00
|
|
|
<li>
|
|
|
|
<Hds::Link::Standalone
|
|
|
|
@text='Documentation on namespaces'
|
|
|
|
@href="{{env 'CONSUL_DOCS_URL'}}/commands/namespace"
|
|
|
|
@icon='docs-link'
|
|
|
|
@iconPosition='trailing'
|
|
|
|
@size='small'
|
|
|
|
/>
|
2021-04-06 12:40:40 +00:00
|
|
|
</li>
|
2023-02-22 21:05:15 +00:00
|
|
|
<li>
|
|
|
|
<Hds::Link::Standalone
|
|
|
|
@text='Read the guide'
|
|
|
|
@href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/namespaces/secure-namespaces"
|
|
|
|
@icon='learn-link'
|
|
|
|
@iconPosition='trailing'
|
|
|
|
@size='small'
|
|
|
|
/>
|
2021-04-06 12:40:40 +00:00
|
|
|
</li>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</collection.Empty>
|
|
|
|
</DataCollection>
|
2021-12-01 11:04:02 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</DataWriter>
|
2021-04-06 12:40:40 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</AppView>
|
|
|
|
{{/let}}
|
2021-09-15 18:50:11 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|
2021-12-01 11:04:02 +00:00
|
|
|
</Route>
|