Skip to content

Commit

Permalink
Ui/wrap tool ttl (#9691) (#9717)
Browse files Browse the repository at this point in the history
* Update ttl picker in wrap tool
  • Loading branch information
chelshaw committed Aug 17, 2020
1 parent 074d49b commit 6d1e54b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ui/app/components/tool-actions-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export default Component.extend(DEFAULTS, {
this.reset();
},

updateTtl(evt) {
const ttl = evt.enabled ? `${evt.seconds}s` : '30m';
set(this, 'wrapTTL', ttl);
},

codemirrorUpdated(val, codemirror) {
codemirror.performLint();
const hasErrors = codemirror.state.lint.marked.length > 0;
Expand Down
9 changes: 8 additions & 1 deletion ui/app/templates/partials/tools/wrap.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@
}}
</div>
</div>
{{ttl-picker labelText='Wrap TTL' onChange=(action (mut wrapTTL))}}
<TtlPicker2
@label="Wrap TTL"
@initialValue="30m"
@onChange={{action 'updateTtl'}}
@helperTextDisabled="Vault will use the default (30m)"
@helperTextEnabled="Wrap will expire after"
@changeOnInit={{true}}
/>
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
Expand Down

0 comments on commit 6d1e54b

Please sign in to comment.