prism/service/server/templates/app-list.html
2026-02-18 00:29:47 -08:00

60 lines
2.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{if .}}
<ul class="app-list">
{{range .}}
{{$app := .}}
<li class="app-item">
<div class="app-info">
<div class="app-name"><strong>{{.AppName}}</strong></div>
{{if .Channels}}
<div class="app-subscriptions">
{{range .Channels}}
{{$channel := .}}
{{if .Toggleable}}
{{if .Active}}
<button type="button" class="channel-badge channel-{{.Channel}} badge-active"
hx-delete="/apps/{{$app.AppName}}/subscriptions/{{(index .Subscriptions 0).ID}}"
hx-target="#apps-list"
hx-swap="innerHTML">
{{.Label}}
<span class="tooltip">Subscription ID: {{(index .Subscriptions 0).ID}}</span>
</button>
{{else}}
<button type="button" class="channel-badge channel-{{.Channel}} badge-inactive"
hx-post="/apps/{{$app.AppName}}/subscriptions"
hx-target="#apps-list"
hx-swap="innerHTML"
hx-vals='{"channel":"{{.Channel}}"}'>
+ {{.Label}}
<span class="tooltip">Click to enable</span>
</button>
{{end}}
{{else}}
{{range .Subscriptions}}
<span class="channel-badge channel-{{$channel.Channel}} badge-subscribed">
{{$channel.Label}}
<span class="tooltip">Subscription ID: {{.ID}}</span>
<button type="button" class="btn-delete-sub"
hx-delete="/apps/{{$app.AppName}}/subscriptions/{{.ID}}"
hx-target="#apps-list"
hx-swap="innerHTML"
hx-confirm="Delete this channel?">×</button>
</span>
{{end}}
{{end}}
{{end}}
</div>
{{else}}
<div class="app-no-subscriptions">
<span class="channel-badge channel-not-configured">No channels enabled</span>
</div>
{{end}}
</div>
<div class="app-actions">
<button type="button" class="btn-delete" hx-delete="/apps/{{.AppName}}" hx-target="#apps-list" hx-swap="innerHTML" hx-confirm="Delete {{.AppName}} and all subscriptions?">Delete</button>
</div>
</li>
{{end}}
</ul>
{{else}}
<p>No apps registered yet. See <a href="https://github.com/lone-cloud/prism?tab=readme-ov-file#real-world-examples" target="_blank" rel="noopener noreferrer">real-world examples</a> to get started.</p>
{{end}}