clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

main
atlas / internal / workbench / templates / operations.tmpl
operations.tmpl 2.8K
1{{/*2 operations — the pipeline, and what it may be pointed at.34 Each form is an ordinary POST to /operations/run and works without the5 runtime: the browser renders the streamed rows itself. With the runtime, the6 same POST appends its rows to the console instead of navigating away7 (hx-swap="beforeend"), which is the streaming swap of issue #5 §4.3 and the8 same shape the application's import stream takes.910 Nothing runs on a schedule or at startup. An operation exists only between a11 submitted form and its subprocess's exit, and it dies with the request.12*/}}13{{define "title"}}Operations{{end}}14{{define "content"}}15<section class="page-head">16 <h1>Operations</h1>17 <p class="dim">18 binary <b>{{if .Targets.Atlas}}{{.Targets.Atlas}}{{else}}not configured{{end}}</b> ·19 archive <b>{{if .Targets.Archive}}{{.Targets.Archive}}{{else}}not configured{{end}}</b> ·20 tiles <b>{{if .Targets.TileSet}}{{.Targets.TileSet}}{{else}}not configured{{end}}</b> ·21 registry <b>{{if .Targets.Registry}}{{.Targets.Registry}}{{else}}not configured{{end}}</b>22 </p>23 {{if .Busy}}<p class="warn">An operation is already running: {{.Busy}}. One runs at a time.</p>{{end}}24</section>2526<div class="columns">27{{range .Operations}}28<section class="card operation">29 <h2>{{.Name}}</h2>30 <p class="dim">{{.Summary}}</p>31 {{if not .Ready}}32 <p class="warn">{{.Missing}}</p>33 {{else if .Source}}34 {{/* One form per source, because a target only means something beside the35 source that reads it: the hint on the field is that source's own. */}}36 {{range $.Sources}}37 <form method="post" action="/operations/run"38 hx-post="/operations/run" hx-target="#op-log" hx-swap="beforeend">39 <input type="hidden" name="op" value="crawl">40 <input type="hidden" name="source" value="{{.Name}}">41 <label for="target-{{.Name}}">{{.Label}}</label>42 <input id="target-{{.Name}}" name="target" required placeholder="{{.TargetHint}}">43 <button>Fetch</button>44 </form>45 {{else}}46 <p class="dim">No registered source is crawled from here: the game sources' captures are47 archived and their endpoints are somebody else's editorial work.</p>48 {{end}}49 {{else}}50 <form method="post" action="/operations/run"51 hx-post="/operations/run" hx-target="#op-log" hx-swap="beforeend">52 <input type="hidden" name="op" value="{{.Name}}">53 {{if .Volumes}}54 <label for="volume-{{.Name}}">volume</label>55 <input id="volume-{{.Name}}" name="volume" placeholder="every volume">56 {{end}}57 <button>Run {{.Name}}</button>58 </form>59 {{end}}60</section>61{{end}}62</div>6364<section class="card">65 <h2>Console</h2>66 <p class="dim">The run's own event stream, a row at a time, as it arrives.</p>67 <div id="op-log" class="console" aria-live="polite"></div>68</section>69{{end}}