open-vault/ui/app/templates/partials/role-aws/popup-menu.hbs

64 lines
2.2 KiB
Handlebars

{{#popup-menu name="role-aws-nav" contentClass="is-wide"}}
<nav class="menu">
<ul class="menu-list">
{{#if item.generatePath.isPending}}
<li class="action">
<button disabled type="button" class="link button is-loading is-transparent">
loading
</button>
</li>
{{else if item.canGenerate}}
<li class="action">
{{#link-to "vault.cluster.secrets.backend.credentials" item.id data-test-role-aws-link="generate"}}
Generate credentials
{{/link-to}}
</li>
{{/if}}
{{#if item.updatePath.isPending}}
<li class="action">
<button disabled type="button" class="link button is-loading is-transparent">
loading
</button>
</li>
<li class="action">
<button disabled type="button" class="link button is-loading is-transparent">
loading
</button>
</li>
{{else}}
{{#if item.canRead}}
<li class="action">
{{#link-to "vault.cluster.secrets.backend.show" item.id data-test-role-ssh-link="show"}}
Details
{{/link-to}}
</li>
{{/if}}
{{#if item.canEdit}}
<li class="action">
{{#link-to "vault.cluster.secrets.backend.edit" item.id data-test-role-ssh-link="edit"}}
Edit
{{/link-to}}
</li>
{{/if}}
{{#if item.canDelete}}
<li class="action">
{{#confirm-action
confirmButtonClasses="button is-primary"
buttonClasses="link is-destroy"
onConfirmAction=(action "delete" item)
confirmMessage=(concat "Are you sure you want to delete " item.id "?")
showConfirm=(get this (concat "shouldDelete-" (dot-to-dash item.id)))
class=(if (get this (concat "shouldDelete-" (dot-to-dash item.id))) "message is-block is-warning is-outline")
containerClasses="message-body is-block"
messageClasses="is-block"
data-test-aws-role-delete=item.id
}}
Delete
{{/confirm-action}}
</li>
{{/if}}
{{/if}}
</ul>
</nav>
{{/popup-menu}}