open-vault/ui/app/templates/vault/cluster/access/methods.hbs
2019-03-29 18:29:48 -06:00

93 lines
3.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/"
(if
(or
(find-by "type" method.methodType (mountable-auth-methods))
(eq method.methodType "token")
)
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"}}
<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-" (dot-to-dash method.id)))
class=(if (get this (concat "shouldDelete-" (dot-to-dash 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}}