2022-11-21 22:58:34 +00:00
|
|
|
{{#each @fields as |attr|}}
|
|
|
|
{{#if (eq attr.name "keyBits")}}
|
|
|
|
<div class="field">
|
2022-12-08 22:22:33 +00:00
|
|
|
<FormFieldLabel for={{attr.name}} @label={{attr.options.label}} @subText={{attr.options.subText}} />
|
2022-11-21 22:58:34 +00:00
|
|
|
<div class="control is-expanded">
|
2022-12-08 22:22:33 +00:00
|
|
|
<ToolTip @verticalPosition="above" @horizontalPosition="center" as |T|>
|
|
|
|
<T.Trigger tabindex="-1">
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
<select
|
|
|
|
id={{attr.name}}
|
|
|
|
name={{attr.name}}
|
|
|
|
data-test-input={{attr.name}}
|
|
|
|
disabled={{unless @model.keyType true}}
|
|
|
|
{{on "change" this.onKeyBitsChange}}
|
|
|
|
>
|
|
|
|
{{#if (and attr.options.noDefault (not @model.keyType))}}
|
|
|
|
<option value="">
|
|
|
|
Select one
|
|
|
|
</option>
|
|
|
|
{{/if}}
|
|
|
|
{{#each this.keyBitOptions as |val|}}
|
|
|
|
<option selected={{eq (get @model "keyBits") val}} value={{val}}>
|
|
|
|
{{val}}
|
|
|
|
</option>
|
|
|
|
{{/each}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</T.Trigger>
|
|
|
|
{{#unless @model.keyType}}
|
|
|
|
<T.Content @defaultClass="tool-tip smaller-font">
|
|
|
|
<div class="box">
|
|
|
|
Choose a key type before specifying bit length.
|
|
|
|
</div>
|
|
|
|
</T.Content>
|
|
|
|
{{/unless}}
|
|
|
|
</ToolTip>
|
2022-11-21 22:58:34 +00:00
|
|
|
</div>
|
2022-10-19 21:28:43 +00:00
|
|
|
</div>
|
2022-11-21 22:58:34 +00:00
|
|
|
{{else}}
|
|
|
|
<FormField
|
|
|
|
data-test-field={{attr}}
|
|
|
|
@attr={{attr}}
|
|
|
|
@model={{@model}}
|
|
|
|
@modelValidations={{@modelValidations}}
|
|
|
|
@showHelpText={{false}}
|
2022-12-08 22:22:33 +00:00
|
|
|
@onChange={{this.handleSelection}}
|
2022-11-21 22:58:34 +00:00
|
|
|
/>
|
2022-10-19 21:28:43 +00:00
|
|
|
{{/if}}
|
2022-11-21 22:58:34 +00:00
|
|
|
{{/each}}
|