Add imported/exported tabs to peers.edit

This commit is contained in:
Michael Klein 2022-10-05 12:43:44 +02:00
parent 78b0eb4f43
commit 65a33f8f8a
1 changed files with 61 additions and 54 deletions

View File

@ -1,8 +1,7 @@
<Route
@name={{routeName}}
as |route|>
<DataLoader @src={{
uri '/${partition}/${nspace}/${dc}/peer/${name}'
<Route @name={{routeName}} as |route|>
<DataLoader
@src={{uri
"/${partition}/${nspace}/${dc}/peer/${name}"
(hash
partition=route.params.partition
nspace=route.params.nspace
@ -10,59 +9,67 @@ as |route|>
name=route.params.name
)
}}
as |loader|>
as |loader|
>
<BlockSlot @name="error">
<AppError
@error={{loader.error}}
@login={{route.model.app.login.open}}
/>
<AppError @error={{loader.error}} @login={{route.model.app.login.open}} />
</BlockSlot>
<BlockSlot @name="loaded">
{{#let
route.params.dc
route.params.partition
route.params.nspace
loader.data
as |dc partition nspace item|}}
<AppView>
<BlockSlot @name="breadcrumbs">
<ol>
<li><a data-test-back href={{href-to 'dc.peers'}}>All Peers</a></li>
</ol>
</BlockSlot>
<BlockSlot @name="header">
<h1>
<route.Title
@title={{item.Name}}
/>
</h1>
</BlockSlot>
<BlockSlot @name="content">
<TabNav @items={{
compact
(array
(hash
label="Addresses"
href=(href-to "dc.peers.edit.addresses")
selected=(is-href "dc.peers.edit.addresses")
)
)
}}/>
<Outlet
@name={{routeName}}
@model={{assign (hash
items=item.PeerServerAddresses
) route.model}}
as |o|>
{{outlet}}
</Outlet>
</BlockSlot>
</AppView>
{{/let}}
{{#let
route.params.dc
route.params.partition
route.params.nspace
loader.data
as |dc partition nspace item|
}}
<AppView>
<BlockSlot @name="breadcrumbs">
<ol>
<li><a data-test-back href={{href-to "dc.peers"}}>All Peers</a></li>
</ol>
</BlockSlot>
<BlockSlot @name="header">
<h1>
<route.Title @title={{item.Name}} />
</h1>
</BlockSlot>
<BlockSlot @name="content">
<TabNav
@items={{compact
(array
(hash
label="Imported Services"
href=(href-to "dc.peers.edit.imported")
selected=(is-href "dc.peers.edit.imported")
)
(hash
label="Exported Services"
href=(href-to "dc.peers.edit.exported")
selected=(is-href "dc.peers.edit.exported")
)
(hash
label="Addresses"
href=(href-to "dc.peers.edit.addresses")
selected=(is-href "dc.peers.edit.addresses")
)
)
}}
/>
<Outlet
@name={{routeName}}
@model={{assign
(hash items=item.PeerServerAddresses peer=item)
route.model
}}
as |o|
>
{{outlet}}
</Outlet>
</BlockSlot>
</AppView>
{{/let}}
</BlockSlot>
</DataLoader>
</Route>
</Route>