| 1 | {{define "up"}}{{if .Machines.Adding}}/conversation/settings/machines{{else}}{{template "settings-up" .}}{{end}}{{end}} |
| 2 | {{define "up-label"}}{{if .Machines.Adding}}{{copy "runner.title"}}{{else}}{{template "settings-up-label" .}}{{end}}{{end}} |
| 3 | {{define "title"}}{{if .Machines.Adding}}{{copy "machines.add"}}{{else}}{{copy "runner.title"}}{{end}}{{end}} |
| 4 | {{/* The Machines screens (machines_view.go). A row is a <details>: its |
| 5 | summary is the compact line, the rest opens under it. Revoke and |
| 6 | Remove now are quiet and each asks once more before it posts the |
| 7 | same form as ever. */}} |
| 8 | {{define "mach-row"}}{{$m := .Row}}<details equipo-mach data-machine="{{$m.ID}}" data-state="{{$m.State}}"> |
| 9 | <summary equipo-mach-sum><span equipo-pmark data-s="{{$m.State}}" aria-hidden="true">{{icon $m.Mark}}</span><span equipo-mach-body><span equipo-conn-head><span equipo-conn-name>{{$m.Name}}</span>{{if .Others}}<span equipo-conn-account>{{$m.Person}}</span>{{end}}</span><span equipo-conn-facts><span equipo-conn-state data-s="{{$m.State}}" data-machine-state>{{$m.Words}}</span>{{with $m.Seen}}<span>{{.}}</span>{{end}}<span data-machine-role>{{$m.Role}}</span>{{with $m.Platform}}<span data-machine-platform>{{.}}</span>{{end}}</span>{{if eq $m.State "never"}}<span equipo-mach-hint data-never-hint>{{copy "machines.never_hint"}}</span>{{end}}</span>{{icon "chevron-down"}}</summary> |
| 10 | <div equipo-mach-detail> |
| 11 | <dl equipo-mach-facts> |
| 12 | <dt>{{copy "runner.platform"}}</dt><dd>{{with $m.Raw}}{{.}}{{else}}<span equipo-mach-unknown>{{copy "machines.not_reported"}}</span>{{end}}</dd> |
| 13 | <dt>{{copy "machines.version"}}</dt><dd>{{with $m.Version}}{{.}}{{else}}<span equipo-mach-unknown>{{copy "machines.not_reported"}}</span>{{end}}</dd> |
| 14 | <dt>{{copy "machines.protocol"}}</dt><dd>{{with $m.Protocol}}{{.}}{{else}}<span equipo-mach-unknown>{{copy "machines.not_reported"}}</span>{{end}}</dd> |
| 15 | {{with $m.Tags}}<dt>{{copy "machines.tags"}}</dt><dd>{{.}}</dd>{{end}} |
| 16 | {{with $m.Report}}{{with .Sandbox}}<dt>{{copy "runner.checks_run"}}</dt><dd data-sandbox="{{.}}">{{copy (printf "runner.sandbox.%s" .)}}</dd>{{end}}{{end}} |
| 17 | {{with $m.Report}}{{with .Engineering}}<dt>{{copy "runner.engineering"}}</dt><dd data-engineering="{{$m.Report.EngineeringState}}">{{.}}</dd>{{end}}{{end}} |
| 18 | {{with $m.Enrolled}}<dt>{{copy "machines.enrolled"}}</dt><dd>{{.}}</dd>{{end}} |
| 19 | {{with $m.EnrolledBy}}<dt>{{copy "machines.enrolled_by"}}</dt><dd>{{.}}</dd>{{end}} |
| 20 | {{if .Others}}<dt>{{copy "runner.person"}}</dt><dd>{{$m.Person}}</dd>{{end}} |
| 21 | <dt>{{copy "runner.fingerprint"}}</dt><dd equipo-mach-key>{{$m.Fingerprint}}</dd> |
| 22 | </dl> |
| 23 | {{if and $m.Tainted $m.HoldsClaude}}<p equipo-mach-note data-tainted data-holds-claude>{{copy "runner.tainted_held"}}</p>{{else if $m.Tainted}}<p equipo-mach-note data-tainted>{{copy "runner.tainted"}}</p>{{else if $m.HoldsClaude}}<p equipo-mach-note data-holds-claude>{{copy "runner.mac.holds_claude"}}</p>{{end}} |
| 24 | {{with $m.Report}}{{range .Guards}}<p equipo-mach-note data-guard>{{.}}</p>{{end}}{{end}} |
| 25 | {{with $m.Report}}{{with .Unproven}}<p equipo-mach-note data-unproven>{{.}}</p>{{end}}{{end}} |
| 26 | {{with $m.Report}}{{if .Probes}}<h4 equipo-mach-sub>{{copy "runner.probes"}}</h4> |
| 27 | <ul equipo-probes>{{range .Probes}}<li data-probe="{{.ID}}" data-verdict="{{.Verdict}}"><span>{{copy (printf "runner.probe.%s" .ID)}}</span> <span equipo-probe-verdict>{{copy (printf "runner.verdict.%s" .Verdict)}}</span>{{with .Detail}} <span equipo-quiet>{{.}}</span>{{end}}</li>{{end}}</ul>{{end}}{{end}} |
| 28 | {{with $m.Record}} |
| 29 | {{if .TrialOwner}}<p>{{copy "trial.history"}}: {{.TrialOwner}} / {{.TrialAt}}</p><pre>{{.TrialVersions}}</pre>{{end}} |
| 30 | {{end}} |
| 31 | {{if not $m.Revoked}}<div equipo-mach-actions>{{if $m.Removing}}<p equipo-mach-note>{{copy "runner.removing"}}</p>{{else}}<details equipo-mach-confirm><summary rst-btn data-quiet>{{copy "runner.revoke"}}</summary><div><p>{{copy "machines.revoke_confirm"}}</p><form method="post" action="/runners/{{$m.ID}}/revoke" equipo-inline-form> |
| 32 | <input type="hidden" name="revision" value="{{$m.Revision}}"> |
| 33 | <button rst-btn type="submit" data-revoke>{{copy "machines.revoke_yes"}}</button> |
| 34 | </form></div></details>{{end}}<details equipo-mach-confirm><summary rst-btn data-quiet>{{copy "runner.remove_now"}}</summary><div><p>{{copy "machines.remove_confirm"}}</p><form method="post" action="/runners/{{$m.ID}}/remove-now" equipo-inline-form> |
| 35 | <input type="hidden" name="revision" value="{{$m.Revision}}"> |
| 36 | <button rst-btn type="submit" data-danger data-remove-now>{{copy "machines.remove_yes"}}</button> |
| 37 | </form></div></details></div>{{end}} |
| 38 | </div> |
| 39 | </details>{{end}} |
| 40 | {{define "content"}} |
| 41 | <div equipo-settings-layout data-section="machines"> |
| 42 | {{template "settings-nav" .}} |
| 43 | <section equipo-settings-body equipo-machines data-machines{{if .Machines.Adding}} data-adding data-src="/conversation/settings/machines/add"{{else}} data-src="/conversation/settings/machines"{{end}}> |
| 44 | {{if .Machines.Adding}}{{template "settings-head" (dict "Title" "machines.add" "Lede" "machines.add_lede")}} |
| 45 | {{if .UserCode}}<div equipo-conn-card data-approve-machine> |
| 46 | <div equipo-conn-card-head><span equipo-pmark aria-hidden="true">{{icon "monitor"}}</span><div><h3>{{printf (copy "runner.add_title") .Enrolment.Label}}</h3><p>{{copy "runner.confirm"}}</p></div></div> |
| 47 | <dl equipo-mach-facts> |
| 48 | <dt>{{copy "runner.label"}}</dt><dd>{{.Enrolment.Label}}</dd> |
| 49 | <dt>{{copy "runner.requested"}}</dt><dd>{{.Enrolment.RequestedAt.UTC.Format (copy "runner.requested_format")}}</dd> |
| 50 | <dt>{{copy "runner.fingerprint"}}</dt><dd equipo-mach-key>{{.Enrolment.MachineKeyHash}}</dd> |
| 51 | <dt>{{copy "runner.person"}}</dt><dd>{{.Address}}</dd> |
| 52 | </dl> |
| 53 | <p equipo-conn-small>{{copy "runner.origin"}} <span>{{.Origin}}</span></p> |
| 54 | <div equipo-conn-card-foot><span></span><form method="post" action="/runners/enrol" equipo-inline-form> |
| 55 | <input type="hidden" name="action" value="approve"> |
| 56 | <input type="hidden" name="confirmation" value="{{.PairingConfirmation}}"> |
| 57 | <input type="hidden" name="user_code" value="{{.UserCode}}"> |
| 58 | <button rst-btn="primary" type="submit">{{copy "runner.approve"}}</button> |
| 59 | </form></div> |
| 60 | </div> |
| 61 | {{else}}<div equipo-conn-card data-add-machine-steps> |
| 62 | <ol equipo-conn-steps> |
| 63 | <li><div><p>{{copy "machines.step_install"}}</p>{{with .Machines.Install}}<div equipo-conn-code-row><code equipo-conn-code data-command data-install>{{.}}</code><button type="button" rst-btn data-copy="{{.}}" data-copied="{{copy "chat.connections.copied"}}">{{copy "chat.connections.copy"}}</button></div>{{else}}<p equipo-conn-small>{{copy "runner.install.release"}}</p>{{end}}</div></li> |
| 64 | <li><div><p>{{copy "machines.step_code"}}</p><form method="post" action="/runners/enrol" equipo-conn-token autocomplete="off"> |
| 65 | <input type="hidden" name="action" value="inspect"> |
| 66 | <label for="machine-code">{{copy "runner.code"}}</label><span equipo-conn-token-row><input rst-input id="machine-code" name="user_code" minlength="10" maxlength="10" autocomplete="off" autocapitalize="characters" spellcheck="false" required><button rst-btn type="submit">{{copy "runner.inspect"}}</button></span> |
| 67 | </form></div></li> |
| 68 | <li><div><p>{{copy "machines.step_approve"}}</p></div></li> |
| 69 | </ol> |
| 70 | </div>{{end}} |
| 71 | <div data-machines-live> |
| 72 | <section equipo-conn-group data-new-machines><h2>{{copy "machines.new"}}{{if .Machines.New}} <span equipo-conn-n>{{len .Machines.New}}</span>{{end}}</h2> |
| 73 | {{if .Machines.New}}<div equipo-conn-list>{{range .Machines.New}}{{template "mach-row" (dict "Row" . "Others" false)}}{{end}}</div>{{else}}<p equipo-mach-none>{{copy "machines.new_none"}}</p>{{end}} |
| 74 | </section> |
| 75 | </div> |
| 76 | {{else}}{{template "settings-head" (dict "Title" "runner.title" "Lede" "machines.lede")}} |
| 77 | <section equipo-conn-group rst-stack id="previews" data-previews><h2>{{copy "machines.previews"}}</h2>{{with .Machines.Previews}}<p data-previews-host>{{.}}</p>{{else}}<p data-previews-none>{{copy "machines.previews_none"}}</p><p>{{copy "machines.previews_lede"}}</p><p>{{copy "machines.previews_devbox_how"}}</p><p>{{copy "machines.previews_carloku_how"}}</p>{{end}}</section> |
| 78 | <div data-machines-live> |
| 79 | {{if or .Machines.Mine .Machines.Others}}<section equipo-conn-group data-my-machines><h2>{{copy "machines.mine"}} <span equipo-conn-n>{{len .Machines.Mine}}</span></h2> |
| 80 | {{if .Machines.Mine}}<div equipo-conn-list>{{range .Machines.Mine}}{{template "mach-row" (dict "Row" . "Others" false)}}{{end}}</div>{{else}}<p equipo-mach-none>{{copy "machines.mine_none"}}</p>{{end}} |
| 81 | <div equipo-conn-add-foot><a rst-btn href="/conversation/settings/machines/add" data-add-machine>{{icon "plus"}}{{copy "machines.add"}}</a><span>{{copy "machines.add_hint"}}</span></div> |
| 82 | </section> |
| 83 | {{with .Machines.Others}}<details equipo-mach-others data-other-machines><summary><span>{{copy "machines.others"}}</span> <span equipo-conn-n>{{len .}}</span>{{icon "chevron-down"}}</summary> |
| 84 | <div equipo-conn-list>{{range .}}{{template "mach-row" (dict "Row" . "Others" true)}}{{end}}</div> |
| 85 | </details>{{end}} |
| 86 | {{else}}<section equipo-conn-empty data-empty-state="machines.empty_title"><p equipo-conn-pair><span equipo-pmark aria-hidden="true">{{icon "laptop"}}</span><span equipo-pmark aria-hidden="true">{{icon "server"}}</span></p> |
| 87 | <h2>{{copy "machines.empty_title"}}</h2> |
| 88 | <p>{{copy "machines.empty_body"}}</p> |
| 89 | <a rst-btn="primary" href="/conversation/settings/machines/add" data-add-machine>{{icon "plus"}}{{copy "machines.add"}}</a> |
| 90 | </section>{{end}} |
| 91 | </div> |
| 92 | {{end}} |
| 93 | </section> |
| 94 | </div> |
| 95 | {{end}} |
| 96 | |