2022-10-26 09:15:06 +00:00
|
|
|
<Route @name={{routeName}} as |route|>
|
2022-07-04 10:31:58 +00:00
|
|
|
<DataLoader
|
2022-10-26 09:15:06 +00:00
|
|
|
@src={{uri
|
|
|
|
"/${partition}/${nspace}/${dc}/peers"
|
2022-07-04 10:31:58 +00:00
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
2022-10-26 09:15:06 +00:00
|
|
|
)
|
|
|
|
}}
|
|
|
|
as |loader|
|
|
|
|
>
|
2022-07-04 10:31:58 +00:00
|
|
|
|
|
|
|
<BlockSlot @name="error">
|
2022-10-26 09:15:06 +00:00
|
|
|
<AppError @error={{loader.error}} @login={{route.model.app.login.open}} />
|
2022-07-04 10:31:58 +00:00
|
|
|
</BlockSlot>
|
|
|
|
|
|
|
|
<BlockSlot @name="loaded">
|
2022-10-26 09:15:06 +00:00
|
|
|
{{#let
|
|
|
|
(hash
|
|
|
|
value=(or sortBy "State:asc")
|
|
|
|
change=(action (mut sortBy) value="target.selected")
|
|
|
|
)
|
|
|
|
(hash
|
|
|
|
state=(hash
|
|
|
|
value=(if state (split state ",") undefined)
|
|
|
|
change=(action (mut state) value="target.selectedItems")
|
2022-07-07 17:23:26 +00:00
|
|
|
)
|
2022-10-26 09:15:06 +00:00
|
|
|
searchproperty=(hash
|
|
|
|
value=(if
|
|
|
|
(not-eq searchproperty undefined)
|
|
|
|
(split searchproperty ",")
|
|
|
|
searchProperties
|
|
|
|
)
|
|
|
|
change=(action (mut searchproperty) value="target.selectedItems")
|
|
|
|
default=searchProperties
|
|
|
|
)
|
|
|
|
)
|
|
|
|
loader.data
|
|
|
|
as |sort filters items|
|
|
|
|
}}
|
|
|
|
<AppView>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
|
|
|
<route.Title @title="Peers" />
|
|
|
|
</h1>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="toolbar">
|
|
|
|
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
<Consul::Peer::SearchBar
|
|
|
|
@search={{search}}
|
|
|
|
@onsearch={{action (mut search) value="target.value"}}
|
|
|
|
@sort={{sort}}
|
|
|
|
@filter={{filters}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2022-07-26 14:36:49 +00:00
|
|
|
|
|
|
|
<ModalDialog
|
2022-10-26 09:15:06 +00:00
|
|
|
@aria={{hash label="Add peer connection"}}
|
|
|
|
class="peer-create-modal"
|
|
|
|
as |modal|
|
|
|
|
>
|
2022-07-26 14:36:49 +00:00
|
|
|
<BlockSlot @name="header">
|
2022-10-26 09:15:06 +00:00
|
|
|
{{did-insert (set this "create" modal)}}
|
2022-07-26 14:36:49 +00:00
|
|
|
<h2>
|
2022-10-26 09:15:06 +00:00
|
|
|
Add peer connection
|
2022-07-26 14:36:49 +00:00
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
2022-10-26 09:15:06 +00:00
|
|
|
|
|
|
|
{{#if modal.opened}}
|
|
|
|
<Consul::Peer::Form @params={{route.params}} as |form|>
|
|
|
|
<form.Form
|
|
|
|
@onchange={{loader.invalidate}}
|
2022-10-26 09:15:57 +00:00
|
|
|
@onsubmit={{fn this.redirectToPeerShow modal.close}}
|
2022-10-26 09:15:06 +00:00
|
|
|
as |form|
|
|
|
|
>
|
|
|
|
{{did-insert (set this "form" form)}}
|
|
|
|
<form.Fieldsets />
|
|
|
|
</form.Form>
|
|
|
|
</Consul::Peer::Form>
|
2022-07-26 14:36:49 +00:00
|
|
|
{{/if}}
|
2022-10-26 09:15:06 +00:00
|
|
|
|
2022-07-26 14:36:49 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2022-10-26 09:15:06 +00:00
|
|
|
<this.form.Actions @onclose={{this.create.close}} />
|
2022-07-26 14:36:49 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</ModalDialog>
|
2023-02-22 21:05:15 +00:00
|
|
|
<Hds::Button
|
|
|
|
@color='primary'
|
|
|
|
@text='Add peer connection'
|
2022-10-26 09:15:06 +00:00
|
|
|
{{on "click" (optional this.create.open)}}
|
2023-02-22 21:05:15 +00:00
|
|
|
data-test-create
|
|
|
|
/>
|
2022-10-26 09:15:06 +00:00
|
|
|
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
|
|
|
|
<DataWriter
|
|
|
|
@sink={{uri
|
|
|
|
"/${partition}/${dc}/${nspace}/peer/"
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
)
|
|
|
|
}}
|
2022-07-26 14:36:49 +00:00
|
|
|
@type="peer"
|
2022-10-26 09:15:06 +00:00
|
|
|
@label="Peer"
|
|
|
|
as |writer|
|
|
|
|
>
|
|
|
|
|
|
|
|
<BlockSlot @name="removed" as |after|>
|
|
|
|
<Consul::Peer::Notifications
|
|
|
|
{{notification after=(action after)}}
|
|
|
|
@type="remove"
|
2022-07-07 17:23:26 +00:00
|
|
|
/>
|
2022-10-26 09:15:06 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
2022-07-07 17:23:26 +00:00
|
|
|
|
2022-10-26 09:15:06 +00:00
|
|
|
<ModalDialog
|
|
|
|
@aria={{hash label="Regenerate token"}}
|
|
|
|
@onclose={{set this "item" undefined}}
|
|
|
|
as |modal|
|
2022-07-26 14:36:49 +00:00
|
|
|
>
|
|
|
|
<BlockSlot @name="header">
|
2022-10-26 09:15:06 +00:00
|
|
|
{{did-insert (set this "regenerate" modal)}}
|
2022-07-26 14:36:49 +00:00
|
|
|
<h2>
|
2022-10-26 09:15:06 +00:00
|
|
|
Regenerate token
|
2022-07-26 14:36:49 +00:00
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
2022-10-26 09:15:06 +00:00
|
|
|
{{#if this.item}}
|
|
|
|
<Consul::Peer::Form::Generate
|
|
|
|
@item={{this.item}}
|
|
|
|
@onchange={{loader.invalidate}}
|
|
|
|
@regenerate={{true}}
|
|
|
|
as |form|
|
|
|
|
>
|
|
|
|
{{did-insert (set this "regenerateForm" form)}}
|
|
|
|
<form.Fieldsets />
|
|
|
|
</Consul::Peer::Form::Generate>
|
|
|
|
{{/if}}
|
2022-07-26 14:36:49 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2022-10-26 09:15:06 +00:00
|
|
|
<this.regenerateForm.Actions
|
|
|
|
@onclose={{this.regenerate.close}}
|
|
|
|
/>
|
2022-07-26 14:36:49 +00:00
|
|
|
</BlockSlot>
|
2022-10-26 09:15:06 +00:00
|
|
|
</ModalDialog>
|
|
|
|
|
|
|
|
<DataCollection
|
|
|
|
@type="peer"
|
|
|
|
@sort={{sort.value}}
|
|
|
|
@filters={{filters}}
|
|
|
|
@search={{search}}
|
|
|
|
@items={{items}}
|
|
|
|
as |collection|
|
|
|
|
>
|
|
|
|
<collection.Collection>
|
|
|
|
|
|
|
|
<Consul::Peer::List
|
|
|
|
@items={{collection.items}}
|
|
|
|
@onedit={{queue (set this "item") this.regenerate.open}}
|
|
|
|
@ondelete={{writer.delete}}
|
|
|
|
/>
|
|
|
|
|
|
|
|
</collection.Collection>
|
|
|
|
<collection.Empty>
|
|
|
|
{{! TODO: do we need to check permissions here or will we receive an error automatically? }}
|
|
|
|
<EmptyState @login={{route.model.app.login.open}}>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h2>
|
|
|
|
{{t
|
|
|
|
"routes.dc.peers.index.empty.header"
|
|
|
|
items=items.length
|
|
|
|
}}
|
|
|
|
</h2>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
|
|
|
<p>
|
|
|
|
{{t
|
|
|
|
"routes.dc.peers.index.empty.body"
|
|
|
|
items=items.length
|
|
|
|
canUsePartitions=(can "use partitions")
|
|
|
|
canUseACLs=(can "use acls")
|
|
|
|
htmlSafe=true
|
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
2023-02-22 21:05:15 +00:00
|
|
|
<li>
|
2022-10-26 09:15:06 +00:00
|
|
|
{{! what's the docs for peering?}}
|
2023-02-22 21:05:15 +00:00
|
|
|
<Hds::Link::Standalone
|
|
|
|
@text='Documentation on Peers'
|
|
|
|
@href="{{env
|
2022-10-26 09:15:06 +00:00
|
|
|
'CONSUL_DOCS_URL'
|
|
|
|
}}/connect/cluster-peering"
|
2023-02-22 21:05:15 +00:00
|
|
|
@icon='docs-link'
|
|
|
|
@iconPosition='trailing'
|
|
|
|
@size='small'
|
|
|
|
/>
|
2022-10-26 09:15:06 +00:00
|
|
|
</li>
|
2023-02-22 21:05:15 +00:00
|
|
|
<li>
|
|
|
|
<Hds::Link::Standalone
|
|
|
|
@text='Take the tutorial'
|
|
|
|
@href="{{env
|
2022-10-26 09:15:06 +00:00
|
|
|
'CONSUL_DOCS_URL'
|
|
|
|
}}/connect/cluster-peering/create-manage-peering"
|
2023-02-22 21:05:15 +00:00
|
|
|
@icon='learn-link'
|
|
|
|
@iconPosition='trailing'
|
|
|
|
@size='small'
|
|
|
|
/>
|
2022-10-26 09:15:06 +00:00
|
|
|
</li>
|
|
|
|
</BlockSlot>
|
|
|
|
</EmptyState>
|
|
|
|
</collection.Empty>
|
|
|
|
</DataCollection>
|
|
|
|
</BlockSlot>
|
|
|
|
</DataWriter>
|
|
|
|
</BlockSlot>
|
|
|
|
</AppView>
|
|
|
|
{{/let}}
|
2022-07-04 10:31:58 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|
2022-10-26 09:15:06 +00:00
|
|
|
</Route>
|