mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 21:35:52 +00:00
8986b6ad7b
* ui: Move components to the new nested structure * Move data-test attribute to the correct HTML element We don't currently rely on this, but was incorrectly placed on the input rather than the label tag * Fix up left over curly bracket components that were causing issues For some reason the combination of: 1. Old style curly bracket components 2. data-test-* attributes 3. Moving to the new component file structure Meant that our data-test-* selectors where no longer being rendered. Whilst this had no effect on the app, it meant our tests suite could no longer select DOM elements in order to assert various things. Moving the old style curly bracket components to the new style XML/Angle bracket format fixes the issue * Update ui-v2/app/templates/dc/nodes/-services.hbs Co-Authored-By: Greg Hoin <1416421+gregone@users.noreply.github.com> * Update ui-v2/app/templates/dc/nodes/-services.hbs Co-Authored-By: Greg Hoin <1416421+gregone@users.noreply.github.com> Co-authored-by: Greg Hoin <1416421+gregone@users.noreply.github.com>
81 lines
3.5 KiB
Handlebars
81 lines
3.5 KiB
Handlebars
{{yield}}
|
|
<fieldset>
|
|
{{#yield-slot name='template'}}
|
|
{{else}}
|
|
<header>
|
|
Policy{{if allowServiceIdentity ' or service identity?' ''}}
|
|
</header>
|
|
{{#if allowServiceIdentity}}
|
|
<p>
|
|
A Service Identity is default policy with a configurable service name. This saves you some time and effort you're using Consul for Connect features.
|
|
</p>
|
|
{{! this should use radio-group }}
|
|
<div role="radiogroup" class={{if item.error.Type ' has-error'}}>
|
|
{{#each templates as |template|}}
|
|
<label data-test-radiobutton={{concat 'template_' template.template}}>
|
|
<span>{{template.name}}</span>
|
|
<input type="radio" name={{concat name '[template]'}} value={{template.template}} checked={{eq item.template template.template}} onchange={{action (changeset-set item 'template') value='target.value'}}/>
|
|
</label>
|
|
{{/each}}
|
|
</div>
|
|
{{else}}
|
|
<input type="hidden" name={{concat name '[template]'}} value="" />
|
|
{{/if}}
|
|
{{/yield-slot}}
|
|
<label class="type-text{{if (and item.error.Name (not item.isPristine)) ' has-error'}}">
|
|
<span>Name</span>
|
|
<input type="text" value={{item.Name}} name="{{name}}[Name]" autofocus="autofocus" oninput={{action 'change'}} />
|
|
<em>
|
|
Maximum 128 characters. May only include letters (uppercase and/or lowercase) and/or numbers. Must be unique.
|
|
</em>
|
|
{{#if (and item.error.Name (not item.isPristine))}}
|
|
<strong>{{item.error.Name.validation}}</strong>
|
|
{{/if}}
|
|
</label>
|
|
<label class="type-text" data-test-rules>
|
|
<span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span>
|
|
{{#if (eq item.template '') }}
|
|
<CodeEditor @syntax="hcl" @class={{if item.error.Rules "error"}} @name={{concat name "[Rules]"}} @value={{item.Rules}} @onkeyup={{action "change" (concat name "[Rules]")}} />
|
|
{{#if item.error.Rules}}
|
|
<strong>{{item.error.Rules.validation}}</strong>
|
|
{{/if}}
|
|
{{else}}
|
|
<CodeEditor @readonly={{true}} @name={{concat name "[Rules]"}} @syntax="hcl" @oninput={{action "change" (concat name "[Rules]")}}>
|
|
{{~component 'service-identity' name=item.Name~}}
|
|
</CodeEditor>
|
|
{{/if}}
|
|
</label>
|
|
<div class="type-toggle">
|
|
<span>Valid datacenters</span>
|
|
<label>
|
|
<input type="checkbox" name="{{name}}[isScoped]" checked={{if (not isScoped) 'checked' }} onchange={{action 'change'}} />
|
|
<span>All</span>
|
|
</label>
|
|
</div>
|
|
{{#if isScoped }}
|
|
<div class="checkbox-group" role="group">
|
|
{{#each datacenters as |dc| }}
|
|
<label class="type-checkbox">
|
|
<input type="checkbox" name="{{name}}[Datacenters]" value={{dc.Name}} checked={{if (contains dc.Name item.Datacenters) 'checked' }} onchange={{action 'change'}} />
|
|
<span>{{dc.Name}}</span>
|
|
</label>
|
|
{{/each}}
|
|
{{#each item.Datacenters as |dc| }}
|
|
{{#if (not (find-by 'Name' dc datacenters))}}
|
|
<label class="type-checkbox">
|
|
<input type="checkbox" name="{{name}}[Datacenters]" value={{dc}} checked="checked" onchange={{action 'change'}} />
|
|
<span>{{dc}}</span>
|
|
</label>
|
|
{{/if}}
|
|
{{/each}}
|
|
</div>
|
|
{{/if}}
|
|
{{#if (eq item.template '') }}
|
|
<label class="type-text">
|
|
<span>Description (Optional)</span>
|
|
<textarea name="{{name}}[Description]" value={{item.Description}} oninput={{action 'change'}}></textarea>
|
|
</label>
|
|
{{/if}}
|
|
</fieldset>
|
|
|