A vibe coded tangled fork which supports pijul.
at 1237bf9f58e4ba5d13d5437f2f82a2078572e229 86 lines 2.4 kB view raw
1{{template "base" .}} 2{{define "content"}} 3<h2>Repositories</h2> 4 5<div class="filters"> 6 <form 7 hx-get="" 8 hx-target="#table" 9 hx-select="#table" 10 hx-swap="outerHTML" 11 hx-trigger="every 10s" 12 > 13 <input type="text" name="did" placeholder="DID" value="{{.FilterByDid}}"> 14 <input type="text" name="knot" placeholder="Knot Domain" value="{{.FilterByKnot}}"> 15 <select name="state"> 16 <option value="">-- State --</option> 17 {{ range const.AllRepoStates }} 18 <option value="{{.}}" {{ if eq $.FilterByState . }}selected{{end}}>{{.}}</option> 19 {{ end }} 20 </select> 21 <button type="submit">Filter</button> 22 <a href="/repos">Clear</a> 23 </form> 24</div> 25 26<div id="table"> 27 <div class="repo-state-indicators"> 28 {{range .FilterByState.AllStates}} 29 <span class="state-pill state-{{.}}"> 30 {{.}}: {{index $.RepoCounts .}} 31 </span> 32 {{end}} 33 </div> 34 <table> 35 <thead> 36 <tr> 37 <th>DID</th> 38 <th>Name</th> 39 <th>Knot</th> 40 <th>State</th> 41 <th>Retry</th> 42 <th>Retry After</th> 43 <th>Error Message</th> 44 <th>Action</th> 45 </tr> 46 </thead> 47 <tbody> 48 {{range .Repos}} 49 <tr> 50 <td><code>{{.Did}}</code></td> 51 <td>{{.Name}}</td> 52 <td>{{.KnotDomain}}</td> 53 <td><strong>{{.State}}</strong></td> 54 <td>{{.RetryCount}}</td> 55 <td>{{readt .RetryAfter}}</td> 56 <td>{{.ErrorMsg}}</td> 57 <td> 58 <form 59 {{ if .State.IsResyncing -}} 60 hx-post="/api/cancelRepoResync" 61 {{- else -}} 62 hx-post="/api/triggerRepoResync" 63 {{- end }} 64 hx-swap="none" 65 hx-disabled-elt="find button" 66 > 67 <input type="hidden" name="repo" value="{{.AtUri}}"> 68 <button type="submit">{{ if .State.IsResyncing }}cancel{{ else }}resync{{ end }}</button> 69 </form> 70 </td> 71 </tr> 72 {{else}} 73 <tr><td colspan="99">No repositories found.</td></tr> 74 {{end}} 75 </tbody> 76 </table> 77</div> 78 79<div class="pagination"> 80 {{if gt .Page 1}} 81 <a href="?page={{sub .Page 1}}&did={{.FilterByDid}}&knot={{.FilterByKnot}}&state={{.FilterByState}}">« Previous</a> 82 {{end}} 83 <span>Page {{.Page}}</span> 84 <a href="?page={{add .Page 1}}&did={{.FilterByDid}}&knot={{.FilterByKnot}}&state={{.FilterByState}}">Next »</a> 85</div> 86{{end}}