mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-17 12:07:02 +02:00
33 lines
1.1 KiB
Handlebars
33 lines
1.1 KiB
Handlebars
{{#let (find-by "name" "path" @secret.allFields) as |attr|}}
|
|
{{#if @isEdit}}
|
|
<ReadonlyFormField @attr={{attr}} @value={{get @secret attr.name}} />
|
|
{{else}}
|
|
<FormField @attr={{attr}} @model={{@secret}} @modelValidations={{@modelValidations}} @onKeyUp={{@pathValidations}} />
|
|
{{/if}}
|
|
{{/let}}
|
|
|
|
<hr class="is-marginless has-background-gray-200" />
|
|
{{#if @showJson}}
|
|
<JsonEditor
|
|
@title="{{if @isEdit 'Version' 'Secret'}} data"
|
|
@value={{or (stringify @secret.secretData) this.emptyJson}}
|
|
@valueUpdated={{this.handleJson}}
|
|
/>
|
|
{{#if (or @modelValidations.secretData.errors this.lintingErrors)}}
|
|
<AlertInline @type={{if this.lintingErrors "warning" "danger"}} @paddingTop={{true}}>
|
|
{{#if @modelValidations.secretData.errors}}
|
|
{{@modelValidations.secretData.errors}}
|
|
{{else}}
|
|
JSON is unparsable. Fix linting errors to avoid data discrepancies.
|
|
{{/if}}
|
|
</AlertInline>
|
|
{{/if}}
|
|
{{else}}
|
|
<KvObjectEditor
|
|
class="has-top-margin-m"
|
|
@label="{{if @isEdit 'Version' 'Secret'}} data"
|
|
@value={{@secret.secretData}}
|
|
@onChange={{fn (mut @secret.secretData)}}
|
|
@isMasked={{true}}
|
|
/>
|
|
{{/if}} |