jojo/templates/shared/actions/runner_details.tmpl
Andreas Ahlenstorf d8534ba123 feat: scope-specific headings for list of recent tasks (#11690)
As requested in https://codeberg.org/forgejo/forgejo/pulls/11516#issuecomment-11430034, the headings of the list of recent tasks that were executed on a particular runner now indicate that only tasks are listed that originated in the current scope.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests for Go changes

(can be removed for JavaScript changes)

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I ran...
  - [x] `make pr-go` before pushing

### Tests for JavaScript changes

(can be removed for Go changes)

- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [x] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [ ] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change.
- [ ] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change.

*The decision if the pull request will be shown in the release notes is up to the mergers / release team.*

The content of the `release-notes/<pull request number>.md` file will serve as the basis for the release notes. If the file does not exist, the title of the pull request will be used instead.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11690
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Andreas Ahlenstorf <andreas@ahlenstorf.ch>
Co-committed-by: Andreas Ahlenstorf <andreas@ahlenstorf.ch>
2026-03-17 03:02:09 +01:00

140 lines
4 KiB
Go HTML Template

<div class="runner-container">
<h4 class="ui top attached header">
{{ctx.Locale.Tr "actions.runners.runner_title" .Runner.Name}}
{{if .Runner.Editable $.RunnerOwnerID $.RunnerRepoID}}
<div class="ui right">
<a class="ui primary tiny button" tabindex="0" href="{{$.Link}}/edit">
{{ctx.Locale.Tr "actions.runners.edit_runner_button"}}
</a>
</div>
{{end}}
</h4>
<div class="ui attached segment">
<dl aria-label="Properties of {{.Runner.Name}}">
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.uuid"}}</dt>
<dd>
{{.Runner.UUID}}
</dd>
</div>
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.owner_type"}}</dt>
<dd>
{{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}
</dd>
</div>
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.labels"}}</dt>
<dd class="tw-flex tw-items-start tw-flex-wrap tw-gap-2">
{{if gt (len .Runner.AgentLabels) 0}}
{{range .Runner.AgentLabels}}
<div class="ui label">{{.}}</div>
{{end}}
{{else}}
&mdash;
{{end}}
</dd>
</div>
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.last_online"}}</dt>
<dd>
<div>
{{if .Runner.LastOnline}}
{{DateUtils.TimeSince .Runner.LastOnline}}
{{else}}
{{ctx.Locale.Tr "never"}}
{{end}}
</div>
</dd>
</div>
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.status"}}</dt>
<dd class="tw-flex tw-items-center tw-gap-x-2">
{{if .Runner.IsActive}}
<div class="indicator-active">
<div></div>
</div>
{{else if .Runner.IsIdle}}
<div class="indicator-idle">
<div></div>
</div>
{{else}}
<div class="indicator-offline">
<div></div>
</div>
{{end}}
<div>
{{.Runner.StatusLocaleName ctx.Locale}}
</div>
</dd>
</div>
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.ephemeral"}}</dt>
<dd>
{{if .Runner.Ephemeral}}
{{ctx.Locale.Tr "actions.runners.ephemeral.yes"}}
{{else}}
{{ctx.Locale.Tr "actions.runners.ephemeral.no"}}
{{end}}
</dd>
</div>
<div class="item">
<dt>{{ctx.Locale.Tr "actions.runners.description"}}</dt>
<dd>
{{if .Runner.Description}}
{{.Runner.Description}}
{{else}}
&mdash;
{{end}}
</dd>
</div>
<p class="tw-mt-8 tw-italic">{{ctx.Locale.Tr "actions.runners.runner_details.labels_note"}}</p>
</dl>
</div>
<h4 class="ui top attached header">
{{if .IsRepo}}
{{ctx.Locale.Tr "actions.runners.task_list_repo"}}
{{else if .IsOrg}}
{{ctx.Locale.Tr "actions.runners.task_list_org"}}
{{else if .IsAdmin}}
{{ctx.Locale.Tr "actions.runners.task_list_admin"}}
{{else if .IsUser}}
{{ctx.Locale.Tr "actions.runners.task_list_user"}}
{{end}}
</h4>
<div class="ui attached segment">
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th>{{ctx.Locale.Tr "actions.runners.task_list.run"}}</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><a href="{{.GetRunLink}}" target="_blank">{{.ID}}</a></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>
<strong><a href="{{.GetCommitLink}}" target="_blank">{{ShortSha .CommitSHA}}</a></strong>
</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>