2021-04-06 12:40:40 +00:00
|
|
|
<Route
|
|
|
|
@name={{routeName}}
|
|
|
|
as |route|>
|
2021-09-15 18:50:11 +00:00
|
|
|
<DataSource
|
|
|
|
@src={{uri '/${partition}/${nspace}/${dc}/kvs/${key}'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
key=(or route.params.key '/')
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
@onchange={{action (mut items) value="data"}}
|
|
|
|
/>
|
|
|
|
<DataLoader
|
|
|
|
@src={{
|
|
|
|
uri '/${partition}/${nspace}/${dc}/kv/${key}'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
key=(or route.params.key '/')
|
|
|
|
)}}
|
|
|
|
as |loader|>
|
|
|
|
|
|
|
|
<BlockSlot @name="error">
|
|
|
|
<AppError
|
|
|
|
@error={{loader.error}}
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
/>
|
|
|
|
</BlockSlot>
|
|
|
|
|
|
|
|
<BlockSlot @name="loaded">
|
2021-01-25 18:13:54 +00:00
|
|
|
{{#let
|
|
|
|
|
|
|
|
(hash
|
|
|
|
value=(or sortBy "Kind:asc")
|
|
|
|
change=(action (mut sortBy) value="target.selected")
|
|
|
|
)
|
|
|
|
|
|
|
|
(hash
|
|
|
|
kind=(hash
|
|
|
|
value=(if kind (split kind ',') undefined)
|
|
|
|
change=(action (mut kind) value="target.selectedItems")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-09-15 18:50:11 +00:00
|
|
|
loader.data
|
2021-01-25 18:13:54 +00:00
|
|
|
items
|
|
|
|
|
2021-09-15 18:50:11 +00:00
|
|
|
as |sort filters parent items|}}
|
2020-12-01 15:45:09 +00:00
|
|
|
<AppView>
|
2020-12-09 09:22:01 +00:00
|
|
|
{{#if (not-eq parent.Key '/') }}
|
2020-12-01 15:45:09 +00:00
|
|
|
<BlockSlot @name="breadcrumbs">
|
|
|
|
<ol>
|
|
|
|
<li><a href={{href-to 'dc.kv'}}>Key / Values</a></li>
|
|
|
|
{{#each (slice 0 -2 (split parent.Key '/')) as |breadcrumb index|}}
|
|
|
|
<li><a href={{href-to 'dc.kv.folder' (join '/' (append (slice 0 (add index 1) (split parent.Key '/')) ''))}}>{{breadcrumb}}</a></li>
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
</BlockSlot>
|
2020-12-09 09:22:01 +00:00
|
|
|
{{/if}}
|
2020-12-01 15:45:09 +00:00
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
|
|
|
{{#if (eq parent.Key '/')}}
|
2021-09-15 18:50:11 +00:00
|
|
|
<route.Title @title="Key / Value" />
|
2020-12-01 15:45:09 +00:00
|
|
|
{{else}}
|
2021-09-15 18:50:11 +00:00
|
|
|
<route.Title @title={{take 1 (drop 1 (reverse (split parent.Key '/')))}} />
|
2020-12-01 15:45:09 +00:00
|
|
|
{{/if}}
|
|
|
|
</h1>
|
|
|
|
<label for="toolbar-toggle"></label>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="toolbar">
|
|
|
|
{{#if (gt items.length 0) }}
|
|
|
|
<Consul::Kv::SearchBar
|
|
|
|
@search={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
|
|
|
|
|
|
|
@sort={{sort}}
|
|
|
|
|
|
|
|
@filter={{filters}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2021-02-19 16:42:16 +00:00
|
|
|
{{#if (can 'create kvs')}}
|
2020-12-01 15:45:09 +00:00
|
|
|
{{#if (not-eq parent.Key '/') }}
|
|
|
|
<a data-test-create href="{{href-to 'dc.kv.create' parent.Key}}" class="type-create">Create</a>
|
|
|
|
{{else}}
|
|
|
|
<a data-test-create href="{{href-to 'dc.kv.root-create'}}" class="type-create">Create</a>
|
|
|
|
{{/if}}
|
2021-02-19 16:42:16 +00:00
|
|
|
{{/if}}
|
2020-12-01 15:45:09 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
<DataWriter
|
2021-09-15 18:50:11 +00:00
|
|
|
@sink={{uri '/${partition}/${nspace}/${dc}/kv/'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
)
|
|
|
|
}}
|
2020-12-01 15:45:09 +00:00
|
|
|
@type="kv"
|
|
|
|
@label="key"
|
|
|
|
@ondelete={{refresh-route}}
|
|
|
|
as |writer|>
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
<DataCollection
|
|
|
|
@type="kv"
|
2021-01-25 18:13:54 +00:00
|
|
|
@sort={{sort.value}}
|
2020-12-01 15:45:09 +00:00
|
|
|
@filters={{filters}}
|
|
|
|
@search={{search}}
|
|
|
|
@items={{items}}
|
|
|
|
as |collection|>
|
|
|
|
<collection.Collection>
|
|
|
|
<Consul::Kv::List
|
|
|
|
@items={{collection.items}}
|
|
|
|
@parent={{parent}}
|
|
|
|
@delete={{writer.delete}}
|
|
|
|
/>
|
|
|
|
</collection.Collection>
|
|
|
|
<collection.Empty>
|
2021-04-06 12:40:40 +00:00
|
|
|
<EmptyState
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
>
|
2020-12-01 15:45:09 +00:00
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h2>
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
No K/V pairs found
|
|
|
|
{{else}}
|
|
|
|
Welcome to Key/Value
|
|
|
|
{{/if}}
|
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
No K/V pairs where found matching that search, or you may not have access to view the K/V pairs you are searching for.
|
|
|
|
{{else}}
|
|
|
|
You don't have any K/V pairs, or you may not have access to view K/V pairs yet.
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
|
|
|
<li class="docs-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_URL'}}/agent/kv" rel="noopener noreferrer" target="_blank">Documentation on K/V</a>
|
|
|
|
</li>
|
|
|
|
<li class="learn-link">
|
|
|
|
<a href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/getting-started/kv" rel="noopener noreferrer" target="_blank">Read the guide</a>
|
|
|
|
</li>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</collection.Empty>
|
|
|
|
</DataCollection>
|
|
|
|
</BlockSlot>
|
|
|
|
</DataWriter>
|
|
|
|
</BlockSlot>
|
|
|
|
</AppView>
|
2021-04-06 12:40:40 +00:00
|
|
|
{{/let}}
|
2021-09-15 18:50:11 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|
2021-04-06 12:40:40 +00:00
|
|
|
</Route>
|