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

     1  <form>
     2      <fieldset>
     3          <label data-test-source-element class="type-text{{if item.error.SourceName ' has-error'}}">
     4              <span>Source Service</span>
     5              {{#power-select-with-create
     6                options=items
     7                searchField='Name'
     8                selected=SourceName
     9                searchPlaceholder='Type service name'
    10                buildSuggestion=(action 'createNewLabel')
    11                showCreateWhen=(action "isUnique")
    12                oncreate=(action 'change' 'SourceName')
    13                onchange=(action 'change' 'SourceName') as |service search|
    14              }}
    15                {{#if (eq service.Name '*') }}
    16                  * (All Services)
    17                {{else}}
    18                  {{service.Name}}
    19                {{/if}}
    20              {{/power-select-with-create}}
    21              <em>Choose a Consul Service, write in a future Consul Service, or write any Service URL</em>
    22          </label>
    23          <label data-test-destination-element class="type-text{{if item.error.DestinationName ' has-error'}}">
    24              <span>Destination Service</span>
    25              {{#power-select-with-create
    26                options=items
    27                searchField='Name'
    28                selected=DestinationName
    29                searchPlaceholder='Type service name'
    30                buildSuggestion=(action 'createNewLabel')
    31                showCreateWhen=(action "isUnique")
    32                oncreate=(action 'change' 'DestinationName')
    33                onchange=(action 'change' 'DestinationName') as |service|
    34              }}
    35                {{#if (eq service.Name '*') }}
    36                  * (All Services)
    37                {{else}}
    38                  {{service.Name}}
    39                {{/if}}
    40              {{/power-select-with-create}}
    41              <em>Choose a Consul Service, write in a future Consul Service, or write any Service URL</em>
    42          </label>
    43          <div role="radiogroup" class={{if item.error.Action ' has-error'}}>
    44              {{#each intents as |intent|}}
    45                  <label>
    46                      <span>{{ capitalize intent }}</span>
    47                      <input type="radio" name="Action" value="{{intent}}" checked={{if (eq item.Action intent) 'checked'}} onchange={{ action 'change' }}/>
    48                  </label>
    49              {{/each}}
    50          </div>
    51          <label class="type-text{{if item.error.Description ' has-error'}}">
    52              <span>Description</span>
    53              <input type="text" name="Description" value="{{item.Description}}" placeholder="Description" onchange={{action 'change'}} />
    54              <em>Choose a Consul Service, write in a future Consul Service, or write any Service URL</em>
    55          </label>
    56      </fieldset>
    57      <div>
    58  {{#if create }}
    59          <button type="submit" {{ action "create" item}} disabled={{if (or item.isPristine item.isInvalid) 'disabled'}}>Save</button>
    60  {{ else }}
    61          <button type="submit" {{ action "update" item}} disabled={{if item.isInvalid 'disabled'}}>Save</button>
    62  {{/if}}
    63          <button type="reset" {{ action "cancel" item}}>Cancel</button>
    64  {{# if (and item.ID (not-eq item.ID 'anonymous')) }}
    65          {{#confirmation-dialog message='Are you sure you want to delete this Intention?'}}
    66              {{#block-slot 'action' as |confirm|}}
    67                  <button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
    68              {{/block-slot}}
    69              {{#block-slot 'dialog' as |execute cancel message|}}
    70                {{delete-confirmation message=message execute=execute cancel=cancel}}
    71              {{/block-slot}}
    72          {{/confirmation-dialog}}
    73  {{/if}}
    74      </div>
    75  </form>
    76