github.com/outbrain/consul@v1.4.5/ui-v2/app/templates/dc/acls/-form.hbs (about)

     1  <form>
     2      <fieldset>
     3          <label class="type-text{{if item.error.Name ' has-error'}}">
     4              <span>Name</span>
     5              {{input value=item.Name name='name' autofocus='autofocus'}}
     6          </label>
     7          <div role="radiogroup" class={{if item.error.Type ' has-error'}}>
     8              {{#each types as |type|}}
     9                  <label>
    10                      <span>{{capitalize type}}</span>
    11                      <input type="radio" name="Type" value="{{type}}" checked={{if (eq item.Type type) 'checked'}} onchange={{ action 'change' }}/>
    12                  </label>
    13              {{/each}}
    14          </div>
    15          <label class="type-text">
    16              <span>Policy <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span>
    17              {{code-editor class=(if item.error.Rules 'error') name='Rules' value=item.Rules syntax="hcl" onkeyup=(action 'change')}}
    18          </label>
    19  {{#if create }}
    20          <label class="type-text">
    21              <span>ID</span>
    22              {{ input value=item.ID }}
    23              <em>We'll generate a UUID if this field is left empty.</em>
    24          </label>
    25  {{/if}}
    26      </fieldset>
    27      <div>
    28  {{#if create }}
    29          {{! we only need to check for an empty name here as ember munges autofocus, once we have autofocus back revisit this}}
    30          <button type="submit" {{ action "create" item}} disabled={{if (or item.isPristine item.isInvalid (eq item.Name '')) 'disabled'}}>Save</button>{{else}}<button type="submit" {{ action "update" item}} disabled={{if item.isInvalid 'disabled'}}>Save</button>
    31  {{/if}}
    32          <button type="reset" {{ action "cancel" item}}>Cancel</button>
    33  {{# if (and (not create) (not-eq item.ID 'anonymous')) }}
    34          {{#confirmation-dialog message='Are you sure you want to delete this ACL token?'}}
    35              {{#block-slot 'action' as |confirm|}}
    36                  <button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
    37              {{/block-slot}}
    38              {{#block-slot 'dialog' as |execute cancel message|}}
    39                {{delete-confirmation message=message execute=execute cancel=cancel}}
    40              {{/block-slot}}
    41          {{/confirmation-dialog}}
    42  {{/if}}
    43      </div>
    44  </form>
    45