consul/ui/packages/consul-ui/app/templates/dc/show.hbs

74 lines
1.6 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
<Route
@name={{routeName}}
as |route|>
<AppView>
<BlockSlot @name="header">
<h1>
<route.Title @title={{compute (fn route.t 'title')}} />
</h1>
</BlockSlot>
<BlockSlot @name="toolbar">
</BlockSlot>
<BlockSlot @name="nav">
{{#let
(from-entries (array
(array 'serverstatus' (compute (fn route.exists 'serverstatus')))
(array 'cataloghealth' false)
(array 'license' (compute (fn route.exists 'license')))
))
as |tabs|}}
{{#let (without false
(values tabs)
) as |tabsEnabled|}}
{{#if (gt tabsEnabled.length 1)}}
<TabNav @items={{
compact
(array
(if tabs.serverstatus
(hash
label=(compute (fn route.t 'serverstatus.title'))
href=(href-to "dc.show.serverstatus")
selected=(is-href "dc.show.serverstatus")
)
'')
(if tabs.cataloghealth
(hash
label=(compute (fn route.t 'cataloghealth.title'))
href=(href-to 'dc.show.cataloghealth')
selected=(is-href 'dc.show.cataloghealth')
)
'')
(if tabs.license
(hash
label=(compute (fn route.t 'license.title'))
href=(href-to 'dc.show.license')
selected=(is-href 'dc.show.license')
)
)
'')
}}/>
{{/if}}
{{/let}}
{{/let}}
</BlockSlot>
<BlockSlot @name="content">
<Outlet
@name={{routeName}}
@model={{route.model}}
as |o|>
{{outlet}}
</Outlet>
</BlockSlot>
</AppView>
</Route>