83 lines
3.5 KiB
Handlebars
83 lines
3.5 KiB
Handlebars
<div class="page-header">
|
|
<div>
|
|
<h2>Screen Groups</h2>
|
|
<p>Register display endpoints and keep playlist assignments in sync.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-outline card-primary" data-table-search-container data-table-pagination-card>
|
|
<div class="card-header">
|
|
<h3 class="card-title">Existing screen groups</h3>
|
|
<div class="card-tools d-flex flex-nowrap align-items-center gap-2">
|
|
<div class="input-group input-group-sm flex-shrink-1" style="width: min(14rem, 100%);">
|
|
<span class="input-group-text" aria-hidden="true"><i class="bi bi-search"></i></span>
|
|
<input type="search" class="form-control" placeholder="Search screen groups" aria-label="Search screen groups" data-table-search />
|
|
</div>
|
|
{{#if (hasPermission currentUser 'screens.create')}}
|
|
<a class="btn btn-primary btn-sm" href="/screens/new">Add screen group</a>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
<div class="card-body table-responsive p-0">
|
|
<table class="table table-striped w-100 mb-0" data-table-searchable>
|
|
<thead>
|
|
<tr>
|
|
<th data-table-sort-key="name">Name</th>
|
|
<th data-table-sort-key="url">Player URL</th>
|
|
<th data-table-sort-key="playlist">Playlist</th>
|
|
<th data-table-sort-key="player_connection_count">Connected</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#if screens.length}}
|
|
{{#each screens}}
|
|
<tr data-table-search-row>
|
|
<td data-label="Name">{{name}}</td>
|
|
<td data-label="Player URL">
|
|
{{#if player_url}}
|
|
<a href="{{player_url}}" target="_blank">{{player_url}}</a>
|
|
{{else}}
|
|
<span class="empty">Not available</span>
|
|
{{/if}}
|
|
</td>
|
|
<td data-label="Playlist">{{playlist_name}}</td>
|
|
<td data-label="Connected clients">
|
|
{{#if (gt player_connection_count 0)}}
|
|
<div class="connection-count"><span class="chip">{{player_connection_count}} {{#if (eq player_connection_count 1)}}client{{else}}clients{{/if}}</span></div>
|
|
{{else}}
|
|
<span class="empty">No clients connected.</span>
|
|
{{/if}}
|
|
</td>
|
|
<td data-label="Actions">
|
|
{{#if (anyPermission ../currentUser 'screens.update' 'screens.delete')}}
|
|
<div class="actions">
|
|
{{#if (hasPermission ../currentUser 'screens.update')}}
|
|
<a class="btn btn-sm btn-primary" href="/screens/{{id}}/edit">Edit</a>
|
|
{{/if}}
|
|
{{#if (hasPermission ../currentUser 'screens.delete')}}
|
|
<form class="inline-form" method="post" action="/screens/{{id}}/delete" data-confirm-message="Delete this screen group?">
|
|
{{#if (gt player_connection_count 0)}}
|
|
<button class="btn btn-sm btn-outline-danger" type="submit" disabled>Delete</button>
|
|
{{else}}
|
|
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
|
{{/if}}
|
|
</form>
|
|
{{/if}}
|
|
</div>
|
|
{{else}}
|
|
<span class="empty">-</span>
|
|
{{/if}}
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
{{else}}
|
|
<tr data-table-search-empty-default><td colspan="5" class="empty">No screen groups yet.</td></tr>
|
|
{{/if}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{> table-pagination pagination=pagination basePath="/screens" alwaysShow=true}}
|
|
</div>
|
|
|