| 1 | {{ define "page" -}} |
| 2 | {{ template "repo-header" . }} |
| 3 | <section class="shithub-actions-page"> |
| 4 | <aside class="shithub-actions-sidebar" aria-label="Actions navigation"> |
| 5 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/actions" class="shithub-actions-nav-item{{ if not .Filters.Workflow }} is-active{{ end }}"{{ if not .Filters.Workflow }} aria-current="page"{{ end }}> |
| 6 | {{ octicon "play" }} <span>All workflows</span> |
| 7 | <span class="shithub-actions-nav-count">{{ .RunCount }}</span> |
| 8 | </a> |
| 9 | <div class="shithub-actions-sidebar-section"> |
| 10 | <h2>Workflows</h2> |
| 11 | {{ if .Workflows }} |
| 12 | {{ range .Workflows }} |
| 13 | <a href="{{ .Href }}" class="shithub-actions-nav-item{{ if .Active }} is-active{{ end }}"{{ if .Active }} aria-current="page"{{ end }}> |
| 14 | {{ octicon "workflow" }} <span>{{ .Name }}</span> |
| 15 | <span class="shithub-actions-nav-count">{{ .Count }}</span> |
| 16 | </a> |
| 17 | {{ end }} |
| 18 | {{ else }} |
| 19 | <p>No workflows have run yet.</p> |
| 20 | {{ end }} |
| 21 | </div> |
| 22 | </aside> |
| 23 | |
| 24 | <div class="shithub-actions-main"> |
| 25 | <header class="shithub-actions-head"> |
| 26 | <div> |
| 27 | <h1>{{ if .ActiveWorkflowName }}{{ .ActiveWorkflowName }}{{ else }}All workflows{{ end }}</h1> |
| 28 | <p>{{ .Pagination.ResultText }}</p> |
| 29 | </div> |
| 30 | <div class="shithub-actions-head-actions"> |
| 31 | {{ if .DispatchWorkflows }} |
| 32 | <details class="shithub-actions-dispatch"> |
| 33 | <summary class="shithub-button">{{ octicon "play" }} Run workflow</summary> |
| 34 | <div class="shithub-actions-dispatch-menu"> |
| 35 | {{ range .DispatchWorkflows }} |
| 36 | <form method="POST" action="{{ .DispatchHref }}" class="shithub-actions-dispatch-form"> |
| 37 | <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 38 | <header> |
| 39 | <h2>{{ .Name }}</h2> |
| 40 | <code>{{ .File }}</code> |
| 41 | </header> |
| 42 | <label> |
| 43 | <span>Branch</span> |
| 44 | <input type="text" name="ref" value="{{ $.Repo.DefaultBranch }}" required> |
| 45 | </label> |
| 46 | {{ range .Inputs }} |
| 47 | <label> |
| 48 | <span>{{ .Name }}{{ if .Required }} <strong>*</strong>{{ end }}</span> |
| 49 | {{ if .Description }}<small>{{ .Description }}</small>{{ end }} |
| 50 | {{ if .IsChoice }} |
| 51 | <select name="inputs.{{ .Name }}"{{ if .Required }} required{{ end }}> |
| 52 | {{ if not .Required }}<option value=""></option>{{ end }} |
| 53 | {{ range .Options }}<option value="{{ .Value }}"{{ if .Selected }} selected{{ end }}>{{ .Value }}</option>{{ end }} |
| 54 | </select> |
| 55 | {{ else if .IsBoolean }} |
| 56 | <span class="shithub-actions-dispatch-check"> |
| 57 | <input type="hidden" name="inputs.{{ .Name }}" value="false"> |
| 58 | <input type="checkbox" name="inputs.{{ .Name }}" value="true"{{ if eq .Default "true" }} checked{{ end }}> |
| 59 | </span> |
| 60 | {{ else }} |
| 61 | <input type="text" name="inputs.{{ .Name }}" value="{{ .Default }}"{{ if .Required }} required{{ end }}> |
| 62 | {{ end }} |
| 63 | </label> |
| 64 | {{ end }} |
| 65 | <button type="submit" class="shithub-button shithub-button-primary">{{ octicon "play" }} Run</button> |
| 66 | </form> |
| 67 | {{ end }} |
| 68 | </div> |
| 69 | </details> |
| 70 | {{ end }} |
| 71 | <a class="shithub-button" href="/{{ .Owner }}/{{ .Repo.Name }}/settings/secrets/actions">{{ octicon "gear" }} Actions settings</a> |
| 72 | </div> |
| 73 | </header> |
| 74 | |
| 75 | <form class="shithub-actions-filters" method="GET" action="/{{ .Owner }}/{{ .Repo.Name }}/actions" aria-label="Workflow run filters"> |
| 76 | {{ if .Filters.Workflow }}<input type="hidden" name="workflow" value="{{ .Filters.Workflow }}">{{ end }} |
| 77 | <label class="shithub-actions-search"> |
| 78 | {{ octicon "git-branch" }} |
| 79 | <span class="sr-only">Branch</span> |
| 80 | <input type="search" name="branch" value="{{ .Filters.Branch }}" placeholder="Branch"> |
| 81 | </label> |
| 82 | <label class="shithub-actions-select"> |
| 83 | <span class="sr-only">Event</span> |
| 84 | <select name="event" aria-label="Event"> |
| 85 | {{ range .EventOptions }}<option value="{{ .Value }}"{{ if .Selected }} selected{{ end }}>{{ .Label }}</option>{{ end }} |
| 86 | </select> |
| 87 | </label> |
| 88 | <label class="shithub-actions-select"> |
| 89 | <span class="sr-only">Status</span> |
| 90 | <select name="status" aria-label="Status"> |
| 91 | {{ range .StatusOptions }}<option value="{{ .Value }}"{{ if .Selected }} selected{{ end }}>{{ .Label }}</option>{{ end }} |
| 92 | </select> |
| 93 | </label> |
| 94 | <label class="shithub-actions-select"> |
| 95 | <span class="sr-only">Conclusion</span> |
| 96 | <select name="conclusion" aria-label="Conclusion"> |
| 97 | {{ range .ConclusionOptions }}<option value="{{ .Value }}"{{ if .Selected }} selected{{ end }}>{{ .Label }}</option>{{ end }} |
| 98 | </select> |
| 99 | </label> |
| 100 | <label class="shithub-actions-search shithub-actions-actor-filter"> |
| 101 | {{ octicon "person" }} |
| 102 | <span class="sr-only">Actor</span> |
| 103 | <input type="search" name="actor" value="{{ .Filters.Actor }}" placeholder="Actor"> |
| 104 | </label> |
| 105 | <button type="submit" class="shithub-button">{{ octicon "search" }} Filter</button> |
| 106 | {{ if .Filters.HasAny }}<a class="shithub-button" href="/{{ .Owner }}/{{ .Repo.Name }}/actions">Clear</a>{{ end }} |
| 107 | </form> |
| 108 | |
| 109 | {{ if .Runs }} |
| 110 | <div class="shithub-actions-runs" aria-label="Workflow runs"> |
| 111 | {{ range .Runs }} |
| 112 | <article class="shithub-actions-run-row"> |
| 113 | <div class="shithub-actions-run-primary"> |
| 114 | <a href="{{ .Href }}" class="shithub-actions-run-title" aria-label="{{ .StateText }}: {{ .Title }}"> |
| 115 | <span class="shithub-actions-state shithub-actions-state-{{ .StateClass }}">{{ octicon .StateIcon }}</span> |
| 116 | <span>{{ .Title }}</span> |
| 117 | </a> |
| 118 | <p> |
| 119 | <strong>#{{ .RunIndex }}</strong> |
| 120 | triggered via {{ .EventLabel }} |
| 121 | {{ if .ActorUsername }}by <a href="/{{ .ActorUsername }}">{{ .ActorUsername }}</a>{{ end }} |
| 122 | for <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .HeadSha }}"><code>{{ .HeadShaShort }}</code></a> |
| 123 | </p> |
| 124 | </div> |
| 125 | <div class="shithub-actions-run-branch"> |
| 126 | {{ if .HeadRef }}<a class="shithub-branch-name" href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .HeadRef }}">{{ .HeadRef }}</a>{{ else }}<code>{{ .HeadShaShort }}</code>{{ end }} |
| 127 | </div> |
| 128 | <div class="shithub-actions-run-meta"> |
| 129 | <span>{{ octicon "calendar" }} <time datetime="{{ .UpdatedAt.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .UpdatedAt }}</time></span> |
| 130 | <span>{{ octicon "stopwatch" }} {{ .Duration }}</span> |
| 131 | <button type="button" class="shithub-icon-button" aria-label="Show run options">{{ octicon "kebab-horizontal" }}</button> |
| 132 | </div> |
| 133 | </article> |
| 134 | {{ end }} |
| 135 | </div> |
| 136 | <nav class="shithub-actions-pagination" aria-label="Workflow run pagination"> |
| 137 | <span>{{ .Pagination.ResultText }}</span> |
| 138 | <div> |
| 139 | {{ if .Pagination.HasPrev }}<a class="shithub-button" href="{{ .Pagination.PrevHref }}">Previous</a>{{ else }}<span class="shithub-button shithub-button-disabled" aria-disabled="true">Previous</span>{{ end }} |
| 140 | {{ if .Pagination.HasNext }}<a class="shithub-button" href="{{ .Pagination.NextHref }}">Next</a>{{ else }}<span class="shithub-button shithub-button-disabled" aria-disabled="true">Next</span>{{ end }} |
| 141 | </div> |
| 142 | </nav> |
| 143 | {{ else }} |
| 144 | <section class="shithub-actions-empty"> |
| 145 | <div class="shithub-actions-empty-icon">{{ octicon "play" }}</div> |
| 146 | <h2>{{ if .Filters.HasAny }}No workflow runs match these filters{{ else }}There are no workflow runs yet{{ end }}</h2> |
| 147 | <p>{{ if .Filters.HasAny }}Clear or adjust the filters to see other runs.{{ else }}Runs from `.shithub/workflows/*.yml` will appear here after a trigger enqueues them.{{ end }}</p> |
| 148 | </section> |
| 149 | {{ end }} |
| 150 | </div> |
| 151 | </section> |
| 152 | {{- end }} |