open-consul/ui-v2/app/components/consul-lock-session-list/index.hbs

74 lines
1.9 KiB
Handlebars
Raw Normal View History

{{#if (gt items.length 0)}}
<ListCollection @items={{items}} class="consul-lock-session-list" as |item index|>
<BlockSlot @name="header">
<span>{{item.Name}}</span>
</BlockSlot>
<BlockSlot @name="details">
<dl>
<dt>
<CopyButton
@value={{item.ID}}
@name="ID"
/>
</dt>
<dd>{{item.ID}}</dd>
</dl>
<dl class="lock-delay">
<dt>
<Tooltip>
Delay
</Tooltip>
</dt>
<dd data-test-session-delay>{{format-time item.LockDelay}}</dd>
</dl>
<dl class="ttl">
<dt>
<Tooltip>
TTL
</Tooltip>
</dt>
<dd data-test-session-ttl={{item.TTL}}>{{item.TTL}}</dd>
</dl>
<dl class="behavior">
<dt>
<Tooltip>
Behavior
</Tooltip>
</dt>
<dd>{{item.Behavior}}</dd>
</dl>
<dl class="checks">
<dt>
<Tooltip>
Checks
</Tooltip>
</dt>
<dd>
{{#each item.Checks as |item|}}
<span>{{item}}</span>
{{/each}}
</dd>
</dl>
</BlockSlot>
<BlockSlot @name="actions">
<ConfirmationDialog @message="Are you sure you want to invalidate this session?">
<BlockSlot @name="action" as |confirm|>
<button data-test-delete
type="button"
class="type-delete"
onclick={{queue (action confirm onInvalidate item) (refresh-route)}}
>
Invalidate
</button>
</BlockSlot>
<BlockSlot @name="dialog" as |execute cancel message|>
<p>
{{message}}
</p>
<button type="button" class="type-delete" {{action execute}}>Confirm Invalidate</button>
<button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
</BlockSlot>
</ConfirmationDialog>
</BlockSlot>
</ListCollection>
{{/if}}