mirror of
https://github.com/MeshTender/MeshTender.git
synced 2026-09-09 13:15:33 +00:00
58 lines
2.4 KiB
HTML
58 lines
2.4 KiB
HTML
{{define "title"}}Console · {{.Repeater.Name}} · MeshTender{{end}}
|
|
{{define "header"}}
|
|
<div class="row g-2 align-items-center">
|
|
<div class="col">
|
|
<div class="page-pretitle">Console</div>
|
|
<h2 class="page-title">{{.Repeater.Name}}</h2>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{define "content"}}
|
|
<div class="alert alert-info" role="alert">
|
|
Connect a MeshCore KISS modem and send commands to this repeater. You can run the commands in the
|
|
Allowed commands list; the server enforces what you're allowed to send.
|
|
</div>
|
|
|
|
<div class="row row-cards">
|
|
<div class="col-12 col-lg-8">
|
|
<div class="card">
|
|
<div class="card-header"><h3 class="card-title">Console</h3></div>
|
|
<div class="card-body">
|
|
<div id="unsupported" class="alert alert-danger" role="alert" hidden>
|
|
This browser does not support WebSerial. Use Chrome, Edge, or another Chromium-based browser over HTTPS or on localhost.
|
|
</div>
|
|
<button id="connect" class="btn btn-primary" type="button">{{template "icon-plug" "me-1"}}Connect modem</button>
|
|
<ul id="log" class="evlog console mt-3" role="log" aria-live="polite" aria-label="Console activity"></ul>
|
|
<form id="cmdform" class="input-group mt-3" autocomplete="off" hidden>
|
|
<input type="text" id="cmdinput" class="form-control font-monospace" placeholder="type a command, e.g. ver" aria-label="Command to send">
|
|
<button type="submit" id="cmdsend" class="btn btn-primary">Send</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-lg-4">
|
|
<div class="card">
|
|
<div class="card-header"><h3 class="card-title">Allowed commands</h3></div>
|
|
<div class="card-body">
|
|
{{if .Commands}}
|
|
<div class="d-flex flex-wrap gap-1" style="max-height:360px;overflow-y:auto">
|
|
{{range .Commands}}
|
|
<button type="button" class="chip btn btn-sm{{if .Risky}} btn-outline-danger{{end}}" data-template="{{.Template}}" title="{{.Args}}">{{.Template}}</button>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<p class="text-secondary mb-0">No commands allowed here yet.</p>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="back-link mt-3" href="/">{{template "icon-arrow-left" "me-1"}}Back to dashboard</a>
|
|
|
|
<script>
|
|
window.MESHTENDER_WS = (location.protocol === "https:" ? "wss://" : "ws://") + location.host + "/repeaters/{{.Repeater.PublicID}}/console/ws";
|
|
</script>
|
|
<script src="/static/console.js"></script>
|
|
{{end}}
|