mirror of
https://github.com/MeshTender/MeshTender.git
synced 2026-09-09 13:15:33 +00:00
134 lines
5.8 KiB
HTML
134 lines
5.8 KiB
HTML
{{define "title"}}Sharing · {{.Repeater.Name}} · MeshTender{{end}}
|
|
{{define "header"}}
|
|
<div class="row g-2 align-items-center">
|
|
<div class="col">
|
|
<div class="page-pretitle">Sharing</div>
|
|
<h2 class="page-title">{{.Repeater.Name}}</h2>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{define "content"}}
|
|
{{if .Error}}<div class="alert alert-danger">{{.Error}}</div>{{end}}
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<p class="text-secondary mb-0">
|
|
Decide who can operate this repeater. Everyone you grant access uses MeshTender's single identity, so
|
|
you never hand out keys — and you can revoke or withdraw at any time.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mt-3">
|
|
<div class="card-body">
|
|
<h3 class="card-title">Organizations</h3>
|
|
<p class="text-secondary">
|
|
Contribute this repeater to an organization so its admins and members can run their permitted
|
|
commands on it over the mesh — but only the specific commands you review and approve first. You can
|
|
withdraw anytime.
|
|
</p>
|
|
|
|
<div class="subheader mt-3 mb-2">Contributed to</div>
|
|
{{if .Contributed}}
|
|
<div class="list-group list-group-flush">
|
|
{{range .Contributed}}
|
|
<div class="list-group-item d-flex align-items-center flex-wrap gap-2 px-0">
|
|
<span class="fw-bold">{{.OrgName}}</span>
|
|
<span class="text-secondary"><a class="link-secondary" href="/repeaters/{{$.Repeater.PublicID}}/orgs/{{.OrgSlug}}/consented">consented to v{{.ConsentedVersion}}</a>{{if .NeedsReconsent}} · org is now on v{{.CurrentVersion}}{{end}}</span>
|
|
{{if .NeedsReconsent}}
|
|
<a class="btn btn-sm" href="/repeaters/{{$.Repeater.PublicID}}/orgs/{{.OrgSlug}}/contribute">Review changes</a>
|
|
{{end}}
|
|
<form method="post" action="/repeaters/{{$.Repeater.PublicID}}/orgs/{{.OrgSlug}}/withdraw" class="m-0 ms-auto" onsubmit="return confirm('Withdraw this repeater from {{.OrgName}}?')">
|
|
<button type="submit" class="btn btn-sm btn-ghost-danger">Withdraw</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<p class="text-secondary">Not contributed to any organization.</p>
|
|
{{end}}
|
|
|
|
{{if .Available}}
|
|
<div class="subheader mt-3 mb-2">Contribute to</div>
|
|
<div class="list-group list-group-flush">
|
|
{{range .Available}}
|
|
<div class="list-group-item d-flex align-items-center gap-2 px-0">
|
|
<span class="fw-bold">{{.Name}}</span>
|
|
<a class="btn btn-sm ms-auto" href="/repeaters/{{$.Repeater.PublicID}}/orgs/{{.Slug}}/contribute">Review & contribute</a>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else if .Contributed}}
|
|
{{else}}
|
|
<p class="text-secondary">Join an organization to contribute this repeater to it.</p>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mt-3">
|
|
<div class="card-body">
|
|
<h3 class="card-title">People</h3>
|
|
<p class="text-secondary">
|
|
Share single-use links with specific people. The recipient signs in and accepts to control this
|
|
repeater from their own browser-connected KISS modem.
|
|
</p>
|
|
|
|
<div class="subheader mt-3 mb-2">Share links</div>
|
|
<p class="text-secondary">Each link works once. Mint one per person and label it so you remember who it's for.</p>
|
|
<form method="post" action="/repeaters/{{.Repeater.PublicID}}/share/link">
|
|
<div class="mb-3">
|
|
<label class="form-label" for="share_description">Description <span class="text-secondary">(optional)</span></label>
|
|
<input type="text" class="form-control" id="share_description" name="description" placeholder="e.g. for Bob's modem" maxlength="100">
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Create single-use link</button>
|
|
</form>
|
|
|
|
{{if .Invites}}
|
|
<div class="list-group list-group-flush mt-3">
|
|
{{range .Invites}}
|
|
<div class="list-group-item px-0">
|
|
<div class="d-flex align-items-center gap-2 mb-1">
|
|
<span class="fw-bold">{{if .Description}}{{.Description}}{{else}}(no label){{end}}</span>
|
|
{{if .UsedAt}}<span class="badge bg-success-lt">Used by {{.UsedByName}}</span>{{else}}<span class="badge bg-yellow-lt">Unused</span>{{end}}
|
|
</div>
|
|
{{if not .UsedAt}}
|
|
<div class="input-group mb-2">
|
|
<code class="form-control font-monospace" id="link-{{.ID}}">{{$.BaseURL}}/invite/{{.Token}}</code>
|
|
<button type="button" class="btn" onclick="navigator.clipboard.writeText(document.getElementById('link-{{.ID}}').textContent)">{{template "icon-copy" ""}}Copy</button>
|
|
</div>
|
|
{{end}}
|
|
<form method="post" action="/repeaters/{{$.Repeater.PublicID}}/share/link/delete" class="m-0">
|
|
<input type="hidden" name="invite_id" value="{{.ID}}">
|
|
<button type="submit" class="btn btn-sm btn-ghost-danger">{{if .UsedAt}}Remove from list{{else}}Revoke link{{end}}</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<p class="text-secondary mt-2">No links yet.</p>
|
|
{{end}}
|
|
|
|
<div class="subheader mt-3 mb-2">People with access</div>
|
|
{{if .Shares}}
|
|
<div class="list-group list-group-flush">
|
|
{{range .Shares}}
|
|
<div class="list-group-item d-flex align-items-center flex-wrap gap-2 px-0">
|
|
<span class="fw-bold">{{.Name}}</span>
|
|
<span class="text-secondary">@{{.Username}}</span>
|
|
<a class="btn btn-sm ms-auto" href="/repeaters/{{$.Repeater.PublicID}}/share/{{.UserID}}/commands">Edit commands</a>
|
|
<form method="post" action="/repeaters/{{$.Repeater.PublicID}}/unshare" class="m-0">
|
|
<input type="hidden" name="user_id" value="{{.UserID}}">
|
|
<button type="submit" class="btn btn-sm btn-ghost-danger">Revoke</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<p class="text-secondary">No one has accepted yet.</p>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<a class="back-link mt-3" href="/">{{template "icon-arrow-left" "me-1"}}Back to dashboard</a>
|
|
{{end}}
|