Files
MeshTender/internal/core/templates/repeaters.html
T
2026-06-28 17:56:51 -04:00

63 lines
3.0 KiB
HTML

{{define "title"}}Repeaters · MeshTender{{end}}
{{define "header"}}
<div class="row g-2 align-items-center">
<div class="col">
<div class="page-pretitle">Your equipment</div>
<h2 class="page-title">Repeaters</h2>
</div>
<div class="col-auto ms-auto d-print-none">
<a class="btn btn-primary" href="/repeaters/add">{{template "icon-plus" "me-1"}}Add repeater</a>
</div>
</div>
{{end}}
{{define "content"}}
{{if .Error}}<div class="alert alert-danger" role="alert">{{.Error}}</div>{{end}}
{{if .Repeaters}}
<div class="row row-cards">
{{range .Repeaters}}
<div class="col-12">
<a class="card card-link card-link-pop text-reset" href="/repeaters/{{.PublicID}}">
<div class="card-body py-3">
<div class="d-flex align-items-center gap-3">
<span class="avatar bg-blue-lt d-none d-sm-flex">{{template "icon-antenna" ""}}</span>
<div class="flex-fill" style="min-width:0">
<div class="d-flex align-items-center flex-wrap gap-2">
<h3 class="m-0 fs-3">{{.Name}}</h3>
{{if .Shared}}<span class="badge bg-purple-lt">Shared</span>{{else}}<span class="badge bg-blue-lt">Owned</span>{{end}}
{{template "repstatus" .}}
</div>
<div class="d-flex align-items-center flex-wrap gap-2 mt-1 text-secondary">
<span class="font-monospace">{{slice .PublicKeyHex 0 8}}…</span>
<span class="ms-1">·</span>
{{if .Shared}}<span>Shared by {{.OwnerName}}</span>{{else}}<span>{{template "sharetext" (index $.ShareCounts .ID)}}</span>{{end}}
</div>
</div>
</div>
{{if and (not .Shared) .Confirmed .AccessKnown (not .IsAdmin)}}
<div class="alert alert-warning mt-3 mb-0">
MeshTender only has <strong>guest</strong> access here. Guest is available to anyone with a blank password, so there's no point operating at this level — re-run <code>setperm &lt;your key&gt; 3</code> on the repeater to grant admin, then re-test.
</div>
{{end}}
</div>
</a>
</div>
{{end}}
</div>
{{else}}
<div class="empty">
<div class="empty-icon">{{template "icon-antenna" ""}}</div>
<p class="empty-title">No repeaters yet</p>
<p class="empty-subtitle text-secondary">Add one to grant MeshTender access and test it with a modem.</p>
<div class="empty-action">
<a href="/repeaters/add" class="btn btn-primary">{{template "icon-plus" "me-1"}}Add repeater</a>
</div>
</div>
{{end}}
{{end}}
{{/* sharetext renders a repeater's sharing summary as plain text: e.g.
"Shared with 3 users, 2 organizations", omitting a zero count, or
"Not shared" when both are zero. Dot is a *store.ShareCount {Users, Orgs}. */}}
{{define "sharetext"}}{{if and (eq .Users 0) (eq .Orgs 0)}}Not shared{{else}}Shared with{{if gt .Users 0}} {{.Users}} user{{if ne .Users 1}}s{{end}}{{end}}{{if and (gt .Users 0) (gt .Orgs 0)}},{{end}}{{if gt .Orgs 0}} {{.Orgs}} organization{{if ne .Orgs 1}}s{{end}}{{end}}{{end}}{{end}}