2020-04-01 08:55:49 +00:00
|
|
|
<form onsubmit={{action 'submit' _item}}>
|
2019-12-17 18:47:37 +00:00
|
|
|
<fieldset>
|
|
|
|
<div role="group">
|
|
|
|
<fieldset>
|
|
|
|
<h2>Source</h2>
|
2020-04-01 08:55:49 +00:00
|
|
|
<label data-test-source-element class="type-text{{if _item.error.SourceName ' has-error'}}">
|
2019-12-17 18:47:37 +00:00
|
|
|
<span>Source Service</span>
|
2020-02-21 16:48:54 +00:00
|
|
|
<PowerSelectWithCreate
|
2020-04-01 08:55:49 +00:00
|
|
|
@options={{_services}}
|
2020-02-21 16:48:54 +00:00
|
|
|
@searchField="Name"
|
|
|
|
@selected={{SourceName}}
|
|
|
|
@searchPlaceholder="Type service name"
|
|
|
|
@buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}}
|
|
|
|
@showCreateWhen={{action "isUnique"}}
|
|
|
|
@onCreate={{action "change" "SourceName"}}
|
|
|
|
@onChange={{action "change" "SourceName"}} as |service|>
|
|
|
|
{{#if (eq service.Name '*') }}
|
|
|
|
* (All Services)
|
|
|
|
{{else}}
|
|
|
|
{{service.Name}}
|
|
|
|
{{/if}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</PowerSelectWithCreate>
|
2019-12-17 18:47:37 +00:00
|
|
|
<em>Search for an existing service, write in a future one, or write in any Service URI.</em>
|
2018-05-22 15:03:45 +00:00
|
|
|
</label>
|
2019-12-17 18:47:37 +00:00
|
|
|
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
|
2020-04-01 08:55:49 +00:00
|
|
|
<label data-test-source-nspace class="type-text{{if _item.error.SourceNS ' has-error'}}">
|
2019-12-17 18:47:37 +00:00
|
|
|
<span>Source Namespace</span>
|
2020-02-21 16:48:54 +00:00
|
|
|
<PowerSelectWithCreate
|
2020-04-01 08:55:49 +00:00
|
|
|
@options={{_nspaces}}
|
2020-02-21 16:48:54 +00:00
|
|
|
@searchField="Name"
|
|
|
|
@selected={{SourceNS}}
|
|
|
|
@searchPlaceholder="Type namespace name"
|
|
|
|
@buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}}
|
|
|
|
@showCreateWhen={{action "isUnique"}}
|
|
|
|
@onCreate={{action "change" "SourceNS"}}
|
|
|
|
@onChange={{action "change" "SourceNS"}} as |nspace|>
|
|
|
|
{{#if (eq nspace.Name '*') }}
|
|
|
|
* (All Namespaces)
|
|
|
|
{{else}}
|
|
|
|
{{nspace.Name}}
|
|
|
|
{{/if}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</PowerSelectWithCreate>
|
2019-12-17 18:47:37 +00:00
|
|
|
<em>Search for an existing namespace, write in a future one.</em>
|
|
|
|
</label>
|
|
|
|
{{/if}}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
<h2>Destination</h2>
|
2020-04-01 08:55:49 +00:00
|
|
|
<label data-test-destination-element class="type-text{{if _item.error.DestinationName ' has-error'}}">
|
2019-12-17 18:47:37 +00:00
|
|
|
<span>Destination Service</span>
|
2020-02-21 16:48:54 +00:00
|
|
|
<PowerSelectWithCreate
|
2020-04-01 08:55:49 +00:00
|
|
|
@options={{_services}}
|
2020-02-21 16:48:54 +00:00
|
|
|
@searchField="Name"
|
|
|
|
@selected={{DestinationName}}
|
|
|
|
@searchPlaceholder="Type service name"
|
|
|
|
@buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}}
|
|
|
|
@showCreateWhen={{action "isUnique"}}
|
|
|
|
@onCreate={{action "change" "DestinationName"}}
|
|
|
|
@onChange={{action "change" "DestinationName"}} as |service|>
|
|
|
|
{{#if (eq service.Name '*') }}
|
|
|
|
* (All Services)
|
|
|
|
{{else}}
|
|
|
|
{{service.Name}}
|
|
|
|
{{/if}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</PowerSelectWithCreate>
|
2019-12-17 18:47:37 +00:00
|
|
|
<em>Search for an existing service or write in a future one.</em>
|
2018-05-22 15:03:45 +00:00
|
|
|
</label>
|
2019-12-17 18:47:37 +00:00
|
|
|
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
|
2020-04-01 08:55:49 +00:00
|
|
|
<label data-test-destination-nspace class="type-text{{if _item.error.DestinationNS ' has-error'}}">
|
2019-12-17 18:47:37 +00:00
|
|
|
<span>Destination Namespace</span>
|
2020-02-21 16:48:54 +00:00
|
|
|
<PowerSelectWithCreate
|
2020-04-01 08:55:49 +00:00
|
|
|
@options={{_nspaces}}
|
2020-02-21 16:48:54 +00:00
|
|
|
@searchField="Name"
|
|
|
|
@selected={{DestinationNS}}
|
|
|
|
@searchPlaceholder="Type namespace name"
|
|
|
|
@buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}}
|
|
|
|
@showCreateWhen={{action "isUnique"}}
|
|
|
|
@onCreate={{action "change" "DestinationNS"}}
|
|
|
|
@onChange={{action "change" "DestinationNS"}} as |nspace|>
|
|
|
|
{{#if (eq nspace.Name '*') }}
|
|
|
|
* (All Namespaces)
|
|
|
|
{{else}}
|
|
|
|
{{nspace.Name}}
|
|
|
|
{{/if}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</PowerSelectWithCreate>
|
2019-12-17 18:47:37 +00:00
|
|
|
<em>For the destination, you may choose any namespace for which you have access.</em>
|
2018-05-22 15:03:45 +00:00
|
|
|
</label>
|
2019-12-17 18:47:37 +00:00
|
|
|
{{/if}}
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
2020-04-01 08:55:49 +00:00
|
|
|
<div role="radiogroup" class={{if _item.error.Action ' has-error'}}>
|
2019-12-17 18:47:37 +00:00
|
|
|
{{#each (array 'allow' 'deny') as |intent|}}
|
|
|
|
<label>
|
|
|
|
<span>{{ capitalize intent }}</span>
|
2020-04-01 08:55:49 +00:00
|
|
|
<input type="radio" name="Action" value="{{intent}}" checked={{if (eq _item.Action intent) 'checked'}} onchange={{ action 'change' }}/>
|
2019-12-17 18:47:37 +00:00
|
|
|
</label>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
2020-04-01 08:55:49 +00:00
|
|
|
<label class="type-text{{if _item.error.Description ' has-error'}}">
|
2019-12-17 18:47:37 +00:00
|
|
|
<span>Description (Optional)</span>
|
2020-04-01 08:55:49 +00:00
|
|
|
<input type="text" name="Description" value="{{_item.Description}}" placeholder="Description (Optional)" onchange={{action 'change'}} />
|
2019-12-17 18:47:37 +00:00
|
|
|
</label>
|
|
|
|
</fieldset>
|
|
|
|
<div>
|
2020-04-01 08:55:49 +00:00
|
|
|
{{#if _item.isNew }}
|
|
|
|
<button type="submit" disabled={{if (or _item.isPristine _item.isInvalid) 'disabled'}}>Save</button>
|
2018-05-22 15:03:45 +00:00
|
|
|
{{ else }}
|
2020-04-01 08:55:49 +00:00
|
|
|
<button type="submit" disabled={{if _item.isInvalid 'disabled'}}>Save</button>
|
2018-05-22 15:03:45 +00:00
|
|
|
{{/if}}
|
2020-04-01 08:55:49 +00:00
|
|
|
<button type="reset" onclick={{action oncancel _item}}>Cancel</button>
|
|
|
|
{{# if (and _item.ID (not-eq _item.ID 'anonymous')) }}
|
2020-02-19 19:26:38 +00:00
|
|
|
<ConfirmationDialog @message="Are you sure you want to delete this Intention?">
|
|
|
|
<BlockSlot @name="action" as |confirm|>
|
2020-04-01 08:55:49 +00:00
|
|
|
<button data-test-delete type="button" class="type-delete" {{action confirm ondelete _item}}>Delete</button>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="dialog" as |execute cancel message|>
|
|
|
|
<DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
|
|
|
|
</BlockSlot>
|
|
|
|
</ConfirmationDialog>
|
2018-05-22 15:03:45 +00:00
|
|
|
{{/if}}
|
2019-12-17 18:47:37 +00:00
|
|
|
</div>
|
2018-05-22 15:03:45 +00:00
|
|
|
</form>
|
|
|
|
|