Ui/wrap tool ttl (#9691)

* Update ttl picker in wrap tool
This commit is contained in:
Chelsea Shaw 2020-08-10 13:17:54 -05:00 committed by GitHub
parent 4bf0ce85e0
commit bf38ce4701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -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;

View File

@ -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">