2020-07-09 09:08:47 +00:00
|
|
|
<DataWriter
|
|
|
|
@sink={{concat '/' dc '/' nspace '/intention/'}}
|
|
|
|
@type="intention"
|
|
|
|
@ondelete={{action ondelete}}
|
|
|
|
as |writer|>
|
|
|
|
<BlockSlot @name="content">
|
|
|
|
{{#if (gt items.length 0)}}
|
|
|
|
|
2020-09-18 10:14:06 +00:00
|
|
|
<TabularCollection class="consul-intention-list"
|
|
|
|
@items={{items}}
|
|
|
|
@rowHeight={{59}}
|
|
|
|
as |item index|>
|
2020-07-09 09:08:47 +00:00
|
|
|
<BlockSlot @name="header">
|
2020-09-18 10:14:06 +00:00
|
|
|
<th class="source">Source</th>
|
|
|
|
<th class="intent"> </th>
|
|
|
|
<th class="destination">Destination</th>
|
|
|
|
<th class="permissions">
|
|
|
|
Permissions
|
|
|
|
<span>
|
|
|
|
<Tooltip>Permissions intercept an Intention's traffic using L7 criteria, such as path prefixes and http headers.</Tooltip>
|
|
|
|
</span>
|
|
|
|
</th>
|
|
|
|
<th class="meta"> </th>
|
2020-07-09 09:08:47 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="row">
|
|
|
|
<td class="source" data-test-intention={{item.ID}}>
|
|
|
|
<a href={{href-to (or routeName 'dc.intentions.edit') item.ID}} data-test-intention-source={{item.SourceName}}>
|
|
|
|
{{#if (eq item.SourceName '*') }}
|
|
|
|
All Services (*)
|
|
|
|
{{else}}
|
|
|
|
{{item.SourceName}}
|
|
|
|
{{/if}}
|
|
|
|
{{! TODO: slugify }}
|
|
|
|
<em class={{concat 'nspace-' (or item.SourceNS 'default')}}>{{or item.SourceNS 'default'}}</em>
|
|
|
|
</a>
|
|
|
|
</td>
|
2020-09-18 10:14:06 +00:00
|
|
|
{{#let (or item.Action "L7 rules") as |intent|}}
|
|
|
|
<td class="intent intent-{{slugify intent}}" data-test-intention-action={{intent}}>
|
|
|
|
<strong>{{capitalize intent}}</strong>
|
2020-07-09 09:08:47 +00:00
|
|
|
</td>
|
2020-09-18 10:14:06 +00:00
|
|
|
{{/let}}
|
2020-07-09 09:08:47 +00:00
|
|
|
<td class="destination" data-test-intention-destination="{{item.DestinationName}}">
|
|
|
|
<span>
|
|
|
|
{{#if (eq item.DestinationName '*') }}
|
|
|
|
All Services (*)
|
|
|
|
{{else}}
|
|
|
|
{{item.DestinationName}}
|
|
|
|
{{/if}}
|
|
|
|
{{! TODO: slugify }}
|
|
|
|
<em class={{concat 'nspace-' (or item.DestinationNS 'default')}}>{{or item.DestinationNS 'default'}}</em>
|
|
|
|
</span>
|
|
|
|
</td>
|
2020-09-18 10:14:06 +00:00
|
|
|
<td class="permissions">
|
|
|
|
{{#if (gt item.Permissions.length 0)}}
|
|
|
|
<span>{{pluralize item.Permissions.length 'Permission'}}</span>
|
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
<td class="meta">
|
|
|
|
{{#if item.IsManagedByCRD}}
|
|
|
|
<ConsulExternalSource @item={{item}} @label="Managed by CRD" />
|
|
|
|
{{/if}}
|
2020-07-09 09:08:47 +00:00
|
|
|
</td>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions" as |index change checked|>
|
|
|
|
<PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
|
|
|
|
<BlockSlot @name="trigger">
|
|
|
|
More
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="menu" as |confirm send keypressClick change|>
|
2020-09-18 10:14:06 +00:00
|
|
|
{{#if item.IsEditable}}
|
2020-07-09 09:08:47 +00:00
|
|
|
<li role="none">
|
|
|
|
<a role="menuitem" tabindex="-1" href={{href-to (or routeName 'dc.intentions.edit') item.ID}}>Edit</a>
|
|
|
|
</li>
|
|
|
|
<li role="none" class="dangerous">
|
|
|
|
<label for={{confirm}} role="menuitem" tabindex="-1" onkeypress={{keypressClick}} data-test-delete>Delete</label>
|
|
|
|
<div role="menu">
|
|
|
|
<div class="confirmation-alert warning">
|
|
|
|
<div>
|
|
|
|
<header>
|
|
|
|
Confirm Delete
|
|
|
|
</header>
|
|
|
|
<p>
|
|
|
|
Are you sure you want to delete this intention?
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<ul>
|
|
|
|
<li class="dangerous">
|
|
|
|
<button tabindex="-1" type="button" class="type-delete" onclick={{queue (action change) (action writer.delete item)}}>Delete</button>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<label for={{confirm}}>Cancel</label>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
2020-09-18 10:14:06 +00:00
|
|
|
{{else}}
|
|
|
|
<li role="none">
|
|
|
|
<a role="menuitem" tabindex="-1" href={{href-to (or routeName 'dc.intentions.edit') item.ID}}>View</a>
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
2020-07-09 09:08:47 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</PopoverMenu>
|
|
|
|
</BlockSlot>
|
|
|
|
</TabularCollection>
|
|
|
|
|
|
|
|
{{else}}
|
|
|
|
{{yield}}
|
|
|
|
{{/if}}
|
2020-04-01 08:55:49 +00:00
|
|
|
</BlockSlot>
|
2020-07-09 09:08:47 +00:00
|
|
|
</DataWriter>
|