2019-12-17 18:47:37 +00:00
<form>
2021-03-11 09:29:11 +00:00
<fieldset
disabled= {{ if ( not ( can "write nspace" item = item ) ) "disabled" }}
>
2019-12-17 18:47:37 +00:00
{{ # if create }}
<label class="type-text {{ if item .error .Name ' has-error' }} ">
<span>Name</span>
<input autofocus="autofocus" type="text" value= {{ item .Name }} name="Name" oninput= {{ action 'change' }} placeholder="Name" />
<em>
Must be a valid DNS hostname. Must contain 1-64 characters (numbers, letters, and hyphens), and must begin with a letter. Once created, this cannot be changed.
</em>
{{ # if item .error .Name }}
<strong> {{ item .error .Name .validation }} </strong>
{{ / if }}
</label>
{{ / if }}
<label class="type-text validate-optional">
<span>Description (Optional)</span>
<textarea name="Description" oninput= {{ action 'change' }} > {{ item .Description }} </textarea>
</label>
</fieldset>
{{ # if ( env 'CONSUL_ACLS_ENABLED' ) }}
<fieldset id="roles">
<h2>Roles</h2>
<p>
2021-03-11 09:29:11 +00:00
{{ # if ( can "write nspace" item = item ) }}
2019-12-17 18:47:37 +00:00
By adding roles to this namespaces, you will apply them to all tokens created within this namespace.
2021-03-11 09:29:11 +00:00
{{ else }}
The following roles are applied to all tokens created within this namespace.
{{ / if }}
2019-12-17 18:47:37 +00:00
</p>
2021-03-11 09:29:11 +00:00
<RoleSelector
@disabled= {{ not ( can "write nspace" item = item ) }}
@dc= {{ dc }}
@nspace="default"
@items= {{ item .ACLs .RoleDefaults }}
/>
2019-12-17 18:47:37 +00:00
</fieldset>
<fieldset id="policies">
<h2>Policies</h2>
<p>
2021-03-11 09:29:11 +00:00
{{ # if ( can "write nspace" item = item ) }}
2019-12-17 18:47:37 +00:00
By adding policies to this namespaces, you will apply them to all tokens created within this namespace.
2021-03-11 09:29:11 +00:00
{{ else }}
The following policies are applied to all tokens created within this namespace.
{{ / if }}
2019-12-17 18:47:37 +00:00
</p>
2021-03-11 09:29:11 +00:00
<PolicySelector
@disabled= {{ not ( can "write nspace" item = item ) }}
@dc= {{ dc }}
@nspace="default"
@allowIdentity= {{ false }}
@items= {{ item .ACLs .PolicyDefaults }}
/>
2019-12-17 18:47:37 +00:00
</fieldset>
{{ / if }}
<div>
2021-03-11 09:29:11 +00:00
{{ # if ( and create ( can "create nspaces" ) ) }}
2019-12-17 18:47:37 +00:00
<button type="submit" {{ action "create" item }} disabled= {{ if ( or item .isPristine item .isInvalid ) 'disabled' }} >Save</button>
2021-03-11 09:29:11 +00:00
{{ else }}
{{ # if ( can "write nspace" item = item ) }}
2019-12-17 18:47:37 +00:00
<button type="submit" {{ action "update" item }} disabled= {{ if item .isInvalid 'disabled' }} >Save</button>
2021-03-11 09:29:11 +00:00
{{ / if }}
2019-12-17 18:47:37 +00:00
{{ / if }}
<button type="reset" {{ action "cancel" item }} >Cancel</button>
2021-03-11 09:29:11 +00:00
{{ # if ( and ( not create ) ( can "delete nspace" item = item ) ) }}
2020-02-19 19:26:38 +00:00
<ConfirmationDialog @message="Are you sure you want to delete this Namespace?">
<BlockSlot @name="action" as |confirm|>
2019-12-17 18:47:37 +00:00
<button data-test-delete type="button" class="type-delete" {{ action confirm 'delete' item parent }} >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>
2019-12-17 18:47:37 +00:00
{{ / if }}
</div>
</form>