open-vault/ui/app/templates/partials/secret-edit-display.hbs

49 lines
1.5 KiB
Handlebars

{{#unless key.isFolder}}
{{#if showAdvancedMode}}
{{json-editor
value=codemirrorString
valueUpdated=(action "codemirrorUpdated")
onFocusOut=(action "formatJSON")
}}
{{else}}
{{#each secretData as |secret index|}}
<div class="info-table-row">
<div class="column is-one-quarter info-table-row-edit">
{{input
data-test-secret-key=true
value=secret.name
placeholder="key"
change="handleChange"
class="input"
}}
</div>
<div class="column info-table-row-edit">
{{masked-input
data-test-secret-value=true
name=secret.name
onKeyDown=(action "handleKeyDown")
onChange=(action "handleChange")
value=secret.value
}}
</div>
<div class="column is-narrow info-table-row-edit">
{{#if (eq secretData.length (inc index))}}
<button type="button" {{action "addRow"}} class="button is-outlined is-primary" data-test-secret-add-row=true>
Add
</button>
{{else}}
<button
class="button has-text-grey is-expanded is-icon"
type="button"
{{action "deleteRow" secret.name}}
aria-label="Delete row"
>
{{i-con size=22 glyph='trash-a' excludeIconClass=true class="is-large has-text-grey-light"}}
</button>
{{/if}}
</div>
</div>
{{/each}}
{{/if}}
{{/unless}}