2018-05-22 15:03:45 +00:00
|
|
|
<form>
|
|
|
|
<fieldset>
|
2018-06-15 11:47:12 +00:00
|
|
|
<label data-test-source-element class="type-text{{if item.error.SourceName ' has-error'}}">
|
2018-05-22 15:03:45 +00:00
|
|
|
<span>Source Service</span>
|
2018-06-08 12:20:13 +00:00
|
|
|
{{#power-select-with-create
|
2018-06-05 16:09:26 +00:00
|
|
|
options=items
|
|
|
|
searchField='Name'
|
|
|
|
selected=SourceName
|
|
|
|
searchPlaceholder='Type service name'
|
2018-11-19 14:54:40 +00:00
|
|
|
buildSuggestion=(action 'createNewLabel' "Use a future Consul Service called '{{term}}'")
|
2018-06-11 14:53:12 +00:00
|
|
|
showCreateWhen=(action "isUnique")
|
2018-06-08 12:20:13 +00:00
|
|
|
oncreate=(action 'change' 'SourceName')
|
|
|
|
onchange=(action 'change' 'SourceName') as |service search|
|
2018-06-05 16:09:26 +00:00
|
|
|
}}
|
2018-06-08 12:20:13 +00:00
|
|
|
{{#if (eq service.Name '*') }}
|
|
|
|
* (All Services)
|
|
|
|
{{else}}
|
|
|
|
{{service.Name}}
|
|
|
|
{{/if}}
|
|
|
|
{{/power-select-with-create}}
|
2018-05-22 15:03:45 +00:00
|
|
|
<em>Choose a Consul Service, write in a future Consul Service, or write any Service URL</em>
|
|
|
|
</label>
|
2018-06-15 11:47:12 +00:00
|
|
|
<label data-test-destination-element class="type-text{{if item.error.DestinationName ' has-error'}}">
|
2018-05-22 15:03:45 +00:00
|
|
|
<span>Destination Service</span>
|
2018-06-08 12:20:13 +00:00
|
|
|
{{#power-select-with-create
|
2018-06-05 16:09:26 +00:00
|
|
|
options=items
|
|
|
|
searchField='Name'
|
|
|
|
selected=DestinationName
|
|
|
|
searchPlaceholder='Type service name'
|
2018-11-19 14:54:40 +00:00
|
|
|
buildSuggestion=(action 'createNewLabel' "Use a future Consul Service called '{{term}}'")
|
2018-06-11 14:53:12 +00:00
|
|
|
showCreateWhen=(action "isUnique")
|
2018-06-08 12:20:13 +00:00
|
|
|
oncreate=(action 'change' 'DestinationName')
|
2018-06-05 16:09:26 +00:00
|
|
|
onchange=(action 'change' 'DestinationName') as |service|
|
|
|
|
}}
|
2018-06-08 12:20:13 +00:00
|
|
|
{{#if (eq service.Name '*') }}
|
|
|
|
* (All Services)
|
|
|
|
{{else}}
|
|
|
|
{{service.Name}}
|
|
|
|
{{/if}}
|
|
|
|
{{/power-select-with-create}}
|
2018-05-22 15:03:45 +00:00
|
|
|
<em>Choose a Consul Service, write in a future Consul Service, or write any Service URL</em>
|
|
|
|
</label>
|
|
|
|
<div role="radiogroup" class={{if item.error.Action ' has-error'}}>
|
2018-05-22 16:12:36 +00:00
|
|
|
{{#each intents as |intent|}}
|
2018-05-22 15:03:45 +00:00
|
|
|
<label>
|
2018-09-21 09:18:32 +00:00
|
|
|
<span>{{ capitalize intent }}</span>
|
2018-05-22 15:03:45 +00:00
|
|
|
<input type="radio" name="Action" value="{{intent}}" checked={{if (eq item.Action intent) 'checked'}} onchange={{ action 'change' }}/>
|
|
|
|
</label>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
<label class="type-text{{if item.error.Description ' has-error'}}">
|
|
|
|
<span>Description</span>
|
2018-06-12 15:22:54 +00:00
|
|
|
<input type="text" name="Description" value="{{item.Description}}" placeholder="Description" onchange={{action 'change'}} />
|
2018-05-22 15:03:45 +00:00
|
|
|
<em>Choose a Consul Service, write in a future Consul Service, or write any Service URL</em>
|
|
|
|
</label>
|
|
|
|
</fieldset>
|
|
|
|
<div>
|
|
|
|
{{#if create }}
|
2018-06-12 15:22:54 +00:00
|
|
|
<button type="submit" {{ action "create" item}} disabled={{if (or item.isPristine item.isInvalid) 'disabled'}}>Save</button>
|
2018-05-22 15:03:45 +00:00
|
|
|
{{ else }}
|
|
|
|
<button type="submit" {{ action "update" item}} disabled={{if item.isInvalid 'disabled'}}>Save</button>
|
|
|
|
{{/if}}
|
|
|
|
<button type="reset" {{ action "cancel" item}}>Cancel</button>
|
|
|
|
{{# if (and item.ID (not-eq item.ID 'anonymous')) }}
|
|
|
|
{{#confirmation-dialog message='Are you sure you want to delete this Intention?'}}
|
|
|
|
{{#block-slot 'action' as |confirm|}}
|
2018-07-04 14:58:09 +00:00
|
|
|
<button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
|
2018-05-22 15:03:45 +00:00
|
|
|
{{/block-slot}}
|
|
|
|
{{#block-slot 'dialog' as |execute cancel message|}}
|
2018-10-19 15:17:02 +00:00
|
|
|
{{delete-confirmation message=message execute=execute cancel=cancel}}
|
2018-05-22 15:03:45 +00:00
|
|
|
{{/block-slot}}
|
|
|
|
{{/confirmation-dialog}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|