mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-31 20:35:01 +02:00
Backport #38586 by @bircni Several small fixes to the Actions runner management UI. ### Runner task list links to the job, not the workflow run Relabeled the first column from "Run" to "Job"; it now shows the job ID and links to the specific job (`/actions/runs/{runID}/jobs/{jobID}`). Renamed locale key `task_list.run` to `task_list.job`. ### Missing "Disabled" translation The runner list rendered a grey label via `actions.runners.disabled`, but that key did not exist in `locale_en-US.json`, so the raw key string leaked into the UI. Replaced `"actions.runners.disabled"` with `"disabled"`. ### Status column sorting ignored active vs idle Sorting by status ordered purely on `last_online`, but the displayed status is computed from both `last_online` (offline) and `last_active` (idle vs active). As a result idle runners were interleaved with active ones. Sorting now ranks by the computed status (active → idle → offline). Disabled runners sink to the bottom of their status group (`is_disabled` as a secondary key), with `last_online`/`id` as stable tiebreakers so pagination stays deterministic. ### Status label colors Active and idle both rendered green. Idle is now yellow, active green, and offline/unknown grey; the separate grey "Disabled" badge is unchanged. This keeps connectivity visible even for disabled runners (e.g. a disabled runner still shows whether it is idle or offline). <img width="715" height="406" alt="image" src="https://github.com/user-attachments/assets/9ef06aa8-a870-4de5-9d94-603a58186908" /> Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: Zettat123 <zettat123@gmail.com>
109 lines
4.2 KiB
Handlebars
109 lines
4.2 KiB
Handlebars
<div class="runner-container">
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "actions.runners.runner_title"}} {{.Runner.ID}} {{.Runner.Name}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<form class="ui form" method="post">
|
|
{{template "base/disable_form_autofill"}}
|
|
<div class="runner-basic-info">
|
|
<div class="field tw-inline-block tw-mr-4">
|
|
<label>{{ctx.Locale.Tr "actions.runners.status"}}</label>
|
|
<span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName ctx.Locale}}</span>
|
|
</div>
|
|
<div class="field tw-inline-block tw-mr-4">
|
|
<label>{{ctx.Locale.Tr "actions.runners.availability"}}</label>
|
|
<span class="ui {{if .Runner.IsDisabled}}grey{{else}}green{{end}} label">
|
|
{{if .Runner.IsDisabled}}
|
|
{{ctx.Locale.Tr "disabled"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "enabled"}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
<div class="field tw-inline-block tw-mr-4">
|
|
<label>{{ctx.Locale.Tr "actions.runners.last_online"}}</label>
|
|
<span>{{if .Runner.LastOnline}}{{DateUtils.TimeSince .Runner.LastOnline}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</span>
|
|
</div>
|
|
<div class="field tw-inline-block tw-mr-4">
|
|
<label>{{ctx.Locale.Tr "actions.runners.labels"}}</label>
|
|
<span class="flex-text-inline tw-flex-wrap">
|
|
{{range .Runner.AgentLabels}}
|
|
<span class="ui label">{{.}}</span>
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
<div class="field tw-inline-block tw-mr-4">
|
|
<label>{{ctx.Locale.Tr "actions.runners.owner_type"}}</label>
|
|
<span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<div class="field">
|
|
<label for="description">{{ctx.Locale.Tr "actions.runners.description"}}</label>
|
|
<input id="description" name="description" value="{{.Runner.Description}}">
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<div class="field">
|
|
<button class="ui primary button" data-url="{{.Link}}">{{ctx.Locale.Tr "actions.runners.update_runner"}}</button>
|
|
<button type="button" class="ui button link-action" data-url="{{.Link}}/update-runner?disabled={{not .Runner.IsDisabled}}">
|
|
{{if .Runner.IsDisabled}}{{ctx.Locale.Tr "actions.runners.enable_runner"}}{{else}}{{ctx.Locale.Tr "actions.runners.disable_runner"}}{{end}}
|
|
</button>
|
|
<button class="ui red button link-action" data-url="{{.Link}}/delete" data-modal-confirm="#runner-delete-modal">
|
|
{{ctx.Locale.Tr "actions.runners.delete_runner"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "actions.runners.task_list"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<table class="ui very basic table unstackable">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ctx.Locale.Tr "actions.runners.task_list.job"}}</th>
|
|
<th>{{ctx.Locale.Tr "actions.runners.task_list.status"}}</th>
|
|
<th>{{ctx.Locale.Tr "actions.runners.task_list.repository"}}</th>
|
|
<th>{{ctx.Locale.Tr "actions.runners.task_list.commit"}}</th>
|
|
<th>{{ctx.Locale.Tr "actions.runners.task_list.done_at"}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Tasks}}
|
|
<tr>
|
|
<td>{{if .Job}}<a href="{{.GetRunJobLink}}" target="_blank">{{.Job.ID}}</a>{{else}}{{.ID}}{{end}}</td>
|
|
<td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString ctx.Locale}}</span></td>
|
|
<td><a href="{{.GetRepoLink}}" target="_blank">{{.GetRepoName}}</a></td>
|
|
<td>
|
|
<a class="ui sha label" href="{{.GetCommitLink}}" target="_blank">{{ShortSha .CommitSHA}}</a>
|
|
</td>
|
|
<td>{{if .IsStopped}}
|
|
<span>{{DateUtils.TimeSince .Stopped}}</span>
|
|
{{else}}-{{end}}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{if not .Tasks}}
|
|
<tr>
|
|
<td colspan="5">{{ctx.Locale.Tr "actions.runners.task_list.no_tasks"}}</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{template "base/paginate" .}}
|
|
</div>
|
|
<div class="ui small modal" id="runner-delete-modal">
|
|
<div class="header">
|
|
{{svg "octicon-trash"}}
|
|
{{ctx.Locale.Tr "actions.runners.delete_runner_header"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{ctx.Locale.Tr "actions.runners.delete_runner_notice"}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm" .}}
|
|
</div>
|
|
</div>
|