John Cowen f2accb0bd1 ui: Move routes to use data-sources (#8321)
* Add uri identifiers to all data source things and make them the same

1. Add uri identitifer to data-source service
2. Make <EventSource /> and <DataSource /> as close as possible
3. Add extra `.closed` method to get a list of inactive/closed/closing
data-sources from elsewhere

* Make the connections cleanup the least worst connection when required

* Pass the uri/request id through all the things

* Better user erroring

* Make event sources close on error

* Allow <DataLoader /> data slot to be configurable

* Allow the <DataWriter /> removed state to be configurable

* Don't error if meta is undefined

* Stitch together all the repositories into the data-source/sink

* Use data.source over repositories

* Add missing  <EventSource /> components

* Fix up the views/templates

* Disable all the old route based blocking query things

* We still need the repo for the mixin for the moment

* Don't default to default, default != ''
2020-07-17 13:43:16 +00:00

66 lines
2.3 KiB
Handlebars

<div id="lock-sessions" class="tab-section">
<div role="tabpanel">
{{#if (gt sessions.length 0)}}
<TabularCollection
data-test-sessions
class="sessions"
@items={{sessions}} as |item index|
>
<BlockSlot @name="header">
<th>Name</th>
<th>ID</th>
<th>Delay</th>
<th>TTL</th>
<th>Behavior</th>
<th>Checks</th>
<th>&nbsp;</th>
</BlockSlot>
<BlockSlot @name="row">
<td>
{{item.Name}}
</td>
<td>
{{item.ID}}
</td>
<td>
{{item.LockDelay}}
</td>
<td data-test-session-ttl="{{item.TTL}}">
{{item.TTL}}
</td>
<td>
{{item.Behavior}}
</td>
<td>
{{#if (gt item.Checks.length 0)}}
{{ join ', ' item.Checks}}
{{/if}}
</td>
<td>
<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 'invalidateSession' 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>
</td>
</BlockSlot>
</TabularCollection>
{{else}}
<EmptyState>
<BlockSlot @name="body">
<p>
There are no Lock Sessions for this Node. For more information, view <a href="{{ env 'CONSUL_DOCS_URL'}}/internals/sessions.html" rel="noopener noreferrer" target="_blank">our documentation</a>
</p>
</BlockSlot>
</EmptyState>
{{/if}}
</div>
</div>