feat: show no runners available

This commit is contained in:
Jason Song 2023-01-06 15:33:02 +08:00
parent 7a4d4f0edf
commit e61d655929
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5
2 changed files with 38 additions and 31 deletions

View File

@ -3271,6 +3271,7 @@ runners.delete_runner_failed = Failed to delete runner
runners.delete_runner_header = Confirm to delete this runner
runners.delete_runner_notice = If a task is running on this runner, it will be terminated and mark as failed. It may break building workflow.
runners.delete_runner_confirm = Delete this runner
runners.none = No runners available
runners.status.unspecified = Unknown
runners.status.idle = Idle
runners.status.active = Active

View File

@ -55,37 +55,43 @@
</tr>
</thead>
<tbody>
{{range .Runners}}
<tr>
<td>
<span class="runner-status-{{if .IsOnline}}online{{else}}offline{{end}}">{{.StatusLocaleName $.locale}}</span>
</td>
<td>
{{if .Editable $.RunnerOnwerID $.RunnerRepoID}}
<a href="{{$.Link}}/{{.ID}}" class="tooltip" data-content="{{.Description}}">
<span class="runner-id">{{template "shared/actions/runner_id" .ID}}</span>
<span class="runner-name">{{.Name}}</span>
</a>
{{else}}
<p class="tooltip" data-content="{{.Description}}">
<span class="runner-id">{{template "shared/actions/runner_id" .ID}}</span>
<span class="runner-name">{{.Name}}</span>
</p>
{{end}}
</td>
<td>{{.OwnType}}</td>
<td class="runner-tags">
{{range .AllLabels}}
<span class="ui label">{{.}}</span>
{{end}}
</td>
<td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{$.locale.Tr "never"}}{{end}}</td>
<td class="runner-ops">
{{if .Editable $.RunnerOnwerID $.RunnerRepoID}}
<a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
{{end}}
</td>
</tr>
{{if .Runners}}
{{range .Runners}}
<tr>
<td>
<span class="runner-status-{{if .IsOnline}}online{{else}}offline{{end}}">{{.StatusLocaleName $.locale}}</span>
</td>
<td>
{{if .Editable $.RunnerOnwerID $.RunnerRepoID}}
<a href="{{$.Link}}/{{.ID}}" class="tooltip" data-content="{{.Description}}">
<span class="runner-id">{{template "shared/actions/runner_id" .ID}}</span>
<span class="runner-name">{{.Name}}</span>
</a>
{{else}}
<p class="tooltip" data-content="{{.Description}}">
<span class="runner-id">{{template "shared/actions/runner_id" .ID}}</span>
<span class="runner-name">{{.Name}}</span>
</p>
{{end}}
</td>
<td>{{.OwnType}}</td>
<td class="runner-tags">
{{range .AllLabels}}
<span class="ui label">{{.}}</span>
{{end}}
</td>
<td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{$.locale.Tr "never"}}{{end}}</td>
<td class="runner-ops">
{{if .Editable $.RunnerOnwerID $.RunnerRepoID}}
<a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
{{end}}
</td>
</tr>
{{end}}
{{else}}
<tr>
<td class="center aligned" colspan="6">{{.locale.Tr "actions.runners.none"}}</td>
</tr>
{{end}}
</tbody>
</table>