open-vault/ui/app/templates/vault/cluster/access/methods.hbs
2018-11-09 14:52:06 -08:00

85 lines
3 KiB
Handlebars

<PageHeader as |p|>
<p.levelLeft>
<h1 class="title is-3">
Authentication Methods
</h1>
</p.levelLeft>
<p.levelRight>
{{#link-to 'vault.cluster.settings.auth.enable' class="button has-icon-right is-ghost is-compact"}}
Enable new method
{{i-con glyph="chevron-right" size=11}}
{{/link-to}}
</p.levelRight>
</PageHeader>
{{#each (sort-by "path" model) as |method|}}
<div
class="list-item-row"
data-test-auth-backend-link={{method.id}}
>
<div class="level is-mobile">
<div class="level-left">
<div>
<ToolTip @horizontalPosition="left" as |T|>
<T.trigger>
<ICon @glyph={{concat "enable/" (or method.methodType "auth")}} @size=24 @class="has-text-grey-light"/>
</T.trigger>
<T.content @class="tool-tip">
<div class="box">
{{method.methodType}}
</div>
</T.content>
</ToolTip>
<span data-test-path data-test-id={{method.id}} class="has-text-weight-semibold has-text-grey">
{{method.path}}
</span>
<br />
<code class="has-text-grey is-size-8">
{{method.accessor}}
</code>
</div>
</div>
<div class="level-right is-flex is-paddingless is-marginless">
<div class="level-item">
{{#popup-menu name="auth-backend-nav" contentClass="is-wide"}}
<nav class="menu">
<ul class="menu-list">
<li>
{{#link-to "vault.cluster.access.method.section" method.id "configuration"}}
View Configuration
{{/link-to}}
</li>
{{#if method.canEdit}}
<li>
{{#link-to "vault.cluster.settings.auth.configure" method.id}}
Edit Configuration
{{/link-to}}
</li>
{{/if}}
{{#if (and (not-eq method.methodType 'token') method.canDisable)}}
<li class="action">
{{#confirm-action
confirmButtonClasses="button is-primary"
buttonClasses="link is-destroy"
onConfirmAction=(perform disableMethod method)
confirmMessage=(concat "Are you sure you want to disable the " method.id " auth method at " method.path "?")
showConfirm=(get this (concat "shouldDelete-" method.id))
class=(if (get this (concat "shouldDelete-" method.id)) "message is-block is-warning is-outline")
containerClasses="message-body is-block"
messageClasses="is-block"
confirmButtonText="Disable"
}}
Disable
{{/confirm-action}}
</li>
{{/if}}
</ul>
</nav>
{{/popup-menu}}
</div>
</div>
</div>
</div>
{{/each}}