2021-12-17 03:44:29 +00:00
|
|
|
{{! template-lint-configure simple-unless "warn" }}
|
2021-08-31 15:41:41 +00:00
|
|
|
<Toolbar>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#unless (and (eq @mode "show") @isWriteWithoutRead)}}
|
2021-08-31 15:41:41 +00:00
|
|
|
<ToolbarFilters>
|
|
|
|
<Toggle
|
|
|
|
@name="json"
|
|
|
|
@status="success"
|
|
|
|
@size="small"
|
2021-12-17 03:44:29 +00:00
|
|
|
@disabled={{and (eq @mode "show") @secretDataIsAdvanced}}
|
2021-08-31 15:41:41 +00:00
|
|
|
@checked={{@showAdvancedMode}}
|
|
|
|
@onChange={{action @editActions.toggleAdvanced}}
|
2021-12-17 03:44:29 +00:00
|
|
|
>
|
2021-08-31 15:41:41 +00:00
|
|
|
<span class="has-text-grey">JSON</span>
|
|
|
|
</Toggle>
|
|
|
|
</ToolbarFilters>
|
|
|
|
{{/unless}}
|
|
|
|
<ToolbarActions>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (eq @mode "show")}}
|
|
|
|
<SecretDeleteMenu
|
2021-08-31 15:41:41 +00:00
|
|
|
@modelForData={{@modelForData}}
|
|
|
|
@model={{@model}}
|
|
|
|
@navToNearestAncestor={{@navToNearestAncestor}}
|
|
|
|
@isV2={{@isV2}}
|
|
|
|
@refresh={{action @editActions.refresh}}
|
2021-10-12 19:42:04 +00:00
|
|
|
@canReadSecretMetadata={{@canReadSecretMetadata}}
|
2021-08-31 15:41:41 +00:00
|
|
|
/>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (and (eq @mode "show") @canUpdateSecretData)}}
|
|
|
|
{{#unless (and @isV2 (or @isWriteWithoutRead @modelForData.destroyed @modelForData.deleted))}}
|
|
|
|
<BasicDropdown
|
|
|
|
@class="popup-menu"
|
|
|
|
@horizontalPosition="auto-right"
|
|
|
|
@verticalPosition="below"
|
|
|
|
@onClose={{action "clearWrappedData"}}
|
|
|
|
as |D|
|
|
|
|
>
|
|
|
|
<D.Trigger
|
|
|
|
data-test-popup-menu-trigger="true"
|
|
|
|
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
|
|
|
@htmlTag="button"
|
2021-08-31 15:41:41 +00:00
|
|
|
>
|
2021-12-17 03:44:29 +00:00
|
|
|
Copy
|
|
|
|
<Chevron @direction="down" @isButton={{true}} />
|
|
|
|
</D.Trigger>
|
2022-02-15 17:43:37 +00:00
|
|
|
<D.Content @defaultClass="popup-menu-content is-wide">
|
2021-12-17 03:44:29 +00:00
|
|
|
<nav class="box menu">
|
|
|
|
<ul class="menu-list">
|
|
|
|
<li class="action">
|
|
|
|
<CopyButton
|
|
|
|
@class="link link-plain has-text-weight-semibold is-ghost"
|
|
|
|
@clipboardText={{stringify @modelForData.secretData}}
|
|
|
|
@success={{action (set-flash-message "JSON Copied!")}}
|
|
|
|
data-test-copy-button
|
|
|
|
>
|
|
|
|
Copy JSON
|
|
|
|
</CopyButton>
|
|
|
|
</li>
|
|
|
|
<li class="action">
|
|
|
|
{{#if this.showWrapButton}}
|
|
|
|
<button
|
|
|
|
class="link link-plain has-text-weight-semibold is-ghost {{if this.isWrapping "is-loading"}}"
|
|
|
|
type="button"
|
|
|
|
{{on "click" this.handleWrapClick}}
|
|
|
|
data-test-wrap-button
|
|
|
|
disabled={{this.isWrapping}}
|
2021-08-31 15:41:41 +00:00
|
|
|
>
|
2021-12-17 03:44:29 +00:00
|
|
|
Wrap secret
|
|
|
|
</button>
|
|
|
|
{{else}}
|
|
|
|
<MaskedInput
|
|
|
|
@class="has-padding"
|
|
|
|
@displayOnly={{true}}
|
|
|
|
@allowCopy={{true}}
|
|
|
|
@value={{this.wrappedData}}
|
|
|
|
@success={{action "handleCopySuccess"}}
|
|
|
|
@error={{action "handleCopyError"}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</D.Content>
|
|
|
|
</BasicDropdown>
|
|
|
|
{{/unless}}
|
2021-08-31 15:41:41 +00:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if (and (eq @mode "show") @isV2 (not @model.failedServerRead))}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<SecretVersionMenu @version={{@modelForData}} @onRefresh={{action @editActions.refresh}} @model={{@model}} />
|
2021-08-31 15:41:41 +00:00
|
|
|
{{/if}}
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (and (eq @mode "show") @canUpdateSecretData)}}
|
|
|
|
{{#let (concat "vault.cluster.secrets.backend." (if (eq @mode "show") "edit" "show")) as |targetRoute|}}
|
2021-08-31 15:41:41 +00:00
|
|
|
{{#if @isV2}}
|
|
|
|
<ToolbarLink
|
|
|
|
@params={{array targetRoute @model.id (query-params version=@modelForData.version)}}
|
|
|
|
@data-test-secret-edit="true"
|
|
|
|
@replace={{true}}
|
|
|
|
@type="add"
|
2021-11-23 21:17:37 +00:00
|
|
|
@disabled={{@model.failedServerRead}}
|
|
|
|
@disabledTooltip="Metadata read access is required to create new version"
|
2021-08-31 15:41:41 +00:00
|
|
|
>
|
|
|
|
Create new version
|
|
|
|
</ToolbarLink>
|
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<ToolbarLink @params={{array targetRoute @model.id}} @data-test-secret-edit="true" @replace={{true}}>
|
2021-08-31 15:41:41 +00:00
|
|
|
Edit secret
|
|
|
|
</ToolbarLink>
|
|
|
|
{{/if}}
|
|
|
|
{{/let}}
|
|
|
|
{{/if}}
|
|
|
|
</ToolbarActions>
|
|
|
|
</Toolbar>
|