Format index template

pull/15153/head
wenincode 2022-10-27 14:23:41 -06:00
parent 46ba6174d5
commit 2dd31ff96f
1 changed files with 144 additions and 188 deletions

View File

@ -1,24 +1,19 @@
<App <App class='hashicorp-consul' ...attributes>
class="hashicorp-consul"
...attributes
>
<:notifications as |app|> <:notifications as |app|>
{{#each flashMessages.queue as |flash|}} {{#each flashMessages.queue as |flash|}}
<app.Notification <app.Notification @delay={{sub flash.timeout flash.extendedTimeout}} @sticky={{flash.sticky}}>
@delay={{sub flash.timeout flash.extendedTimeout}}
@sticky={{flash.sticky}}
>
{{#if flash.dom}} {{#if flash.dom}}
{{{flash.dom}}} {{{flash.dom}}}
{{else}} {{else}}
{{#let (lowercase flash.type) (lowercase flash.action) as |status type|}} {{#let (lowercase flash.type) (lowercase flash.action) as |status type|}}
<Notice <Notice
role="alert" role='alert'
class={{concat status ' notification-' type}} class={{concat status ' notification-' type}}
data-notification data-notification
@type={{status}} @type={{status}}
as |notice|> as |notice|
>
<notice.Header> <notice.Header>
<strong> <strong>
{{capitalize status}}! {{capitalize status}}!
@ -80,9 +75,7 @@
</:notifications> </:notifications>
<:home-nav> <:home-nav>
<a <a href={{href-to 'index' params=(hash peer=undefined)}}><Consul::Logo /></a>
href={{href-to 'index' params=(hash peer=undefined)}}
><Consul::Logo /></a>
</:home-nav> </:home-nav>
<:main-nav> <:main-nav>
@ -99,73 +92,59 @@
@partition={{@partition}} @partition={{@partition}}
@nspace={{@nspace}} @nspace={{@nspace}}
@partitions={{this.partitions}} @partitions={{this.partitions}}
@onchange={{action (mut this.partitions) value="data"}} @onchange={{action (mut this.partitions) value='data'}}
/> />
<Consul::Nspace::Selector <Consul::Nspace::Selector
@dc={{@dc}} @dc={{@dc}}
@partition={{@partition}} @partition={{@partition}}
@nspace={{@nspace}} @nspace={{@nspace}}
@nspaces={{this.nspaces}} @nspaces={{this.nspaces}}
@onchange={{action (mut this.nspaces) value="data"}} @onchange={{action (mut this.nspaces) value='data'}}
/> />
{{#if (can 'access overview')}} {{#if (can 'access overview')}}
<li <li
data-test-main-nav-overview data-test-main-nav-overview
class={{class-map class={{class-map (array 'is-active' (is-href 'dc.show' @dc.Name))}}
(array 'is-active' (is-href 'dc.show' @dc.Name))
}}
>
<Action
@href={{href-to 'dc.show' @dc.Name params=(hash peer=undefined)}}
> >
<Action @href={{href-to 'dc.show' @dc.Name params=(hash peer=undefined)}}>
Overview Overview
</Action> </Action>
</li> </li>
{{/if}} {{/if}}
{{#if (can "read services")}} {{#if (can 'read services')}}
<li data-test-main-nav-services class={{if (is-href 'dc.services' @dc.Name) 'is-active'}}> <li data-test-main-nav-services class={{if (is-href 'dc.services' @dc.Name) 'is-active'}}>
<a href={{href-to 'dc.services' @dc.Name params=(hash peer=undefined)}}>Services</a> <a href={{href-to 'dc.services' @dc.Name params=(hash peer=undefined)}}>Services</a>
</li> </li>
{{/if}} {{/if}}
{{#if (can "read nodes")}} {{#if (can 'read nodes')}}
<li data-test-main-nav-nodes class={{if (is-href 'dc.nodes' @dc.Name) 'is-active'}}> <li data-test-main-nav-nodes class={{if (is-href 'dc.nodes' @dc.Name) 'is-active'}}>
<a href={{href-to 'dc.nodes' @dc.Name params=(hash peer=undefined)}}>Nodes</a> <a href={{href-to 'dc.nodes' @dc.Name params=(hash peer=undefined)}}>Nodes</a>
</li> </li>
{{/if}} {{/if}}
{{#if (can "read kv")}} {{#if (can 'read kv')}}
<li data-test-main-nav-kvs class={{if (is-href 'dc.kv' @dc.Name) 'is-active'}}> <li data-test-main-nav-kvs class={{if (is-href 'dc.kv' @dc.Name) 'is-active'}}>
<a href={{href-to 'dc.kv' @dc.Name params=(hash peer=undefined)}}>Key/Value</a> <a href={{href-to 'dc.kv' @dc.Name params=(hash peer=undefined)}}>Key/Value</a>
</li> </li>
{{/if}} {{/if}}
{{#if (can "read intentions")}} {{#if (can 'read intentions')}}
<li data-test-main-nav-intentions class={{if (is-href 'dc.intentions' @dc.Name) 'is-active'}}> <li
data-test-main-nav-intentions
class={{if (is-href 'dc.intentions' @dc.Name) 'is-active'}}
>
<a href={{href-to 'dc.intentions' @dc.Name params=(hash peer=undefined)}}>Intentions</a> <a href={{href-to 'dc.intentions' @dc.Name params=(hash peer=undefined)}}>Intentions</a>
</li> </li>
{{/if}} {{/if}}
<Consul::Acl::Selector <Consul::Acl::Selector @dc={{@dc}} @partition={{@partition}} @nspace={{@nspace}} />
@dc={{@dc}} <Consul::Peer::Selector @dc={{@dc}} @partition={{@partition}} @nspace={{@nspace}} />
@partition={{@partition}}
@nspace={{@nspace}}
/>
<Consul::Peer::Selector
@dc={{@dc}}
@partition={{@partition}}
@nspace={{@nspace}}
/>
</ul> </ul>
</:main-nav> </:main-nav>
<:complementary-nav> <:complementary-nav>
<ul> <ul>
<Debug::Navigation /> <Debug::Navigation />
<li <li data-test-main-nav-help>
data-test-main-nav-help <DisclosureMenu as |disclosure|>
> <disclosure.Action {{on 'click' disclosure.toggle}}>
<DisclosureMenu
as |disclosure|>
<disclosure.Action
{{on 'click' disclosure.toggle}}
>
Help Help
</disclosure.Action> </disclosure.Action>
<disclosure.Menu as |panel|> <disclosure.Menu as |panel|>
@ -173,19 +152,12 @@
<menu.Separator> <menu.Separator>
Consul v{{env 'CONSUL_VERSION'}} Consul v{{env 'CONSUL_VERSION'}}
</menu.Separator> </menu.Separator>
<menu.Item <menu.Item class='docs-link'>
class="docs-link" <menu.Action @href={{env 'CONSUL_DOCS_URL'}} @external={{true}}>
>
<menu.Action
@href={{env 'CONSUL_DOCS_URL'}}
@external={{true}}
>
Documentation Documentation
</menu.Action> </menu.Action>
</menu.Item> </menu.Item>
<menu.Item <menu.Item class='learn-link'>
class="learn-link"
>
<menu.Action <menu.Action
@href={{concat (env 'CONSUL_DOCS_LEARN_URL') '/consul'}} @href={{concat (env 'CONSUL_DOCS_LEARN_URL') '/consul'}}
@external={{true}} @external={{true}}
@ -194,13 +166,8 @@
</menu.Action> </menu.Action>
</menu.Item> </menu.Item>
<menu.Separator /> <menu.Separator />
<menu.Item <menu.Item class='feedback-link'>
class="feedback-link" <menu.Action @href={{env 'CONSUL_REPO_ISSUES_URL'}} @external={{true}}>
>
<menu.Action
@href={{env 'CONSUL_REPO_ISSUES_URL'}}
@external={{true}}
>
Provide Feedback Provide Feedback
</menu.Action> </menu.Action>
</menu.Item> </menu.Item>
@ -208,16 +175,8 @@
</disclosure.Menu> </disclosure.Menu>
</DisclosureMenu> </DisclosureMenu>
</li> </li>
<li <li data-test-main-nav-settings class={{if (is-href 'settings') 'is-active'}}>
data-test-main-nav-settings <a href={{href-to 'settings' params=(hash nspace=undefined partition=undefined)}}>
class={{if (is-href 'settings') 'is-active'}}
>
<a
href={{href-to 'settings' params=(hash
nspace=undefined
partition=undefined
)}}
>
Settings Settings
</a> </a>
</li> </li>
@ -226,20 +185,17 @@
@partition={{@partition}} @partition={{@partition}}
@nspace={{@nspace}} @nspace={{@nspace}}
@onchange={{@onchange}} @onchange={{@onchange}}
as |selector|> as |selector|
<Ref >
@target={{this}} <Ref @target={{this}} @name='tokenSelector' @value={{selector}} />
@name="tokenSelector"
@value={{selector}}
/>
</Consul::Token::Selector> </Consul::Token::Selector>
</ul> </ul>
</:complementary-nav> </:complementary-nav>
<:main> <:main>
{{yield (hash {{yield
login=(if this.tokenSelector this.tokenSelector (hash open=undefined close=undefined)) (hash login=(if this.tokenSelector this.tokenSelector (hash open=undefined close=undefined)))
)}} }}
</:main> </:main>
<:content-info> <:content-info>