mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 13:26:07 +00:00
Allow managed-runtime badge to be dynamic (#14853)
This commit is contained in:
parent
78b437760b
commit
6fbe799178
@ -1,24 +1,20 @@
|
||||
<li
|
||||
class="dcs"
|
||||
data-test-datacenter-menu
|
||||
>
|
||||
<li class='dcs' data-test-datacenter-menu>
|
||||
{{#if (gt @dcs.length 1)}}
|
||||
<DisclosureMenu
|
||||
aria-label="Datacenter"
|
||||
aria-label='Datacenter'
|
||||
@items={{sort-by 'Primary:desc' 'Local:desc' 'Name:asc' @dcs}}
|
||||
data-test-datacenter-disclosure-menu
|
||||
as |disclosure|>
|
||||
<disclosure.Action
|
||||
{{on 'click' disclosure.toggle}}
|
||||
as |disclosure|
|
||||
>
|
||||
<disclosure.Action {{on 'click' disclosure.toggle}}>
|
||||
{{@dc.Name}}
|
||||
</disclosure.Action>
|
||||
<disclosure.Menu as |panel|>
|
||||
<DataSource
|
||||
@src={{uri '/*/*/*/datacenters'}}
|
||||
@onchange={{action (mut @dcs) value="data"}}
|
||||
@onchange={{action (mut @dcs) value='data'}}
|
||||
/>
|
||||
<p class="dcs-message">
|
||||
<p class='dcs-message'>
|
||||
Datacenters shown in this dropdown are available through WAN Federation.
|
||||
</p>
|
||||
<panel.Menu as |menu|>
|
||||
@ -29,18 +25,18 @@
|
||||
<menu.Item
|
||||
data-test-dc-item
|
||||
aria-current={{if (eq @dc.Name item.Name) 'true'}}
|
||||
class={{class-map
|
||||
(array 'is-local' item.Local)
|
||||
(array 'is-primary' item.Primary)
|
||||
}}
|
||||
class={{class-map (array 'is-local' item.Local) (array 'is-primary' item.Primary)}}
|
||||
>
|
||||
<menu.Action
|
||||
{{on 'click' disclosure.close}}
|
||||
@href={{href-to '.' params=(hash
|
||||
@href={{href-to
|
||||
'.'
|
||||
params=(hash
|
||||
dc=item.Name
|
||||
partition=undefined
|
||||
nspace=(if (gt @nspace.length 0) @nspace undefined)
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
>
|
||||
{{item.Name}}
|
||||
{{#if item.Primary}}
|
||||
@ -56,12 +52,13 @@
|
||||
</disclosure.Menu>
|
||||
</DisclosureMenu>
|
||||
{{else}}
|
||||
<div class="dc-name" data-test-datacenter-single>
|
||||
<div class='dc-name' data-test-datacenter-single>
|
||||
{{@dcs.firstObject.Name}}
|
||||
{{#if (env 'CONSUL_HCP_MANAGED_RUNTIME')}}
|
||||
<span>Self-managed</span>
|
||||
{{#let (env 'CONSUL_HCP_MANAGED_RUNTIME') as |managedRuntime|}}
|
||||
{{#if managedRuntime}}
|
||||
<span>{{capitalize managedRuntime}}</span>
|
||||
{{/if}}
|
||||
{{/let}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</li>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user