open-vault/ui/app/templates/components/identity/lookup-input.hbs

27 lines
1.0 KiB
Handlebars

<form {{action (perform this.lookup) on="submit"}}>
<div class="field is-flex">
<div class="control">
<div class="select is-fullwidth">
<select name="param" id="param" onchange={{action (mut this.param) value="target.value"}}>
{{#each (array "alias name" "name" "id" "alias id") as |paramOption|}}
<option selected={{eq this.param paramOption}} value={{paramOption}}>
Lookup by
{{paramOption}}
</option>
{{/each}}
</select>
</div>
</div>
<div class="control">
{{#if (eq this.param "alias name")}}
<MountAccessorSelect @value={{this.aliasMountAccessor}} @onChange={{action (mut this.aliasMountAccessor)}} />
{{/if}}
</div>
<div class="control is-expanded">
<Input class="input" @value={{this.paramValue}} placeholder={{capitalize this.param}} />
</div>
<div class="control">
<button type="submit" class="button is-hidden">Lookup</button>
</div>
</div>
</form>