open-vault/ui/app/templates/vault/cluster.hbs
Matthew Irish 5ca987662f
UI - new token renew banner (#5662)
* move warning banner out of token-expire-warning and into user menu
* check renewal status every 5s, and resume auto-renew if a user becomes active again
* use a link in the token-expire-warning
* add test for new expiration functionality
* fix license test
* use features helper in license test
* fix import
* use yarn 1.12.1
* remove mirage
* skip some tests for now
* use eslintignore
* logout after auth tests
* use new alert-banner for auth info warning
* add data-test selector back
* move identity back to a button, and style button.link
* make the warning message the right color
* fix shamir test
* review feedback
2018-11-05 10:56:59 -06:00

127 lines
4.8 KiB
Handlebars

{{#if showNav}}
<NavHeader data-test-header-with-nav @class="{{if consoleOpen 'panel-open'}} {{if consoleFullscreen ' panel-fullscreen'}}" as |Nav|>
<Nav.home>
<HomeLink @class="navbar-item has-text-white has-current-color-fill">
{{partial 'svg/vault-logo'}}
</HomeLink>
</Nav.home>
<Nav.main>
<ul class="navbar-sections {{if (has-feature "Namespaces") 'with-ns-picker'}}">
{{#if (has-feature "Namespaces")}}
<li>
<NamespacePicker
@class="navbar-item"
@namespace={{namespaceQueryParam}}
>
</NamespacePicker>
</li>
{{/if}}
<li class="{{if (is-active-route 'vault.cluster.secrets') 'is-active'}}" >
{{#link-to
"vault.cluster.secrets"
current-when="vault.cluster.secrets vault.cluster.settings.mount-secret-backend vault.cluster.settings.configure-secret-backend"
invokeAction=(action Nav.closeDrawer)
}}
Secrets
{{/link-to}}
</li>
<li class="{{if (is-active-route 'vault.cluster.access') 'is-active'}}">
{{#link-to
"vault.cluster.access"
current-when="vault.cluster.access vault.cluster.settings.auth"
invokeAction=(action Nav.closeDrawer)
}}
Access
{{/link-to}}
</li>
<li class="{{if (is-active-route (array 'vault.cluster.policies' 'vault.cluster.policy')) 'is-active'}}">
{{#link-to
"vault.cluster.policies"
"acl"
current-when="vault.cluster.policies vault.cluster.policy"
invokeAction=(action Nav.closeDrawer)
}}
Policies
{{/link-to}}
</li>
<li class="{{if (is-active-route 'vault.cluster.tools') 'is-active'}}">
{{#link-to
"vault.cluster.tools.tool"
"wrap"
invokeAction=(action Nav.closeDrawer)
}}
Tools
{{/link-to}}
</li>
</ul>
</Nav.main>
<Nav.items>
<div class="navbar-separator is-hidden-tablet"></div>
{{#if namespaceService.inRootNamespace}}
<div class="navbar-item status-indicator-button" data-status="{{if activeCluster.unsealed "good" "bad"}}">
<StatusMenu @label="Status" @onLinkClick={{action Nav.closeDrawer}} />
</div>
<div class="navbar-separator is-hidden-mobile"></div>
{{/if}}
<div class="navbar-item">
<button type="button" class="button is-transparent nav-console-button{{if consoleOpen " popup-open"}}" {{action (queue (action 'toggleConsole') (action Nav.closeDrawer))}} data-test-console-toggle>
<ICon @glyph="console" @size=24 />
<div class="status-menu-label">
Console
</div>
<ICon @glyph="chevron-down" @aria-hidden="true" @size=8 @class="has-text-white is-status-chevron" />
</button>
</div>
<div class="navbar-item nav-user-button {{if auth.allowExpiration "may-expire"}}" data-test-allow-expiration="{{auth.allowExpiration}}">
<StatusMenu @type="user" @label="User" @onLinkClick={{action Nav.closeDrawer}} />
</div>
{{console/ui-panel isFullscreen=consoleFullscreen}}
</Nav.items>
</NavHeader>
{{/if}}
<div class="global-flash">
{{#each flashMessages.queue as |flash|}}
{{#flash-message data-test-flash-message=true flash=flash as |component flash close|}}
{{#if flash.componentName}}
{{component flash.componentName content=flash.content}}
{{else}}
<div class="message {{get (message-types flash.type) "class"}}">
<div class="columns is-mobile is-variable is-1">
<div class="column is-narrow message-icon">
<ICon @glyph="{{get (message-types flash.type) "glyph"}}" @size="20" @excludeIconClass={{true}} />
</div>
<div class="column">
<button type="button" class="close-button" {{action close}}>
{{i-con excludeIconClass=true glyph="close" aria-label="Close"}}
</button>
<div class="message-title">
{{get (message-types flash.type) "text"}}
</div>
{{#if flash.message}}
<p class="message-body" data-test-flash-message-body="true">
{{flash.message}}
</p>
{{/if}}
</div>
</div>
</div>
{{/if}}
{{/flash-message}}
{{/each}}
</div>
{{#if showNav}}
<UiWizard>
<section class="section">
<div class="container is-widescreen">
{{#if (is-after (now interval=1000) auth.tokenExpirationDate) }}
<TokenExpireWarning />
{{else}}
{{outlet}}
{{/if}}
</div>
</section>
</UiWizard>
{{else}}
{{outlet}}
{{/if}}