2018-04-03 14:16:57 +00:00
|
|
|
<div class="level is-mobile">
|
|
|
|
<div class="level-left">
|
2019-05-03 03:20:28 +00:00
|
|
|
<label class="is-label" data-test-pgp-label>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.label}}
|
|
|
|
{{this.label}}
|
2018-04-03 14:16:57 +00:00
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
PGP KEY
|
|
|
|
{{if (not-eq this.index "") (inc this.index)}}
|
2018-04-03 14:16:57 +00:00
|
|
|
{{/if}}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="level-right">
|
|
|
|
<div class="control is-flex">
|
|
|
|
<input
|
2019-05-03 03:20:28 +00:00
|
|
|
data-test-text-toggle
|
2021-12-17 03:44:29 +00:00
|
|
|
id={{concat "useText-" this.elementId}}
|
2018-04-03 14:16:57 +00:00
|
|
|
type="checkbox"
|
2021-12-17 03:44:29 +00:00
|
|
|
name={{concat "useText-" this.elementId}}
|
2018-04-03 14:16:57 +00:00
|
|
|
class="switch is-rounded is-success is-small"
|
2021-12-17 03:44:29 +00:00
|
|
|
checked={{this.key.enterAsText}}
|
|
|
|
onchange={{action (toggle "enterAsText" this.key)}}
|
2018-04-03 14:16:57 +00:00
|
|
|
/>
|
2021-12-17 03:44:29 +00:00
|
|
|
<label for={{concat "useText-" this.elementId}}>
|
2018-04-03 14:16:57 +00:00
|
|
|
Enter as text
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.key.enterAsText}}
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="control">
|
|
|
|
<textarea
|
|
|
|
class="textarea"
|
|
|
|
oninput={{action "updateData"}}
|
2021-12-17 03:44:29 +00:00
|
|
|
data-test-pgp-file-textarea={{true}}
|
|
|
|
>{{this.key.value}}</textarea>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
|
|
|
<p class="help has-text-grey">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.textareaHelpText}}
|
|
|
|
{{this.textareaHelpText}}
|
2018-04-03 14:16:57 +00:00
|
|
|
{{else}}
|
|
|
|
Enter a base64-encoded key
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
{{else}}
|
|
|
|
<div class="control is-expanded">
|
|
|
|
<div class="file">
|
2022-10-18 15:46:02 +00:00
|
|
|
<div class="file-label is-fullwidth">
|
2022-10-26 20:35:15 +00:00
|
|
|
<input
|
|
|
|
id="file-input"
|
|
|
|
class="file-input"
|
|
|
|
type="file"
|
|
|
|
onchange={{action "pickedFile"}}
|
|
|
|
data-test-pgp-file-input={{true}}
|
|
|
|
/>
|
2018-04-03 14:16:57 +00:00
|
|
|
<span class="file-cta is-fullwidth">
|
|
|
|
<span class="file-icon has-text-grey-dark">
|
2021-12-07 17:05:14 +00:00
|
|
|
<Icon @name="file" />
|
2018-04-03 14:16:57 +00:00
|
|
|
</span>
|
2022-10-26 20:35:15 +00:00
|
|
|
<label for="file-input" class="file-label has-text-grey-dark" data-test-pgp-file-input-label={{true}}>
|
2022-12-19 23:54:59 +00:00
|
|
|
{{#if this.key.filename}}
|
|
|
|
{{this.key.filename}}
|
2018-04-03 14:16:57 +00:00
|
|
|
{{else}}
|
|
|
|
Choose a file…
|
|
|
|
{{/if}}
|
2022-10-26 20:35:15 +00:00
|
|
|
</label>
|
2022-12-19 23:54:59 +00:00
|
|
|
{{#if this.key.filename}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<button type="button" class="file-delete-button" {{action "clearKey"}} data-test-pgp-clear={{true}}>
|
2021-12-07 17:05:14 +00:00
|
|
|
<Icon @name="x" aria-label="Close" />
|
2018-04-03 14:16:57 +00:00
|
|
|
</button>
|
|
|
|
{{/if}}
|
|
|
|
</span>
|
2022-10-18 15:46:02 +00:00
|
|
|
</div>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p class="help has-text-grey">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.fileHelpText}}
|
|
|
|
{{this.fileHelpText}}
|
2018-04-03 14:16:57 +00:00
|
|
|
{{else}}
|
|
|
|
Select a PGP key from your computer
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
</div>
|